@sparkle-learning/core 0.0.57 → 0.0.59

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 (1100) hide show
  1. package/dist/cjs/PrivateRoute-f97245ce.js +217 -0
  2. package/dist/cjs/active-router-f9e18bd8.js +75 -0
  3. package/dist/cjs/animation-ee586546.js +986 -0
  4. package/dist/cjs/app-globals-33c9f31b.js +9 -0
  5. package/dist/cjs/appdata.service-c8d71e05.js +73 -0
  6. package/dist/cjs/assets.service-bfa75092.js +50 -0
  7. package/dist/cjs/assignment.service-690fb59c.js +19 -0
  8. package/dist/cjs/auth.store-1e630a7d.js +3392 -0
  9. package/dist/cjs/compass-svg.cjs.entry.js +132 -0
  10. package/dist/cjs/context-consumer.cjs.entry.js +29 -0
  11. package/dist/cjs/course-select.cjs.entry.js +30 -0
  12. package/dist/cjs/cubic-bezier-53d26d05.js +93 -0
  13. package/dist/cjs/dir-5af5259a.js +20 -0
  14. package/dist/cjs/environment-config.service-c8ff1f3d.js +28 -0
  15. package/dist/cjs/facilitator.service-ff0e1659.js +95 -0
  16. package/dist/cjs/feed.service-8eca4de6.js +57 -0
  17. package/dist/cjs/focus-visible-b0b07ba6.js +76 -0
  18. package/dist/cjs/framework-delegate-59a98abd.js +111 -0
  19. package/dist/cjs/gesture-controller-0eb5579e.js +196 -0
  20. package/dist/cjs/haptic-780f33c4.js +116 -0
  21. package/dist/cjs/hardware-back-button-92d97ff8.js +76 -0
  22. package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +15124 -0
  23. package/dist/cjs/helpers-c2496722.js +425 -0
  24. package/dist/cjs/httpService-d2e7bf8f.js +687 -0
  25. package/dist/cjs/icons-fda820af.js +26 -0
  26. package/dist/cjs/index-12082cba.js +465 -0
  27. package/dist/cjs/index-15ea05f5.js +314 -0
  28. package/dist/cjs/index-51e8292e.js +1928 -0
  29. package/dist/cjs/index-787d4498.js +232 -0
  30. package/dist/cjs/index-8b5629a6.js +186 -0
  31. package/dist/cjs/index-975586fd.js +48 -0
  32. package/dist/cjs/index-9c7b27e4.js +140 -0
  33. package/dist/cjs/index-af080b50.js +139 -0
  34. package/dist/cjs/index-e56e09b8.js +38 -0
  35. package/dist/cjs/index.cjs.js +26 -0
  36. package/dist/cjs/index.es-38cbcdbe.js +10666 -0
  37. package/dist/cjs/input-shims-eff63b88.js +418 -0
  38. package/dist/cjs/ion-accordion-group.cjs.entry.js +205 -0
  39. package/dist/cjs/ion-accordion.cjs.entry.js +336 -0
  40. package/dist/cjs/ion-action-sheet_7.cjs.entry.js +2935 -0
  41. package/dist/cjs/ion-app.cjs.entry.js +79 -0
  42. package/dist/cjs/ion-back-button.cjs.entry.js +94 -0
  43. package/dist/cjs/ion-backdrop.cjs.entry.js +67 -0
  44. package/dist/cjs/ion-badge.cjs.entry.js +29 -0
  45. package/dist/cjs/ion-breadcrumb.cjs.entry.js +95 -0
  46. package/dist/cjs/ion-breadcrumbs.cjs.entry.js +133 -0
  47. package/dist/cjs/ion-buttons_3.cjs.entry.js +153 -0
  48. package/dist/cjs/ion-card-header.cjs.entry.js +37 -0
  49. package/dist/cjs/ion-card-subtitle.cjs.entry.js +30 -0
  50. package/dist/cjs/ion-card-title.cjs.entry.js +30 -0
  51. package/dist/cjs/ion-chip.cjs.entry.js +40 -0
  52. package/dist/cjs/ion-content_2.cjs.entry.js +659 -0
  53. package/dist/cjs/ion-datetime-button.cjs.entry.js +312 -0
  54. package/dist/cjs/ion-datetime.cjs.entry.js +1623 -0
  55. package/dist/cjs/ion-fab-button.cjs.entry.js +108 -0
  56. package/dist/cjs/ion-fab-list.cjs.entry.js +45 -0
  57. package/dist/cjs/ion-fab.cjs.entry.js +76 -0
  58. package/dist/cjs/ion-footer.cjs.entry.js +120 -0
  59. package/dist/cjs/ion-img.cjs.entry.js +101 -0
  60. package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +37 -0
  61. package/dist/cjs/ion-infinite-scroll.cjs.entry.js +206 -0
  62. package/dist/cjs/ion-item-divider.cjs.entry.js +40 -0
  63. package/dist/cjs/ion-item-group.cjs.entry.js +31 -0
  64. package/dist/cjs/ion-item-option.cjs.entry.js +60 -0
  65. package/dist/cjs/ion-item-options.cjs.entry.js +47 -0
  66. package/dist/cjs/ion-item-sliding.cjs.entry.js +398 -0
  67. package/dist/cjs/ion-loading.cjs.entry.js +215 -0
  68. package/dist/cjs/ion-menu-button.cjs.entry.js +76 -0
  69. package/dist/cjs/ion-menu-toggle.cjs.entry.js +47 -0
  70. package/dist/cjs/ion-menu.cjs.entry.js +575 -0
  71. package/dist/cjs/ion-modal.cjs.entry.js +1711 -0
  72. package/dist/cjs/ion-nav-link.cjs.entry.js +47 -0
  73. package/dist/cjs/ion-nav.cjs.entry.js +872 -0
  74. package/dist/cjs/ion-picker-column-internal_2.cjs.entry.js +808 -0
  75. package/dist/cjs/ion-picker-column.cjs.entry.js +331 -0
  76. package/dist/cjs/ion-picker.cjs.entry.js +221 -0
  77. package/dist/cjs/ion-progress-bar.cjs.entry.js +74 -0
  78. package/dist/cjs/ion-refresher-content.cjs.entry.js +35 -0
  79. package/dist/cjs/ion-refresher.cjs.entry.js +802 -0
  80. package/dist/cjs/ion-reorder-group.cjs.entry.js +281 -0
  81. package/dist/cjs/ion-reorder.cjs.entry.js +38 -0
  82. package/dist/cjs/ion-route-redirect.cjs.entry.js +24 -0
  83. package/dist/cjs/ion-route.cjs.entry.js +49 -0
  84. package/dist/cjs/ion-router-link.cjs.entry.js +38 -0
  85. package/dist/cjs/ion-router-outlet.cjs.entry.js +200 -0
  86. package/dist/cjs/ion-router.cjs.entry.js +831 -0
  87. package/dist/cjs/ion-searchbar.cjs.entry.js +370 -0
  88. package/dist/cjs/ion-segment-button.cjs.entry.js +102 -0
  89. package/dist/cjs/ion-segment.cjs.entry.js +417 -0
  90. package/dist/cjs/ion-skeleton-text.cjs.entry.js +33 -0
  91. package/dist/cjs/ion-slide.cjs.entry.js +25 -0
  92. package/dist/cjs/ion-slides.cjs.entry.js +391 -0
  93. package/dist/cjs/ion-split-pane.cjs.entry.js +154 -0
  94. package/dist/cjs/ion-tab-bar.cjs.entry.js +75 -0
  95. package/dist/cjs/ion-tab-button.cjs.entry.js +103 -0
  96. package/dist/cjs/ion-tab.cjs.entry.js +59 -0
  97. package/dist/cjs/ion-tabs.cjs.entry.js +154 -0
  98. package/dist/cjs/ion-thumbnail.cjs.entry.js +20 -0
  99. package/dist/cjs/ion-toast.cjs.entry.js +272 -0
  100. package/dist/cjs/ion-toggle.cjs.entry.js +177 -0
  101. package/dist/cjs/ion-virtual-scroll.cjs.entry.js +555 -0
  102. package/dist/cjs/ionic-global-2cde9d3a.js +231 -0
  103. package/dist/cjs/ios.transition-da235483.js +482 -0
  104. package/dist/cjs/keyboard-91096619.js +140 -0
  105. package/dist/cjs/loader.cjs.js +24 -0
  106. package/dist/cjs/localstorage.service-6346a41d.js +40 -0
  107. package/dist/cjs/md.transition-be429e07.js +57 -0
  108. package/dist/cjs/media.service-8a1b9bc5.js +40 -0
  109. package/dist/cjs/menu-toggle-util-7a01448c.js +14 -0
  110. package/dist/cjs/overlays-32df265a.js +507 -0
  111. package/dist/cjs/parse-d0071120.js +1237 -0
  112. package/dist/cjs/purify-fb9c107e.js +1468 -0
  113. package/dist/cjs/signalR.service-bd6b42f9.js +2985 -0
  114. package/dist/cjs/sparkle-animation-player.cjs.entry.js +515 -0
  115. package/dist/cjs/sparkle-assignment.cjs.entry.js +110 -0
  116. package/dist/cjs/sparkle-character-intro.cjs.entry.js +26 -0
  117. package/dist/cjs/sparkle-code.cjs.entry.js +43 -0
  118. package/dist/cjs/sparkle-compass-post.cjs.entry.js +133 -0
  119. package/dist/cjs/sparkle-compass.cjs.entry.js +126 -0
  120. package/dist/cjs/sparkle-core.cjs.js +22 -0
  121. package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +281 -0
  122. package/dist/cjs/sparkle-discussion.cjs.entry.js +42 -0
  123. package/dist/cjs/sparkle-emoji.cjs.entry.js +80 -0
  124. package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +121 -0
  125. package/dist/cjs/sparkle-feed-post.cjs.entry.js +122 -0
  126. package/dist/cjs/sparkle-feedback.cjs.entry.js +101 -0
  127. package/dist/cjs/sparkle-file-upload.cjs.entry.js +53 -0
  128. package/dist/cjs/sparkle-goal-form.cjs.entry.js +179 -0
  129. package/dist/cjs/sparkle-gww-comment-list.cjs.entry.js +26 -0
  130. package/dist/cjs/sparkle-gww-graph.cjs.entry.js +19 -0
  131. package/dist/cjs/sparkle-input.cjs.entry.js +56 -0
  132. package/dist/cjs/sparkle-intro.cjs.entry.js +26 -0
  133. package/dist/cjs/sparkle-lower-content-nav.cjs.entry.js +22 -0
  134. package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +46 -0
  135. package/dist/cjs/sparkle-modal-image.cjs.entry.js +34 -0
  136. package/dist/cjs/sparkle-notfound-page.cjs.entry.js +25 -0
  137. package/dist/cjs/sparkle-overlay.cjs.entry.js +92 -0
  138. package/dist/cjs/sparkle-poll.cjs.entry.js +19 -0
  139. package/dist/cjs/sparkle-quiz-container.cjs.entry.js +47 -0
  140. package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +117 -0
  141. package/dist/cjs/sparkle-quiz-old.cjs.entry.js +120 -0
  142. package/dist/cjs/sparkle-quiz.cjs.entry.js +103 -0
  143. package/dist/cjs/sparkle-select.cjs.entry.js +61 -0
  144. package/dist/cjs/sparkle-sidebar.cjs.entry.js +43 -0
  145. package/dist/cjs/sparkle-tab.cjs.entry.js +26 -0
  146. package/dist/cjs/sparkle-table-of-contents.cjs.entry.js +71 -0
  147. package/dist/cjs/sparkle-tabs.cjs.entry.js +66 -0
  148. package/dist/cjs/sparkle-video-player.cjs.entry.js +22 -0
  149. package/dist/cjs/sparkle-youtube.cjs.entry.js +39 -0
  150. package/dist/cjs/spinner-configs-0ac05f2d.js +147 -0
  151. package/dist/cjs/status-tap-033befa2.js +42 -0
  152. package/dist/cjs/stencil-async-content.cjs.entry.js +32 -0
  153. package/dist/cjs/stencil-route-title.cjs.entry.js +32 -0
  154. package/dist/cjs/stencil-router-prompt.cjs.entry.js +59 -0
  155. package/dist/cjs/student.service-7e5385be.js +78 -0
  156. package/dist/cjs/swipe-back-4a826f9b.js +76 -0
  157. package/dist/cjs/swiper.bundle-8c897c07.js +6420 -0
  158. package/dist/cjs/theme-b0b295c1.js +48 -0
  159. package/dist/cjs/token.service-7a41953d.js +97 -0
  160. package/dist/cjs/util-47e320b2.js +2462 -0
  161. package/dist/collection/PrivateRoute.js +27 -0
  162. package/dist/collection/appconst.js +13 -0
  163. package/dist/collection/assets/img/forward.svg +5 -0
  164. package/dist/collection/assets/img/help/fitt-logo.svg +1 -0
  165. package/dist/collection/assets/img/home/big-white-wall.svg +15 -0
  166. package/dist/collection/assets/img/home/find-help.svg +23 -0
  167. package/dist/collection/assets/img/home/lessons.svg +26 -0
  168. package/dist/collection/assets/img/home/my-goals.svg +19 -0
  169. package/dist/collection/assets/img/home/my-health.svg +17 -0
  170. package/dist/collection/assets/img/home/my-mood.svg +26 -0
  171. package/dist/collection/assets/img/pause.svg +5 -0
  172. package/dist/collection/assets/img/play-symbol.svg +8 -0
  173. package/dist/collection/assets/img/play.svg +4 -0
  174. package/dist/collection/assets/img/rewind.svg +5 -0
  175. package/dist/collection/assets/lib/SignalRAspNetCoreHelper.js +17 -0
  176. package/dist/collection/assets/lib/sparkleUtility.js +8 -0
  177. package/dist/collection/assets/svg/profile.svg +2 -0
  178. package/dist/collection/collection-manifest.json +219 -0
  179. package/dist/collection/components/compass-svg/compass-svg.css +15 -0
  180. package/dist/collection/components/compass-svg/compass-svg.js +156 -0
  181. package/dist/collection/components/layout/facilitator/export-lessons/export-lessons.css +7 -0
  182. package/dist/collection/components/layout/facilitator/export-lessons/export-lessons.js +110 -0
  183. package/dist/collection/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.css +3 -0
  184. package/dist/collection/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.js +214 -0
  185. package/dist/collection/components/layout/facilitator/facilitator-header/facilitator-header-mobile-collapse/facilitator-header-mobile-collapse.js +0 -0
  186. package/dist/collection/components/layout/facilitator/facilitator-header/facilitator-header.css +172 -0
  187. package/dist/collection/components/layout/facilitator/facilitator-header/facilitator-header.js +104 -0
  188. package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.css +3 -0
  189. package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.js +144 -0
  190. package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes.css +14 -0
  191. package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes.js +64 -0
  192. package/dist/collection/components/layout/facilitator/facilitator-page.css +196 -0
  193. package/dist/collection/components/layout/facilitator/facilitator-page.js +281 -0
  194. package/dist/collection/components/layout/facilitator/online-students/online-students.css +0 -0
  195. package/dist/collection/components/layout/facilitator/online-students/online-students.js +70 -0
  196. package/dist/collection/components/layout/page/page.css +183 -0
  197. package/dist/collection/components/layout/page/page.js +321 -0
  198. package/dist/collection/components/layout/page/templates/default.js +9 -0
  199. package/dist/collection/components/layout/page/templates/error.js +33 -0
  200. package/dist/collection/components/layout/page/templates/index.js +8 -0
  201. package/dist/collection/components/layout/page/templates/pdf.js +8 -0
  202. package/dist/collection/components/layout/page/to-hypertext.js +27 -0
  203. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.css +3 -0
  204. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.js +252 -0
  205. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.css +12 -0
  206. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.js +59 -0
  207. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.css +33 -0
  208. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.js +37 -0
  209. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goals.css +8 -0
  210. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goals.js +40 -0
  211. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-comment-list/sparkle-gww-comment-list.css +7 -0
  212. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-comment-list/sparkle-gww-comment-list.js +52 -0
  213. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-graph/sparkle-gww-graph.css +3 -0
  214. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-graph/sparkle-gww-graph.js +14 -0
  215. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.css +30 -0
  216. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.js +187 -0
  217. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww.css +3 -0
  218. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww.js +43 -0
  219. package/dist/collection/components/mini-apps/sparkle-health/sparkle-health.css +10 -0
  220. package/dist/collection/components/mini-apps/sparkle-health/sparkle-health.js +111 -0
  221. package/dist/collection/components/mini-apps/sparkle-mood/sparkle-mood.css +11 -0
  222. package/dist/collection/components/mini-apps/sparkle-mood/sparkle-mood.js +127 -0
  223. package/dist/collection/components/modal-image/modal-image.css +61 -0
  224. package/dist/collection/components/modal-image/modal-image.js +159 -0
  225. package/dist/collection/components/sparkle-animation-player/assets/play-button-disabled-overlay.png +0 -0
  226. package/dist/collection/components/sparkle-animation-player/assets/play-button-overlay.png +0 -0
  227. package/dist/collection/components/sparkle-animation-player/caption-parser.js +94 -0
  228. package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.css +157 -0
  229. package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.js +598 -0
  230. package/dist/collection/components/sparkle-assignment/sparkle-assignment.css +30 -0
  231. package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +159 -0
  232. package/dist/collection/components/sparkle-character-intro/assets/characters/character-img.jpg +0 -0
  233. package/dist/collection/components/sparkle-character-intro/assets/characters/jen.png +0 -0
  234. package/dist/collection/components/sparkle-character-intro/assets/characters/kimberly.png +0 -0
  235. package/dist/collection/components/sparkle-character-intro/assets/characters/valeria.png +0 -0
  236. package/dist/collection/components/sparkle-character-intro/assets/characters/yuna.png +0 -0
  237. package/dist/collection/components/sparkle-character-intro/assets/characters/zynab.png +0 -0
  238. package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +74 -0
  239. package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +68 -0
  240. package/dist/collection/components/sparkle-compass/sparkle-compass-post/sparkle-compass-post.css +35 -0
  241. package/dist/collection/components/sparkle-compass/sparkle-compass-post/sparkle-compass-post.js +171 -0
  242. package/dist/collection/components/sparkle-compass/sparkle-compass.css +25 -0
  243. package/dist/collection/components/sparkle-compass/sparkle-compass.js +283 -0
  244. package/dist/collection/components/sparkle-course-root/sparkle-course-root.css +3 -0
  245. package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +196 -0
  246. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.css +157 -0
  247. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js +232 -0
  248. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.css +158 -0
  249. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js +274 -0
  250. package/dist/collection/components/sparkle-discussion/sparkle-discussion.css +5 -0
  251. package/dist/collection/components/sparkle-discussion/sparkle-discussion.js +112 -0
  252. package/dist/collection/components/sparkle-emoji/sparkle-emoji.css +16 -0
  253. package/dist/collection/components/sparkle-emoji/sparkle-emoji.js +116 -0
  254. package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.css +35 -0
  255. package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +199 -0
  256. package/dist/collection/components/sparkle-feedback/sparkle-feedback.css +3 -0
  257. package/dist/collection/components/sparkle-feedback/sparkle-feedback.js +118 -0
  258. package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.css +0 -0
  259. package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.js +105 -0
  260. package/dist/collection/components/sparkle-forgot-password/sparkle-forgot-password.css +4 -0
  261. package/dist/collection/components/sparkle-forgot-password/sparkle-forgot-password.js +107 -0
  262. package/dist/collection/components/sparkle-input/sparkle-input.css +0 -0
  263. package/dist/collection/components/sparkle-input/sparkle-input.js +212 -0
  264. package/dist/collection/components/sparkle-intro/sparkle-intro.css +15 -0
  265. package/dist/collection/components/sparkle-intro/sparkle-intro.js +35 -0
  266. package/dist/collection/components/sparkle-login/sparkle-login.css +4 -0
  267. package/dist/collection/components/sparkle-login/sparkle-login.js +173 -0
  268. package/dist/collection/components/sparkle-poll/sparkle-poll.css +3 -0
  269. package/dist/collection/components/sparkle-poll/sparkle-poll.js +15 -0
  270. package/dist/collection/components/sparkle-quiz/sparkle-quiz-feedback/sparkle-quiz-feedback.css +3 -0
  271. package/dist/collection/components/sparkle-quiz/sparkle-quiz-feedback/sparkle-quiz-feedback.js +69 -0
  272. package/dist/collection/components/sparkle-quiz/sparkle-quiz-input/sparkle-quiz-input.css +3 -0
  273. package/dist/collection/components/sparkle-quiz/sparkle-quiz-input/sparkle-quiz-input.js +59 -0
  274. package/dist/collection/components/sparkle-quiz/sparkle-quiz-old/sparkle-quiz-old.css +48 -0
  275. package/dist/collection/components/sparkle-quiz/sparkle-quiz-old/sparkle-quiz-old.js +327 -0
  276. package/dist/collection/components/sparkle-quiz/sparkle-quiz-opinion/sparkle-quiz-opinion.css +18 -0
  277. package/dist/collection/components/sparkle-quiz/sparkle-quiz-opinion/sparkle-quiz-opinion.js +106 -0
  278. package/dist/collection/components/sparkle-quiz/sparkle-quiz-poll/sparkle-quiz-poll.css +3 -0
  279. package/dist/collection/components/sparkle-quiz/sparkle-quiz-poll/sparkle-quiz-poll.js +59 -0
  280. package/dist/collection/components/sparkle-quiz/sparkle-quiz-select/sparkle-quiz-select.css +3 -0
  281. package/dist/collection/components/sparkle-quiz/sparkle-quiz-select/sparkle-quiz-select.js +100 -0
  282. package/dist/collection/components/sparkle-quiz/sparkle-quiz.css +48 -0
  283. package/dist/collection/components/sparkle-quiz/sparkle-quiz.js +221 -0
  284. package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.css +3 -0
  285. package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.js +98 -0
  286. package/dist/collection/components/sparkle-reset-password/sparkle-reset-password.css +3 -0
  287. package/dist/collection/components/sparkle-reset-password/sparkle-reset-password.js +126 -0
  288. package/dist/collection/components/sparkle-root/sparkle-root.css +61 -0
  289. package/dist/collection/components/sparkle-root/sparkle-root.js +86 -0
  290. package/dist/collection/components/sparkle-signup/sparkle-signup.css +6 -0
  291. package/dist/collection/components/sparkle-signup/sparkle-signup.js +197 -0
  292. package/dist/collection/components/sparkle-unauthorized/sparkle-unauthorized.css +13 -0
  293. package/dist/collection/components/sparkle-unauthorized/sparkle-unauthorized.js +18 -0
  294. package/dist/collection/components/sparkle-user-enrollment/sparkle-user-enrollment.css +3 -0
  295. package/dist/collection/components/sparkle-user-enrollment/sparkle-user-enrollment.js +93 -0
  296. package/dist/collection/components/sparkle-user-profile/sparkle-user-profile.css +54 -0
  297. package/dist/collection/components/sparkle-user-profile/sparkle-user-profile.js +151 -0
  298. package/dist/collection/components/sparkle-validation-error/sparkle-validation-error.css +11 -0
  299. package/dist/collection/components/sparkle-validation-error/sparkle-validation-error.js +44 -0
  300. package/dist/collection/components/sparkle-video-player/sparkle-video-player.css +0 -0
  301. package/dist/collection/components/sparkle-video-player/sparkle-video-player.js +92 -0
  302. package/dist/collection/components/sparkle-youtube/sparkle-youtube.css +24 -0
  303. package/dist/collection/components/sparkle-youtube/sparkle-youtube.js +99 -0
  304. package/dist/collection/global/app.js +4 -0
  305. package/dist/collection/helpers/utils.js +3 -0
  306. package/dist/collection/icons.js +36 -0
  307. package/dist/collection/index.js +3 -0
  308. package/dist/collection/l10n.js +18 -0
  309. package/dist/collection/models/api.model.js +7 -0
  310. package/dist/collection/models/assets.model.js +1 -0
  311. package/dist/collection/models/auth/auth.user.js +1 -0
  312. package/dist/collection/models/class.model.js +5 -0
  313. package/dist/collection/models/course.model.js +10 -0
  314. package/dist/collection/models/definitions.js +1 -0
  315. package/dist/collection/models/facilitator-dashboard.model.js +5 -0
  316. package/dist/collection/models/goal.model.js +1 -0
  317. package/dist/collection/models/index.js +1 -0
  318. package/dist/collection/models/markdown.model.js +1 -0
  319. package/dist/collection/models/page.model.js +1 -0
  320. package/dist/collection/models/quiz.model.js +3 -0
  321. package/dist/collection/models/user.model.js +1 -0
  322. package/dist/collection/pages/course/welcome-to-mind-body/introduction/animation/m4l1p1_part1.js +2727 -0
  323. package/dist/collection/pages/course/welcome-to-mind-body/introduction/animation/m4l1p1_part2.js +2042 -0
  324. package/dist/collection/services/account.service.js +61 -0
  325. package/dist/collection/services/appdata.service.js +60 -0
  326. package/dist/collection/services/assignment.service.js +14 -0
  327. package/dist/collection/services/auth/auth.service.js +64 -0
  328. package/dist/collection/services/core/assets.service.js +45 -0
  329. package/dist/collection/services/core/localstorage.service.js +34 -0
  330. package/dist/collection/services/environment/environment-config.js +24 -0
  331. package/dist/collection/services/environment/environment-config.service.js +24 -0
  332. package/dist/collection/services/facilitator.service.js +76 -0
  333. package/dist/collection/services/feed.service.js +43 -0
  334. package/dist/collection/services/httpService.js +103 -0
  335. package/dist/collection/services/index.js +4 -0
  336. package/dist/collection/services/media.service.js +29 -0
  337. package/dist/collection/services/signalR.service.js +83 -0
  338. package/dist/collection/services/store.service.js +13 -0
  339. package/dist/collection/services/student.service.js +56 -0
  340. package/dist/collection/services/token.service.js +79 -0
  341. package/dist/collection/stores/auth.store.js +12 -0
  342. package/dist/collection/stores/class.store.js +5 -0
  343. package/dist/collection/stores/error.store.js +5 -0
  344. package/dist/collection/stores/facilitator.store.js +15 -0
  345. package/dist/collection/stores/feed.store.js +8 -0
  346. package/dist/collection/stores/goal.store.js +7 -0
  347. package/dist/collection/stores/index.js +1 -0
  348. package/dist/collection/stores/media.store.js +5 -0
  349. package/dist/collection/stores/mood.store.js +5 -0
  350. package/dist/collection/stores/nav.store.js +11 -0
  351. package/dist/collection/stores/signalR.store.js +6 -0
  352. package/dist/collection/stores/theme.store.js +9 -0
  353. package/dist/collection/stores/toc.store.js +5 -0
  354. package/dist/collection/stores/user.store.js +16 -0
  355. package/dist/collection/util.js +55 -0
  356. package/dist/collection/utils.js +92 -0
  357. package/dist/esm/PrivateRoute-90ac95b8.js +212 -0
  358. package/dist/esm/active-router-fc9e4e06.js +73 -0
  359. package/dist/esm/animation-12377cb3.js +984 -0
  360. package/dist/esm/app-globals-3f0347b0.js +7 -0
  361. package/dist/esm/appdata.service-2e84e167.js +70 -0
  362. package/dist/esm/assets.service-def1d63c.js +48 -0
  363. package/dist/esm/assignment.service-8d31f141.js +17 -0
  364. package/dist/esm/auth.store-dba2c2da.js +3381 -0
  365. package/dist/esm/compass-svg.entry.js +128 -0
  366. package/dist/esm/context-consumer.entry.js +25 -0
  367. package/dist/esm/course-select.entry.js +26 -0
  368. package/dist/esm/dir-03012648.js +18 -0
  369. package/dist/esm/environment-config.service-b191f276.js +26 -0
  370. package/dist/esm/facilitator.service-18c47bdf.js +92 -0
  371. package/dist/esm/feed.service-b4f3cae4.js +54 -0
  372. package/dist/esm/framework-delegate-3e634a5c.js +107 -0
  373. package/dist/esm/gesture-controller-7be18351.js +194 -0
  374. package/dist/esm/haptic-522f76f2.js +110 -0
  375. package/dist/esm/header-mobile-collapse_61.entry.js +15060 -0
  376. package/dist/esm/helpers-bf0e23d6.js +403 -0
  377. package/dist/esm/httpService-7986aeed.js +685 -0
  378. package/dist/esm/icons-1c794c74.js +18 -0
  379. package/dist/esm/index-21661af2.js +463 -0
  380. package/dist/esm/index-2b84cad2.js +223 -0
  381. package/dist/esm/index-4044fde9.js +25 -0
  382. package/dist/esm/index-45fec1e7.js +184 -0
  383. package/dist/esm/index-5e8971ae.js +128 -0
  384. package/dist/esm/index-c04b9ed5.js +1888 -0
  385. package/dist/esm/index-cded2d87.js +312 -0
  386. package/dist/esm/index-dad75b83.js +34 -0
  387. package/dist/esm/index.es-e0c0f891.js +10580 -0
  388. package/dist/esm/index.js +12 -0
  389. package/dist/esm/input-shims-671d8d9f.js +416 -0
  390. package/dist/esm/ion-accordion-group.entry.js +201 -0
  391. package/dist/esm/ion-accordion.entry.js +332 -0
  392. package/dist/esm/ion-action-sheet_7.entry.js +2925 -0
  393. package/dist/esm/ion-app.entry.js +75 -0
  394. package/dist/esm/ion-back-button.entry.js +90 -0
  395. package/dist/esm/ion-backdrop.entry.js +63 -0
  396. package/dist/esm/ion-badge.entry.js +25 -0
  397. package/dist/esm/ion-breadcrumb.entry.js +91 -0
  398. package/dist/esm/ion-breadcrumbs.entry.js +129 -0
  399. package/dist/esm/ion-buttons_3.entry.js +147 -0
  400. package/dist/esm/ion-card-header.entry.js +33 -0
  401. package/dist/esm/ion-card-subtitle.entry.js +26 -0
  402. package/dist/esm/ion-card-title.entry.js +26 -0
  403. package/dist/esm/ion-chip.entry.js +36 -0
  404. package/dist/esm/ion-content_2.entry.js +654 -0
  405. package/dist/esm/ion-datetime-button.entry.js +308 -0
  406. package/dist/esm/ion-datetime.entry.js +1619 -0
  407. package/dist/esm/ion-fab-button.entry.js +104 -0
  408. package/dist/esm/ion-fab-list.entry.js +41 -0
  409. package/dist/esm/ion-fab.entry.js +72 -0
  410. package/dist/esm/ion-footer.entry.js +116 -0
  411. package/dist/esm/ion-img.entry.js +97 -0
  412. package/dist/esm/ion-infinite-scroll-content.entry.js +33 -0
  413. package/dist/esm/ion-infinite-scroll.entry.js +202 -0
  414. package/dist/esm/ion-item-divider.entry.js +36 -0
  415. package/dist/esm/ion-item-group.entry.js +27 -0
  416. package/dist/esm/ion-item-option.entry.js +56 -0
  417. package/dist/esm/ion-item-options.entry.js +43 -0
  418. package/dist/esm/ion-item-sliding.entry.js +394 -0
  419. package/dist/esm/ion-loading.entry.js +211 -0
  420. package/dist/esm/ion-menu-button.entry.js +72 -0
  421. package/dist/esm/ion-menu-toggle.entry.js +43 -0
  422. package/dist/esm/ion-menu.entry.js +571 -0
  423. package/dist/esm/ion-modal.entry.js +1707 -0
  424. package/dist/esm/ion-nav-link.entry.js +43 -0
  425. package/dist/esm/ion-nav.entry.js +868 -0
  426. package/dist/esm/ion-picker-column-internal_2.entry.js +803 -0
  427. package/dist/esm/ion-picker-column.entry.js +327 -0
  428. package/dist/esm/ion-picker.entry.js +217 -0
  429. package/dist/esm/ion-progress-bar.entry.js +70 -0
  430. package/dist/esm/ion-refresher-content.entry.js +31 -0
  431. package/dist/esm/ion-refresher.entry.js +798 -0
  432. package/dist/esm/ion-reorder-group.entry.js +277 -0
  433. package/dist/esm/ion-reorder.entry.js +34 -0
  434. package/dist/esm/ion-route-redirect.entry.js +20 -0
  435. package/dist/esm/ion-route.entry.js +45 -0
  436. package/dist/esm/ion-router-link.entry.js +34 -0
  437. package/dist/esm/ion-router-outlet.entry.js +196 -0
  438. package/dist/esm/ion-router.entry.js +827 -0
  439. package/dist/esm/ion-searchbar.entry.js +366 -0
  440. package/dist/esm/ion-segment-button.entry.js +98 -0
  441. package/dist/esm/ion-segment.entry.js +413 -0
  442. package/dist/esm/ion-skeleton-text.entry.js +29 -0
  443. package/dist/esm/ion-slide.entry.js +21 -0
  444. package/dist/esm/ion-slides.entry.js +387 -0
  445. package/dist/esm/ion-split-pane.entry.js +150 -0
  446. package/dist/esm/ion-tab-bar.entry.js +71 -0
  447. package/dist/esm/ion-tab-button.entry.js +99 -0
  448. package/dist/esm/ion-tab.entry.js +55 -0
  449. package/dist/esm/ion-tabs.entry.js +150 -0
  450. package/dist/esm/ion-thumbnail.entry.js +16 -0
  451. package/dist/esm/ion-toast.entry.js +268 -0
  452. package/dist/esm/ion-toggle.entry.js +173 -0
  453. package/dist/esm/ion-virtual-scroll.entry.js +551 -0
  454. package/dist/esm/ionic-global-4903e23e.js +226 -0
  455. package/dist/esm/ios.transition-131d64fe.js +479 -0
  456. package/dist/esm/loader.js +20 -0
  457. package/dist/esm/md.transition-f6126011.js +55 -0
  458. package/dist/esm/media.service-6e90bc41.js +37 -0
  459. package/dist/esm/menu-toggle-util-bace8ae6.js +12 -0
  460. package/dist/esm/overlays-4233a39d.js +491 -0
  461. package/dist/esm/parse-1ae3a9bb.js +1196 -0
  462. package/dist/esm/polyfills/core-js.js +11 -0
  463. package/dist/esm/polyfills/css-shim.js +1 -0
  464. package/dist/esm/polyfills/dom.js +79 -0
  465. package/dist/esm/polyfills/es5-html-element.js +1 -0
  466. package/dist/esm/polyfills/index.js +34 -0
  467. package/dist/esm/polyfills/system.js +6 -0
  468. package/dist/esm/purify-85bfcc69.js +1466 -0
  469. package/dist/esm/signalR.service-c33fba50.js +2982 -0
  470. package/dist/esm/sparkle-animation-player.entry.js +511 -0
  471. package/dist/esm/sparkle-assignment.entry.js +106 -0
  472. package/dist/esm/sparkle-character-intro.entry.js +22 -0
  473. package/dist/esm/sparkle-code.entry.js +39 -0
  474. package/dist/esm/sparkle-compass-post.entry.js +129 -0
  475. package/dist/esm/sparkle-compass.entry.js +122 -0
  476. package/dist/esm/sparkle-core.js +20 -0
  477. package/dist/esm/sparkle-discussion-questions_2.entry.js +276 -0
  478. package/dist/esm/sparkle-discussion.entry.js +38 -0
  479. package/dist/esm/sparkle-emoji.entry.js +76 -0
  480. package/dist/esm/sparkle-facilitator-notes-form.entry.js +117 -0
  481. package/dist/esm/sparkle-feed-post.entry.js +118 -0
  482. package/dist/esm/sparkle-feedback.entry.js +97 -0
  483. package/dist/esm/sparkle-file-upload.entry.js +49 -0
  484. package/dist/esm/sparkle-goal-form.entry.js +175 -0
  485. package/dist/esm/sparkle-gww-comment-list.entry.js +22 -0
  486. package/dist/esm/sparkle-gww-graph.entry.js +15 -0
  487. package/dist/esm/sparkle-input.entry.js +52 -0
  488. package/dist/esm/sparkle-intro.entry.js +22 -0
  489. package/dist/esm/sparkle-lower-content-nav.entry.js +18 -0
  490. package/dist/esm/sparkle-menu-collapsible.entry.js +42 -0
  491. package/dist/esm/sparkle-modal-image.entry.js +30 -0
  492. package/dist/esm/sparkle-notfound-page.entry.js +21 -0
  493. package/dist/esm/sparkle-overlay.entry.js +88 -0
  494. package/dist/esm/sparkle-poll.entry.js +15 -0
  495. package/dist/esm/sparkle-quiz-container.entry.js +43 -0
  496. package/dist/esm/sparkle-quiz-feedback_5.entry.js +109 -0
  497. package/dist/esm/sparkle-quiz-old.entry.js +116 -0
  498. package/dist/esm/sparkle-quiz.entry.js +99 -0
  499. package/dist/esm/sparkle-select.entry.js +57 -0
  500. package/dist/esm/sparkle-sidebar.entry.js +39 -0
  501. package/dist/esm/sparkle-tab.entry.js +22 -0
  502. package/dist/esm/sparkle-table-of-contents.entry.js +67 -0
  503. package/dist/esm/sparkle-tabs.entry.js +62 -0
  504. package/dist/esm/sparkle-video-player.entry.js +18 -0
  505. package/dist/esm/sparkle-youtube.entry.js +35 -0
  506. package/dist/esm/status-tap-dde52787.js +40 -0
  507. package/dist/esm/stencil-async-content.entry.js +28 -0
  508. package/dist/esm/stencil-route-title.entry.js +28 -0
  509. package/dist/esm/stencil-router-prompt.entry.js +55 -0
  510. package/dist/esm/student.service-08af124f.js +75 -0
  511. package/dist/esm/swipe-back-7847a0c1.js +74 -0
  512. package/dist/esm/swiper.bundle-b6a959de.js +6418 -0
  513. package/dist/esm/token.service-71a5d33f.js +94 -0
  514. package/dist/esm/util-57cc8006.js +2451 -0
  515. package/dist/index.cjs.js +1 -0
  516. package/dist/index.js +1 -0
  517. package/dist/loader/cdn.js +3 -0
  518. package/dist/loader/index.cjs.js +3 -0
  519. package/dist/loader/index.d.ts +12 -0
  520. package/dist/loader/index.es2017.js +3 -0
  521. package/dist/loader/index.js +4 -0
  522. package/dist/loader/package.json +10 -0
  523. package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.ios.css +75 -0
  524. package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.md.css +72 -0
  525. package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.ios.css +25 -0
  526. package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.md.css +59 -0
  527. package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.ios.css +357 -0
  528. package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.md.css +290 -0
  529. package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.ios.css +494 -0
  530. package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.md.css +502 -0
  531. package/dist/node_modules/@ionic/core/dist/collection/components/app/app.css +17 -0
  532. package/dist/node_modules/@ionic/core/dist/collection/components/avatar/avatar.ios.css +22 -0
  533. package/dist/node_modules/@ionic/core/dist/collection/components/avatar/avatar.md.css +22 -0
  534. package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.ios.css +281 -0
  535. package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.md.css +309 -0
  536. package/dist/node_modules/@ionic/core/dist/collection/components/backdrop/backdrop.ios.css +26 -0
  537. package/dist/node_modules/@ionic/core/dist/collection/components/backdrop/backdrop.md.css +26 -0
  538. package/dist/node_modules/@ionic/core/dist/collection/components/badge/badge.ios.css +58 -0
  539. package/dist/node_modules/@ionic/core/dist/collection/components/badge/badge.md.css +62 -0
  540. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.ios.css +234 -0
  541. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.md.css +237 -0
  542. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.ios.css +38 -0
  543. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.md.css +37 -0
  544. package/dist/node_modules/@ionic/core/dist/collection/components/button/button.ios.css +439 -0
  545. package/dist/node_modules/@ionic/core/dist/collection/components/button/button.md.css +428 -0
  546. package/dist/node_modules/@ionic/core/dist/collection/components/buttons/buttons.ios.css +128 -0
  547. package/dist/node_modules/@ionic/core/dist/collection/components/buttons/buttons.md.css +151 -0
  548. package/dist/node_modules/@ionic/core/dist/collection/components/card/card.ios.css +101 -0
  549. package/dist/node_modules/@ionic/core/dist/collection/components/card/card.md.css +95 -0
  550. package/dist/node_modules/@ionic/core/dist/collection/components/card-content/card-content.ios.css +61 -0
  551. package/dist/node_modules/@ionic/core/dist/collection/components/card-content/card-content.md.css +63 -0
  552. package/dist/node_modules/@ionic/core/dist/collection/components/card-header/card-header.ios.css +37 -0
  553. package/dist/node_modules/@ionic/core/dist/collection/components/card-header/card-header.md.css +35 -0
  554. package/dist/node_modules/@ionic/core/dist/collection/components/card-subtitle/card-subtitle.ios.css +28 -0
  555. package/dist/node_modules/@ionic/core/dist/collection/components/card-subtitle/card-subtitle.md.css +26 -0
  556. package/dist/node_modules/@ionic/core/dist/collection/components/card-title/card-title.ios.css +27 -0
  557. package/dist/node_modules/@ionic/core/dist/collection/components/card-title/card-title.md.css +27 -0
  558. package/dist/node_modules/@ionic/core/dist/collection/components/checkbox/checkbox.ios.css +169 -0
  559. package/dist/node_modules/@ionic/core/dist/collection/components/checkbox/checkbox.md.css +172 -0
  560. package/dist/node_modules/@ionic/core/dist/collection/components/chip/chip.ios.css +200 -0
  561. package/dist/node_modules/@ionic/core/dist/collection/components/chip/chip.md.css +200 -0
  562. package/dist/node_modules/@ionic/core/dist/collection/components/col/col.css +108 -0
  563. package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +237 -0
  564. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +648 -0
  565. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +637 -0
  566. package/dist/node_modules/@ionic/core/dist/collection/components/datetime-button/datetime-button.css +60 -0
  567. package/dist/node_modules/@ionic/core/dist/collection/components/fab/fab.css +61 -0
  568. package/dist/node_modules/@ionic/core/dist/collection/components/fab-button/fab-button.ios.css +338 -0
  569. package/dist/node_modules/@ionic/core/dist/collection/components/fab-button/fab-button.md.css +307 -0
  570. package/dist/node_modules/@ionic/core/dist/collection/components/fab-list/fab-list.css +116 -0
  571. package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.ios.css +37 -0
  572. package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.md.css +37 -0
  573. package/dist/node_modules/@ionic/core/dist/collection/components/grid/grid.css +151 -0
  574. package/dist/node_modules/@ionic/core/dist/collection/components/header/header.ios.css +108 -0
  575. package/dist/node_modules/@ionic/core/dist/collection/components/header/header.md.css +40 -0
  576. package/dist/node_modules/@ionic/core/dist/collection/components/img/img.css +12 -0
  577. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll/infinite-scroll.css +8 -0
  578. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll-content/infinite-scroll-content.ios.css +54 -0
  579. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll-content/infinite-scroll-content.md.css +54 -0
  580. package/dist/node_modules/@ionic/core/dist/collection/components/input/input.ios.css +185 -0
  581. package/dist/node_modules/@ionic/core/dist/collection/components/input/input.md.css +185 -0
  582. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +669 -0
  583. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +928 -0
  584. package/dist/node_modules/@ionic/core/dist/collection/components/item-divider/item-divider.ios.css +204 -0
  585. package/dist/node_modules/@ionic/core/dist/collection/components/item-divider/item-divider.md.css +297 -0
  586. package/dist/node_modules/@ionic/core/dist/collection/components/item-group/item-group.ios.css +3 -0
  587. package/dist/node_modules/@ionic/core/dist/collection/components/item-group/item-group.md.css +3 -0
  588. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.ios.css +186 -0
  589. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.md.css +180 -0
  590. package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.ios.css +88 -0
  591. package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.md.css +85 -0
  592. package/dist/node_modules/@ionic/core/dist/collection/components/item-sliding/item-sliding.css +42 -0
  593. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +156 -0
  594. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.md.css +250 -0
  595. package/dist/node_modules/@ionic/core/dist/collection/components/list/list.ios.css +91 -0
  596. package/dist/node_modules/@ionic/core/dist/collection/components/list/list.md.css +114 -0
  597. package/dist/node_modules/@ionic/core/dist/collection/components/list-header/list-header.ios.css +118 -0
  598. package/dist/node_modules/@ionic/core/dist/collection/components/list-header/list-header.md.css +94 -0
  599. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.ios.css +109 -0
  600. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.md.css +100 -0
  601. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +127 -0
  602. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +123 -0
  603. package/dist/node_modules/@ionic/core/dist/collection/components/menu-button/menu-button.ios.css +175 -0
  604. package/dist/node_modules/@ionic/core/dist/collection/components/menu-button/menu-button.md.css +178 -0
  605. package/dist/node_modules/@ionic/core/dist/collection/components/menu-toggle/menu-toggle.css +3 -0
  606. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +250 -0
  607. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +177 -0
  608. package/dist/node_modules/@ionic/core/dist/collection/components/nav/nav.css +10 -0
  609. package/dist/node_modules/@ionic/core/dist/collection/components/note/note.ios.css +16 -0
  610. package/dist/node_modules/@ionic/core/dist/collection/components/note/note.md.css +17 -0
  611. package/dist/node_modules/@ionic/core/dist/collection/components/picker/picker.ios.css +217 -0
  612. package/dist/node_modules/@ionic/core/dist/collection/components/picker/picker.md.css +204 -0
  613. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column/picker-column.ios.css +122 -0
  614. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column/picker-column.md.css +123 -0
  615. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +82 -0
  616. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.md.css +85 -0
  617. package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.ios.css +126 -0
  618. package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.md.css +122 -0
  619. package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.ios.css +201 -0
  620. package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.md.css +132 -0
  621. package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.ios.css +206 -0
  622. package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.md.css +206 -0
  623. package/dist/node_modules/@ionic/core/dist/collection/components/radio/radio.ios.css +177 -0
  624. package/dist/node_modules/@ionic/core/dist/collection/components/radio/radio.md.css +178 -0
  625. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +275 -0
  626. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +320 -0
  627. package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.ios.css +189 -0
  628. package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.md.css +210 -0
  629. package/dist/node_modules/@ionic/core/dist/collection/components/reorder/reorder.ios.css +15 -0
  630. package/dist/node_modules/@ionic/core/dist/collection/components/reorder/reorder.md.css +15 -0
  631. package/dist/node_modules/@ionic/core/dist/collection/components/reorder-group/reorder-group.css +33 -0
  632. package/dist/node_modules/@ionic/core/dist/collection/components/ripple-effect/ripple-effect.css +58 -0
  633. package/dist/node_modules/@ionic/core/dist/collection/components/router-link/router-link.css +29 -0
  634. package/dist/node_modules/@ionic/core/dist/collection/components/router-outlet/route-outlet.css +10 -0
  635. package/dist/node_modules/@ionic/core/dist/collection/components/row/row.css +4 -0
  636. package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.ios.css +348 -0
  637. package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.md.css +279 -0
  638. package/dist/node_modules/@ionic/core/dist/collection/components/segment/segment.ios.css +65 -0
  639. package/dist/node_modules/@ionic/core/dist/collection/components/segment/segment.md.css +36 -0
  640. package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.ios.css +446 -0
  641. package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.md.css +424 -0
  642. package/dist/node_modules/@ionic/core/dist/collection/components/select/select.ios.css +145 -0
  643. package/dist/node_modules/@ionic/core/dist/collection/components/select/select.md.css +177 -0
  644. package/dist/node_modules/@ionic/core/dist/collection/components/select-option/select-option.css +3 -0
  645. package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.ios.css +14 -0
  646. package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.md.css +37 -0
  647. package/dist/node_modules/@ionic/core/dist/collection/components/skeleton-text/skeleton-text.css +53 -0
  648. package/dist/node_modules/@ionic/core/dist/collection/components/slide/slide.css +31 -0
  649. package/dist/node_modules/@ionic/core/dist/collection/components/slides/slides.ios.css +764 -0
  650. package/dist/node_modules/@ionic/core/dist/collection/components/slides/slides.md.css +764 -0
  651. package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +167 -0
  652. package/dist/node_modules/@ionic/core/dist/collection/components/split-pane/split-pane.ios.css +108 -0
  653. package/dist/node_modules/@ionic/core/dist/collection/components/split-pane/split-pane.md.css +108 -0
  654. package/dist/node_modules/@ionic/core/dist/collection/components/tab/tab.css +4 -0
  655. package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.ios.css +97 -0
  656. package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.md.css +82 -0
  657. package/dist/node_modules/@ionic/core/dist/collection/components/tab-button/tab-button.ios.css +308 -0
  658. package/dist/node_modules/@ionic/core/dist/collection/components/tab-button/tab-button.md.css +331 -0
  659. package/dist/node_modules/@ionic/core/dist/collection/components/tabs/tabs.css +19 -0
  660. package/dist/node_modules/@ionic/core/dist/collection/components/text/text.css +3 -0
  661. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +175 -0
  662. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +179 -0
  663. package/dist/node_modules/@ionic/core/dist/collection/components/thumbnail/thumbnail.css +21 -0
  664. package/dist/node_modules/@ionic/core/dist/collection/components/title/title.ios.css +122 -0
  665. package/dist/node_modules/@ionic/core/dist/collection/components/title/title.md.css +55 -0
  666. package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.ios.css +262 -0
  667. package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.md.css +295 -0
  668. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +286 -0
  669. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +261 -0
  670. package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.ios.css +175 -0
  671. package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.md.css +168 -0
  672. package/dist/node_modules/@ionic/core/dist/collection/components/virtual-scroll/virtual-scroll.css +21 -0
  673. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/button/button.css +49 -0
  674. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/card/card.css +208 -0
  675. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/cards.css +31 -0
  676. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/code/code.css +245 -0
  677. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/dropdown/dropdown.css +115 -0
  678. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header-mobile-collapse/header-mobile-collapse.css +257 -0
  679. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header.css +232 -0
  680. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/collapsible/collapsible.css +3 -0
  681. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu-toggle/menu-toggle.css +25 -0
  682. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu.css +71 -0
  683. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/nav/nav.css +194 -0
  684. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/notfound-page/notfound-page.css +4 -0
  685. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/overlay/overlay.css +67 -0
  686. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/page-footer/page-footer.css +25 -0
  687. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/pagination/pagination.css +93 -0
  688. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/select/select.css +52 -0
  689. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sidebar/sidebar.css +98 -0
  690. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sparkle-lower-content-nav/sparkle-lower-content-nav.css +8 -0
  691. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/table-of-contents/table-of-contents.css +37 -0
  692. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/tabs/tabs.css +64 -0
  693. package/dist/node_modules/@stencil/router/dist/collection/components/route/route.css +3 -0
  694. package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +101 -0
  695. package/dist/sparkle-core/index.esm.js +1 -19
  696. package/dist/sparkle-core/p-00d10dc9.js +4 -0
  697. package/dist/sparkle-core/p-0147266a.js +1 -0
  698. package/dist/sparkle-core/p-04c7b276.entry.js +1 -0
  699. package/dist/sparkle-core/p-05c032dd.js +4 -0
  700. package/dist/sparkle-core/p-06642405.entry.js +1 -0
  701. package/dist/sparkle-core/p-0664370b.entry.js +1 -0
  702. package/dist/sparkle-core/p-06c7d0f2.entry.js +1 -0
  703. package/dist/sparkle-core/p-076f0239.js +4 -0
  704. package/dist/sparkle-core/p-077c732b.js +4 -0
  705. package/dist/sparkle-core/p-08420531.entry.js +1 -0
  706. package/dist/sparkle-core/p-0ad5c123.entry.js +1 -0
  707. package/dist/sparkle-core/p-0afa3a4d.entry.js +1 -0
  708. package/dist/sparkle-core/p-0c3f3ea6.entry.js +1 -0
  709. package/dist/sparkle-core/p-0e4de1d0.js +4 -0
  710. package/dist/sparkle-core/p-0e8e539f.entry.js +1 -0
  711. package/dist/sparkle-core/p-11356b03.entry.js +1 -0
  712. package/dist/sparkle-core/p-11a6c175.entry.js +1 -0
  713. package/dist/sparkle-core/p-12dd96d7.js +4 -0
  714. package/dist/sparkle-core/p-13ec39db.entry.js +1 -0
  715. package/dist/sparkle-core/p-1adc98f6.js +1 -0
  716. package/dist/sparkle-core/p-1b1ba156.entry.js +1 -0
  717. package/dist/sparkle-core/p-1e125ca5.entry.js +1 -0
  718. package/dist/sparkle-core/p-1e4782af.entry.js +1 -0
  719. package/dist/sparkle-core/p-2033cd86.js +7 -0
  720. package/dist/sparkle-core/p-214d1229.entry.js +1 -0
  721. package/dist/sparkle-core/p-23aca7ca.js +4 -0
  722. package/dist/sparkle-core/p-24cb9a33.entry.js +1 -0
  723. package/dist/sparkle-core/p-27fbabc3.entry.js +1 -0
  724. package/dist/sparkle-core/p-2ba70507.entry.js +1 -0
  725. package/dist/sparkle-core/p-2c1ca854.entry.js +1 -0
  726. package/dist/sparkle-core/p-2caed39f.entry.js +1 -0
  727. package/dist/sparkle-core/p-2d9659e2.entry.js +1 -0
  728. package/dist/sparkle-core/p-2f569553.js +1 -0
  729. package/dist/sparkle-core/p-30b810d1.entry.js +4 -0
  730. package/dist/sparkle-core/p-32f4e565.entry.js +1 -0
  731. package/dist/sparkle-core/p-352677e6.entry.js +1 -0
  732. package/dist/sparkle-core/p-38b7cf68.entry.js +1 -0
  733. package/dist/sparkle-core/p-38c842d5.entry.js +1 -0
  734. package/dist/sparkle-core/p-3963e02b.entry.js +1 -0
  735. package/dist/sparkle-core/p-39712c56.entry.js +4 -0
  736. package/dist/sparkle-core/p-39a31e43.js +1 -0
  737. package/dist/sparkle-core/p-3de0e00c.js +4 -0
  738. package/dist/sparkle-core/p-4053ecdb.entry.js +1 -0
  739. package/dist/sparkle-core/p-408176ba.js +1 -0
  740. package/dist/sparkle-core/p-42ed7d5f.entry.js +1 -0
  741. package/dist/sparkle-core/p-48f72e63.js +4 -0
  742. package/dist/sparkle-core/p-4b4a8703.js +1 -0
  743. package/dist/sparkle-core/p-4c1980f7.entry.js +352 -0
  744. package/dist/sparkle-core/p-4c6a7e52.js +1 -0
  745. package/dist/sparkle-core/p-4d1cfcbe.entry.js +1 -0
  746. package/dist/sparkle-core/p-4d4077ea.js +4 -0
  747. package/dist/sparkle-core/p-4fba3e4c.js +1 -0
  748. package/dist/sparkle-core/p-506221fe.js +4 -0
  749. package/dist/sparkle-core/p-5096739e.entry.js +1 -0
  750. package/dist/sparkle-core/p-5322c920.entry.js +1 -0
  751. package/dist/sparkle-core/p-5893bbe5.entry.js +1 -0
  752. package/dist/sparkle-core/p-594a6982.entry.js +1 -0
  753. package/dist/sparkle-core/p-5c435d5a.entry.js +1 -0
  754. package/dist/sparkle-core/p-5cad23f1.js +3 -0
  755. package/dist/sparkle-core/p-5d409601.js +1 -0
  756. package/dist/sparkle-core/p-601397df.entry.js +1 -0
  757. package/dist/sparkle-core/p-604a7987.js +4 -0
  758. package/dist/sparkle-core/p-616941c6.entry.js +1 -0
  759. package/dist/sparkle-core/p-6316d124.entry.js +1 -0
  760. package/dist/sparkle-core/p-63f71ada.entry.js +1 -0
  761. package/dist/sparkle-core/p-69487d90.entry.js +1 -0
  762. package/dist/sparkle-core/p-6bde0192.entry.js +7 -0
  763. package/dist/sparkle-core/p-6d2f4093.entry.js +7 -0
  764. package/dist/sparkle-core/p-6ffd2420.entry.js +1 -0
  765. package/dist/sparkle-core/p-72053ae0.entry.js +1 -0
  766. package/dist/sparkle-core/p-73721c84.js +4 -0
  767. package/dist/sparkle-core/p-74864276.entry.js +1 -0
  768. package/dist/sparkle-core/p-7d8427eb.js +4 -0
  769. package/dist/sparkle-core/p-7dae0f0e.js +1 -0
  770. package/dist/sparkle-core/p-7dbfc316.js +1 -0
  771. package/dist/sparkle-core/p-7e7ce516.js +4 -0
  772. package/dist/sparkle-core/p-81714d94.entry.js +1 -0
  773. package/dist/sparkle-core/p-8492a765.entry.js +1 -0
  774. package/dist/sparkle-core/p-859563db.entry.js +1 -0
  775. package/dist/sparkle-core/p-85d4cd5c.entry.js +1 -0
  776. package/dist/sparkle-core/p-865f36a8.entry.js +1 -0
  777. package/dist/sparkle-core/p-86ed13f0.js +5 -0
  778. package/dist/sparkle-core/p-871106e0.js +4 -0
  779. package/dist/sparkle-core/p-894ff7e6.entry.js +1 -0
  780. package/dist/sparkle-core/p-8a41b502.entry.js +1 -0
  781. package/dist/sparkle-core/p-8b56f734.js +1 -0
  782. package/dist/sparkle-core/p-8c74cbb6.entry.js +1 -0
  783. package/dist/sparkle-core/p-924b2917.js +4 -0
  784. package/dist/sparkle-core/p-9289cdbc.entry.js +1 -0
  785. package/dist/sparkle-core/p-957715c5.entry.js +1 -0
  786. package/dist/sparkle-core/p-973fe404.entry.js +22 -0
  787. package/dist/sparkle-core/p-975b99ee.entry.js +1 -0
  788. package/dist/sparkle-core/p-98daeddb.entry.js +1 -0
  789. package/dist/sparkle-core/p-99ee9919.js +1 -0
  790. package/dist/sparkle-core/p-9abbd715.entry.js +1 -0
  791. package/dist/sparkle-core/p-9d894ed4.js +4 -0
  792. package/dist/sparkle-core/p-9e309b3e.entry.js +1 -0
  793. package/dist/sparkle-core/p-9e7fee8f.entry.js +1 -0
  794. package/dist/sparkle-core/p-9ebf0537.entry.js +1 -0
  795. package/dist/sparkle-core/p-a208ab2d.js +4 -0
  796. package/dist/sparkle-core/p-a2638250.entry.js +1 -0
  797. package/dist/sparkle-core/p-a2ebcf0a.entry.js +1 -0
  798. package/dist/sparkle-core/p-a98d7ebe.entry.js +1 -0
  799. package/dist/sparkle-core/p-add30d46.js +4 -0
  800. package/dist/sparkle-core/p-b0603d19.js +16 -0
  801. package/dist/sparkle-core/p-b06e2bef.js +1 -0
  802. package/dist/sparkle-core/p-b3f375fb.entry.js +1 -0
  803. package/dist/sparkle-core/p-b5f3e1bf.entry.js +1 -0
  804. package/dist/sparkle-core/p-b6fec622.entry.js +1 -0
  805. package/dist/sparkle-core/p-b8d71ff4.js +1 -0
  806. package/dist/sparkle-core/p-b96f3c84.entry.js +7 -0
  807. package/dist/sparkle-core/p-bd80ff43.js +4 -0
  808. package/dist/sparkle-core/p-bd90903e.js +1 -0
  809. package/dist/sparkle-core/p-be64105c.entry.js +1 -0
  810. package/dist/sparkle-core/p-c0533c23.entry.js +1 -0
  811. package/dist/sparkle-core/p-c2990b24.entry.js +1 -0
  812. package/dist/sparkle-core/p-c3cadfc6.entry.js +1 -0
  813. package/dist/sparkle-core/p-c60b29bd.entry.js +4 -0
  814. package/dist/sparkle-core/p-c64a34cd.entry.js +1 -0
  815. package/dist/sparkle-core/p-c7e21070.entry.js +1 -0
  816. package/dist/sparkle-core/p-c9f753a4.js +1 -0
  817. package/dist/sparkle-core/p-cabe9139.js +1 -0
  818. package/dist/sparkle-core/p-cabfbf22.entry.js +1 -0
  819. package/dist/sparkle-core/p-cc518c36.entry.js +1 -0
  820. package/dist/sparkle-core/p-cffd4817.entry.js +1 -0
  821. package/dist/sparkle-core/p-d0adf726.entry.js +1 -0
  822. package/dist/sparkle-core/p-d20e4fcf.entry.js +1 -0
  823. package/dist/sparkle-core/p-d24e53ab.entry.js +1 -0
  824. package/dist/sparkle-core/p-d288e6c1.entry.js +1 -0
  825. package/dist/sparkle-core/p-d601810e.entry.js +1 -0
  826. package/dist/sparkle-core/p-d68092b7.js +4 -0
  827. package/dist/sparkle-core/p-da391f3f.js +1 -0
  828. package/dist/sparkle-core/p-de4deb61.entry.js +1 -0
  829. package/dist/sparkle-core/p-e0cad1bb.js +1 -0
  830. package/dist/sparkle-core/p-e249aebf.entry.js +1 -0
  831. package/dist/sparkle-core/p-e3e36ce9.entry.js +1 -0
  832. package/dist/sparkle-core/p-e421d638.entry.js +1 -0
  833. package/dist/sparkle-core/p-e686d8b5.entry.js +4 -0
  834. package/dist/sparkle-core/p-e8988989.entry.js +1 -0
  835. package/dist/sparkle-core/p-e9431eeb.js +7 -0
  836. package/dist/sparkle-core/p-ea962e1b.entry.js +1 -0
  837. package/dist/sparkle-core/p-eaa8bbee.js +4 -0
  838. package/dist/sparkle-core/p-ebd4354b.entry.js +1 -0
  839. package/dist/sparkle-core/p-ee1e0eb4.js +2 -0
  840. package/dist/sparkle-core/p-ef4edc48.entry.js +4 -0
  841. package/dist/sparkle-core/p-f196c124.entry.js +7 -0
  842. package/dist/sparkle-core/p-f3cba72a.js +4 -0
  843. package/dist/sparkle-core/p-f47fe1fe.entry.js +1 -0
  844. package/dist/sparkle-core/p-f714f77a.entry.js +1 -0
  845. package/dist/sparkle-core/p-f891c79a.entry.js +1 -0
  846. package/dist/sparkle-core/p-fb0ca75e.entry.js +5 -0
  847. package/dist/sparkle-core/p-fb757951.entry.js +1 -0
  848. package/dist/sparkle-core/p-fd8d0738.entry.js +4 -0
  849. package/dist/sparkle-core/p-fda95b6e.entry.js +1 -0
  850. package/dist/sparkle-core/p-fe6dc976.entry.js +1 -0
  851. package/dist/sparkle-core/p-ff080f82.entry.js +10 -0
  852. package/dist/sparkle-core/p-ff7a8a71.js +4 -0
  853. package/dist/sparkle-core/sparkle-core.css +1 -2660
  854. package/dist/sparkle-core/sparkle-core.esm.js +1 -130
  855. package/package.json +2 -2
  856. package/dist/sparkle-core/PrivateRoute-a12e7ee5.js +0 -37
  857. package/dist/sparkle-core/account.service-e711795d.js +0 -63
  858. package/dist/sparkle-core/active-router-af86c9b4.js +0 -73
  859. package/dist/sparkle-core/animation-676a644d.js +0 -984
  860. package/dist/sparkle-core/app-globals-9ffa9ec3.js +0 -10
  861. package/dist/sparkle-core/appdata.service-703dff70.js +0 -69
  862. package/dist/sparkle-core/assets/user.png +0 -0
  863. package/dist/sparkle-core/assets.service-6508aae6.js +0 -71
  864. package/dist/sparkle-core/assignment.service-e42e9368.js +0 -17
  865. package/dist/sparkle-core/button-active-d68c5eb7.js +0 -67
  866. package/dist/sparkle-core/compass-svg.entry.js +0 -128
  867. package/dist/sparkle-core/context-consumer.entry.js +0 -25
  868. package/dist/sparkle-core/course-select.entry.js +0 -26
  869. package/dist/sparkle-core/css-shim-04165e59.js +0 -4
  870. package/dist/sparkle-core/dom-26e7cb2c.js +0 -73
  871. package/dist/sparkle-core/dom-utils-8e73e88b.js +0 -55
  872. package/dist/sparkle-core/facilitator.service-00a88935.js +0 -79
  873. package/dist/sparkle-core/facilitator.store-01be0386.js +0 -18
  874. package/dist/sparkle-core/feed.service-d495f3e1.js +0 -53
  875. package/dist/sparkle-core/framework-delegate-d3fa493f.js +0 -107
  876. package/dist/sparkle-core/haptic-a9e94599.js +0 -124
  877. package/dist/sparkle-core/header-mobile-collapse.entry.js +0 -86
  878. package/dist/sparkle-core/helpers-f11f0674.js +0 -406
  879. package/dist/sparkle-core/icons-758d1417.js +0 -41
  880. package/dist/sparkle-core/index-05b398c2.js +0 -34
  881. package/dist/sparkle-core/index-0af0deac.js +0 -312
  882. package/dist/sparkle-core/index-0df264ee.js +0 -4518
  883. package/dist/sparkle-core/index-183cda39.js +0 -223
  884. package/dist/sparkle-core/index-18a69883.js +0 -1336
  885. package/dist/sparkle-core/index-1d7a6fa0.js +0 -269
  886. package/dist/sparkle-core/index-1dec9544.js +0 -3064
  887. package/dist/sparkle-core/index-81dab78f.js +0 -85
  888. package/dist/sparkle-core/index-9b5bcea1.js +0 -22
  889. package/dist/sparkle-core/index-bb469fe3.js +0 -128
  890. package/dist/sparkle-core/index-d2990a48.js +0 -184
  891. package/dist/sparkle-core/index-dd414b33.js +0 -653
  892. package/dist/sparkle-core/index-faeec85a.js +0 -8
  893. package/dist/sparkle-core/index.es-1f6eedc5.js +0 -11066
  894. package/dist/sparkle-core/input-shims-0b2f5522.js +0 -418
  895. package/dist/sparkle-core/ion-accordion-group.entry.js +0 -201
  896. package/dist/sparkle-core/ion-accordion.entry.js +0 -332
  897. package/dist/sparkle-core/ion-action-sheet.entry.js +0 -263
  898. package/dist/sparkle-core/ion-alert.entry.js +0 -448
  899. package/dist/sparkle-core/ion-app.entry.js +0 -75
  900. package/dist/sparkle-core/ion-avatar.entry.js +0 -21
  901. package/dist/sparkle-core/ion-back-button.entry.js +0 -90
  902. package/dist/sparkle-core/ion-backdrop.entry.js +0 -63
  903. package/dist/sparkle-core/ion-badge.entry.js +0 -25
  904. package/dist/sparkle-core/ion-breadcrumb.entry.js +0 -91
  905. package/dist/sparkle-core/ion-breadcrumbs.entry.js +0 -129
  906. package/dist/sparkle-core/ion-button.entry.js +0 -125
  907. package/dist/sparkle-core/ion-buttons.entry.js +0 -38
  908. package/dist/sparkle-core/ion-card-content.entry.js +0 -26
  909. package/dist/sparkle-core/ion-card-header.entry.js +0 -33
  910. package/dist/sparkle-core/ion-card-subtitle.entry.js +0 -26
  911. package/dist/sparkle-core/ion-card-title.entry.js +0 -26
  912. package/dist/sparkle-core/ion-card.entry.js +0 -64
  913. package/dist/sparkle-core/ion-checkbox.entry.js +0 -109
  914. package/dist/sparkle-core/ion-chip.entry.js +0 -36
  915. package/dist/sparkle-core/ion-col.entry.js +0 -121
  916. package/dist/sparkle-core/ion-content.entry.js +0 -319
  917. package/dist/sparkle-core/ion-datetime-button.entry.js +0 -308
  918. package/dist/sparkle-core/ion-datetime.entry.js +0 -1619
  919. package/dist/sparkle-core/ion-fab-button.entry.js +0 -104
  920. package/dist/sparkle-core/ion-fab-list.entry.js +0 -41
  921. package/dist/sparkle-core/ion-fab.entry.js +0 -72
  922. package/dist/sparkle-core/ion-footer.entry.js +0 -116
  923. package/dist/sparkle-core/ion-grid.entry.js +0 -24
  924. package/dist/sparkle-core/ion-header.entry.js +0 -341
  925. package/dist/sparkle-core/ion-icon.entry.js +0 -200
  926. package/dist/sparkle-core/ion-img.entry.js +0 -97
  927. package/dist/sparkle-core/ion-infinite-scroll-content.entry.js +0 -33
  928. package/dist/sparkle-core/ion-infinite-scroll.entry.js +0 -202
  929. package/dist/sparkle-core/ion-input.entry.js +0 -293
  930. package/dist/sparkle-core/ion-item-divider.entry.js +0 -36
  931. package/dist/sparkle-core/ion-item-group.entry.js +0 -27
  932. package/dist/sparkle-core/ion-item-option.entry.js +0 -56
  933. package/dist/sparkle-core/ion-item-options.entry.js +0 -43
  934. package/dist/sparkle-core/ion-item-sliding.entry.js +0 -394
  935. package/dist/sparkle-core/ion-item.entry.js +0 -267
  936. package/dist/sparkle-core/ion-label.entry.js +0 -77
  937. package/dist/sparkle-core/ion-list-header.entry.js +0 -27
  938. package/dist/sparkle-core/ion-list.entry.js +0 -48
  939. package/dist/sparkle-core/ion-loading.entry.js +0 -211
  940. package/dist/sparkle-core/ion-menu-button.entry.js +0 -72
  941. package/dist/sparkle-core/ion-menu-toggle.entry.js +0 -43
  942. package/dist/sparkle-core/ion-menu.entry.js +0 -575
  943. package/dist/sparkle-core/ion-modal.entry.js +0 -1706
  944. package/dist/sparkle-core/ion-nav-link.entry.js +0 -43
  945. package/dist/sparkle-core/ion-nav.entry.js +0 -872
  946. package/dist/sparkle-core/ion-note.entry.js +0 -25
  947. package/dist/sparkle-core/ion-picker-column-internal.entry.js +0 -363
  948. package/dist/sparkle-core/ion-picker-column.entry.js +0 -327
  949. package/dist/sparkle-core/ion-picker-internal.entry.js +0 -454
  950. package/dist/sparkle-core/ion-picker.entry.js +0 -217
  951. package/dist/sparkle-core/ion-popover.entry.js +0 -1362
  952. package/dist/sparkle-core/ion-progress-bar.entry.js +0 -70
  953. package/dist/sparkle-core/ion-radio-group.entry.js +0 -121
  954. package/dist/sparkle-core/ion-radio.entry.js +0 -111
  955. package/dist/sparkle-core/ion-range.entry.js +0 -511
  956. package/dist/sparkle-core/ion-refresher-content.entry.js +0 -31
  957. package/dist/sparkle-core/ion-refresher.entry.js +0 -798
  958. package/dist/sparkle-core/ion-reorder-group.entry.js +0 -277
  959. package/dist/sparkle-core/ion-reorder.entry.js +0 -34
  960. package/dist/sparkle-core/ion-ripple-effect.entry.js +0 -89
  961. package/dist/sparkle-core/ion-route-redirect.entry.js +0 -20
  962. package/dist/sparkle-core/ion-route.entry.js +0 -45
  963. package/dist/sparkle-core/ion-router-link.entry.js +0 -34
  964. package/dist/sparkle-core/ion-router-outlet.entry.js +0 -196
  965. package/dist/sparkle-core/ion-router.entry.js +0 -827
  966. package/dist/sparkle-core/ion-row.entry.js +0 -16
  967. package/dist/sparkle-core/ion-searchbar.entry.js +0 -366
  968. package/dist/sparkle-core/ion-segment-button.entry.js +0 -98
  969. package/dist/sparkle-core/ion-segment.entry.js +0 -415
  970. package/dist/sparkle-core/ion-select-option.entry.js +0 -23
  971. package/dist/sparkle-core/ion-select-popover.entry.js +0 -96
  972. package/dist/sparkle-core/ion-select.entry.js +0 -510
  973. package/dist/sparkle-core/ion-skeleton-text.entry.js +0 -29
  974. package/dist/sparkle-core/ion-slide.entry.js +0 -21
  975. package/dist/sparkle-core/ion-slides.entry.js +0 -387
  976. package/dist/sparkle-core/ion-spinner.entry.js +0 -60
  977. package/dist/sparkle-core/ion-split-pane.entry.js +0 -156
  978. package/dist/sparkle-core/ion-tab-bar.entry.js +0 -71
  979. package/dist/sparkle-core/ion-tab-button.entry.js +0 -99
  980. package/dist/sparkle-core/ion-tab.entry.js +0 -63
  981. package/dist/sparkle-core/ion-tabs.entry.js +0 -150
  982. package/dist/sparkle-core/ion-text.entry.js +0 -20
  983. package/dist/sparkle-core/ion-textarea.entry.js +0 -244
  984. package/dist/sparkle-core/ion-thumbnail.entry.js +0 -16
  985. package/dist/sparkle-core/ion-title.entry.js +0 -48
  986. package/dist/sparkle-core/ion-toast.entry.js +0 -268
  987. package/dist/sparkle-core/ion-toggle.entry.js +0 -173
  988. package/dist/sparkle-core/ion-toolbar.entry.js +0 -70
  989. package/dist/sparkle-core/ion-virtual-scroll.entry.js +0 -551
  990. package/dist/sparkle-core/ionic-global-127576f6.js +0 -226
  991. package/dist/sparkle-core/ios.transition-02531dda.js +0 -479
  992. package/dist/sparkle-core/location-utils-fea12957.js +0 -229
  993. package/dist/sparkle-core/match-path-760e1797.js +0 -343
  994. package/dist/sparkle-core/md.transition-f8765467.js +0 -55
  995. package/dist/sparkle-core/media.service-2609406e.js +0 -36
  996. package/dist/sparkle-core/menu-toggle-util-6cc13cbd.js +0 -12
  997. package/dist/sparkle-core/overlays-fd3cfa13.js +0 -493
  998. package/dist/sparkle-core/parse-60474840.js +0 -1196
  999. package/dist/sparkle-core/purify-d9093094.js +0 -1469
  1000. package/dist/sparkle-core/quiz.model-1cff62e4.js +0 -5
  1001. package/dist/sparkle-core/shadow-css-1257b266.js +0 -387
  1002. package/dist/sparkle-core/signalR.service-2b7645c1.js +0 -2983
  1003. package/dist/sparkle-core/sparkle-animation-player.entry.js +0 -513
  1004. package/dist/sparkle-core/sparkle-assignment.entry.js +0 -114
  1005. package/dist/sparkle-core/sparkle-button.entry.js +0 -24
  1006. package/dist/sparkle-core/sparkle-card.entry.js +0 -61
  1007. package/dist/sparkle-core/sparkle-cards.entry.js +0 -15
  1008. package/dist/sparkle-core/sparkle-character-intro.entry.js +0 -22
  1009. package/dist/sparkle-core/sparkle-code.entry.js +0 -39
  1010. package/dist/sparkle-core/sparkle-compass-post.entry.js +0 -129
  1011. package/dist/sparkle-core/sparkle-compass.entry.js +0 -122
  1012. package/dist/sparkle-core/sparkle-course-root.entry.js +0 -155
  1013. package/dist/sparkle-core/sparkle-discussion-questions.entry.js +0 -122
  1014. package/dist/sparkle-core/sparkle-discussion-results.entry.js +0 -189
  1015. package/dist/sparkle-core/sparkle-discussion.entry.js +0 -52
  1016. package/dist/sparkle-core/sparkle-dropdown.entry.js +0 -57
  1017. package/dist/sparkle-core/sparkle-emoji.entry.js +0 -77
  1018. package/dist/sparkle-core/sparkle-export-lessons.entry.js +0 -10081
  1019. package/dist/sparkle-core/sparkle-facilitator-dashboard.entry.js +0 -93
  1020. package/dist/sparkle-core/sparkle-facilitator-header.entry.js +0 -60
  1021. package/dist/sparkle-core/sparkle-facilitator-notes-form.entry.js +0 -160
  1022. package/dist/sparkle-core/sparkle-facilitator-notes.entry.js +0 -65
  1023. package/dist/sparkle-core/sparkle-facilitator-page.entry.js +0 -198
  1024. package/dist/sparkle-core/sparkle-feed-post.entry.js +0 -131
  1025. package/dist/sparkle-core/sparkle-feedback.entry.js +0 -106
  1026. package/dist/sparkle-core/sparkle-file-upload.entry.js +0 -57
  1027. package/dist/sparkle-core/sparkle-forgot-password.entry.js +0 -80
  1028. package/dist/sparkle-core/sparkle-goal-form.entry.js +0 -182
  1029. package/dist/sparkle-core/sparkle-goal-item.entry.js +0 -15
  1030. package/dist/sparkle-core/sparkle-goal-progress.entry.js +0 -15
  1031. package/dist/sparkle-core/sparkle-goals.entry.js +0 -47
  1032. package/dist/sparkle-core/sparkle-gww-comment-list.entry.js +0 -22
  1033. package/dist/sparkle-core/sparkle-gww-graph.entry.js +0 -15
  1034. package/dist/sparkle-core/sparkle-gww-item.entry.js +0 -80
  1035. package/dist/sparkle-core/sparkle-gww.entry.js +0 -44
  1036. package/dist/sparkle-core/sparkle-header.entry.js +0 -97
  1037. package/dist/sparkle-core/sparkle-health.entry.js +0 -70
  1038. package/dist/sparkle-core/sparkle-input.entry.js +0 -52
  1039. package/dist/sparkle-core/sparkle-intro.entry.js +0 -22
  1040. package/dist/sparkle-core/sparkle-login.entry.js +0 -116
  1041. package/dist/sparkle-core/sparkle-lower-content-nav.entry.js +0 -18
  1042. package/dist/sparkle-core/sparkle-menu-collapsible.entry.js +0 -42
  1043. package/dist/sparkle-core/sparkle-menu-toggle.entry.js +0 -24
  1044. package/dist/sparkle-core/sparkle-menu.entry.js +0 -26
  1045. package/dist/sparkle-core/sparkle-modal-image.entry.js +0 -33
  1046. package/dist/sparkle-core/sparkle-mood.entry.js +0 -76
  1047. package/dist/sparkle-core/sparkle-nav.entry.js +0 -113
  1048. package/dist/sparkle-core/sparkle-notfound-page.entry.js +0 -25
  1049. package/dist/sparkle-core/sparkle-online-students.entry.js +0 -55
  1050. package/dist/sparkle-core/sparkle-overlay.entry.js +0 -90
  1051. package/dist/sparkle-core/sparkle-page-footer.entry.js +0 -24
  1052. package/dist/sparkle-core/sparkle-page.entry.js +0 -245
  1053. package/dist/sparkle-core/sparkle-pagination.entry.js +0 -67
  1054. package/dist/sparkle-core/sparkle-poll.entry.js +0 -15
  1055. package/dist/sparkle-core/sparkle-quiz-container.entry.js +0 -43
  1056. package/dist/sparkle-core/sparkle-quiz-feedback.entry.js +0 -18
  1057. package/dist/sparkle-core/sparkle-quiz-input.entry.js +0 -16
  1058. package/dist/sparkle-core/sparkle-quiz-old.entry.js +0 -116
  1059. package/dist/sparkle-core/sparkle-quiz-opinion.entry.js +0 -41
  1060. package/dist/sparkle-core/sparkle-quiz-poll.entry.js +0 -16
  1061. package/dist/sparkle-core/sparkle-quiz-select.entry.js +0 -29
  1062. package/dist/sparkle-core/sparkle-quiz.entry.js +0 -98
  1063. package/dist/sparkle-core/sparkle-reset-password.entry.js +0 -96
  1064. package/dist/sparkle-core/sparkle-root.entry.js +0 -79
  1065. package/dist/sparkle-core/sparkle-select.entry.js +0 -57
  1066. package/dist/sparkle-core/sparkle-sidebar.entry.js +0 -39
  1067. package/dist/sparkle-core/sparkle-signup.entry.js +0 -144
  1068. package/dist/sparkle-core/sparkle-tab.entry.js +0 -22
  1069. package/dist/sparkle-core/sparkle-table-of-contents.entry.js +0 -67
  1070. package/dist/sparkle-core/sparkle-tabs.entry.js +0 -62
  1071. package/dist/sparkle-core/sparkle-unauthorized.entry.js +0 -17
  1072. package/dist/sparkle-core/sparkle-user-enrollment.entry.js +0 -85
  1073. package/dist/sparkle-core/sparkle-user-profile.entry.js +0 -129
  1074. package/dist/sparkle-core/sparkle-validation-error.entry.js +0 -17
  1075. package/dist/sparkle-core/sparkle-video-player.entry.js +0 -18
  1076. package/dist/sparkle-core/sparkle-youtube.entry.js +0 -35
  1077. package/dist/sparkle-core/status-tap-52feb1b1.js +0 -40
  1078. package/dist/sparkle-core/stencil-async-content.entry.js +0 -28
  1079. package/dist/sparkle-core/stencil-route-link.entry.js +0 -74
  1080. package/dist/sparkle-core/stencil-route-switch.entry.js +0 -100
  1081. package/dist/sparkle-core/stencil-route-title.entry.js +0 -28
  1082. package/dist/sparkle-core/stencil-route.entry.js +0 -93
  1083. package/dist/sparkle-core/stencil-router-prompt.entry.js +0 -55
  1084. package/dist/sparkle-core/stencil-router-redirect.entry.js +0 -28
  1085. package/dist/sparkle-core/stencil-router.entry.js +0 -636
  1086. package/dist/sparkle-core/store.service-0f7d998b.js +0 -16
  1087. package/dist/sparkle-core/student.service-f0375229.js +0 -59
  1088. package/dist/sparkle-core/swipe-back-9a614189.js +0 -73
  1089. package/dist/sparkle-core/swiper.bundle-4274e115.js +0 -6418
  1090. package/dist/sparkle-core/user.store-3d052406.js +0 -19
  1091. package/dist/sparkle-core/util-ba470e54.js +0 -14683
  1092. package/dist/sparkle-core/utils-cae23bce.js +0 -114
  1093. /package/dist/{sparkle-core → esm}/cubic-bezier-4c0db14f.js +0 -0
  1094. /package/dist/{sparkle-core → esm}/focus-visible-4e9a0764.js +0 -0
  1095. /package/dist/{sparkle-core → esm}/hardware-back-button-fa04d6e9.js +0 -0
  1096. /package/dist/{sparkle-core → esm}/index-be6112f8.js +0 -0
  1097. /package/dist/{sparkle-core → esm}/keyboard-7e8329b3.js +0 -0
  1098. /package/dist/{sparkle-core → esm}/localstorage.service-4bf408c8.js +0 -0
  1099. /package/dist/{sparkle-core → esm}/spinner-configs-a37e628a.js +0 -0
  1100. /package/dist/{sparkle-core → esm}/theme-7ef00c83.js +0 -0
@@ -1,3064 +0,0 @@
1
- const NAMESPACE = 'sparkle-core';
2
- const BUILD = /* sparkle-core */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: true, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: true, connectedCallback: true, constructableCSS: false, cssAnnotations: true, cssVarShim: false, devTools: true, disconnectedCallback: true, dynamicImportShim: false, element: false, event: true, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: true, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: true, observeAttribute: true, profile: true, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, safari10: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: true, shadowDom: true, shadowDomShim: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
3
- const Env = /* sparkle-core */ {};
4
-
5
- let scopeId;
6
- let contentRef;
7
- let hostTagName;
8
- let customError;
9
- let i = 0;
10
- let useNativeShadowDom = false;
11
- let checkSlotFallbackVisibility = false;
12
- let checkSlotRelocate = false;
13
- let isSvgMode = false;
14
- let renderingRef = null;
15
- let queueCongestion = 0;
16
- let queuePending = false;
17
- const win = typeof window !== 'undefined' ? window : {};
18
- const CSS = BUILD.cssVarShim ? win.CSS : null;
19
- const doc = win.document || { head: {} };
20
- const H = (win.HTMLElement || class {
21
- });
22
- const plt = {
23
- $flags$: 0,
24
- $resourcesUrl$: '',
25
- jmp: (h) => h(),
26
- raf: (h) => requestAnimationFrame(h),
27
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
28
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
29
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
30
- };
31
- const setPlatformHelpers = (helpers) => {
32
- Object.assign(plt, helpers);
33
- };
34
- const supportsShadow = BUILD.shadowDomShim && BUILD.shadowDom
35
- ? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
36
- : true;
37
- const supportsListenerOptions = /*@__PURE__*/ (() => {
38
- let supportsListenerOptions = false;
39
- try {
40
- doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
41
- get() {
42
- supportsListenerOptions = true;
43
- },
44
- }));
45
- }
46
- catch (e) { }
47
- return supportsListenerOptions;
48
- })();
49
- const promiseResolve = (v) => Promise.resolve(v);
50
- const supportsConstructableStylesheets = BUILD.constructableCSS
51
- ? /*@__PURE__*/ (() => {
52
- try {
53
- new CSSStyleSheet();
54
- return typeof new CSSStyleSheet().replaceSync === 'function';
55
- }
56
- catch (e) { }
57
- return false;
58
- })()
59
- : false;
60
- const Context = {};
61
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
62
- if (BUILD.hostListener && listeners) {
63
- // this is called immediately within the element's constructor
64
- // initialize our event listeners on the host element
65
- // we do this now so that we can listen to events that may
66
- // have fired even before the instance is ready
67
- if (BUILD.hostListenerTargetParent) {
68
- // this component may have event listeners that should be attached to the parent
69
- if (attachParentListeners) {
70
- // this is being ran from within the connectedCallback
71
- // which is important so that we know the host element actually has a parent element
72
- // filter out the listeners to only have the ones that ARE being attached to the parent
73
- listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
74
- }
75
- else {
76
- // this is being ran from within the component constructor
77
- // everything BUT the parent element listeners should be attached at this time
78
- // filter out the listeners that are NOT being attached to the parent
79
- listeners = listeners.filter(([flags]) => !(flags & 32 /* TargetParent */));
80
- }
81
- }
82
- listeners.map(([flags, name, method]) => {
83
- const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
84
- const handler = hostListenerProxy(hostRef, method);
85
- const opts = hostListenerOpts(flags);
86
- plt.ael(target, name, handler, opts);
87
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
88
- });
89
- }
90
- };
91
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
92
- try {
93
- if (BUILD.lazyLoad) {
94
- if (hostRef.$flags$ & 256 /* isListenReady */) {
95
- // instance is ready, let's call it's member method for this event
96
- hostRef.$lazyInstance$[methodName](ev);
97
- }
98
- else {
99
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
100
- }
101
- }
102
- else {
103
- hostRef.$hostElement$[methodName](ev);
104
- }
105
- }
106
- catch (e) {
107
- consoleError(e);
108
- }
109
- };
110
- const getHostListenerTarget = (elm, flags) => {
111
- if (BUILD.hostListenerTargetDocument && flags & 4 /* TargetDocument */)
112
- return doc;
113
- if (BUILD.hostListenerTargetWindow && flags & 8 /* TargetWindow */)
114
- return win;
115
- if (BUILD.hostListenerTargetBody && flags & 16 /* TargetBody */)
116
- return doc.body;
117
- if (BUILD.hostListenerTargetParent && flags & 32 /* TargetParent */)
118
- return elm.parentElement;
119
- return elm;
120
- };
121
- // prettier-ignore
122
- const hostListenerOpts = (flags) => supportsListenerOptions
123
- ? ({
124
- passive: (flags & 1 /* Passive */) !== 0,
125
- capture: (flags & 2 /* Capture */) !== 0,
126
- })
127
- : (flags & 2 /* Capture */) !== 0;
128
- const CONTENT_REF_ID = 'r';
129
- const ORG_LOCATION_ID = 'o';
130
- const SLOT_NODE_ID = 's';
131
- const TEXT_NODE_ID = 't';
132
- const HYDRATE_ID = 's-id';
133
- const HYDRATED_STYLE_ID = 'sty-id';
134
- const HYDRATE_CHILD_ID = 'c-id';
135
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
136
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
137
- const createTime = (fnName, tagName = '') => {
138
- if (BUILD.profile && performance.mark) {
139
- const key = `st:${fnName}:${tagName}:${i++}`;
140
- // Start
141
- performance.mark(key);
142
- // End
143
- return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
144
- }
145
- else {
146
- return () => {
147
- return;
148
- };
149
- }
150
- };
151
- const uniqueTime = (key, measureText) => {
152
- if (BUILD.profile && performance.mark) {
153
- if (performance.getEntriesByName(key).length === 0) {
154
- performance.mark(key);
155
- }
156
- return () => {
157
- if (performance.getEntriesByName(measureText).length === 0) {
158
- performance.measure(measureText, key);
159
- }
160
- };
161
- }
162
- else {
163
- return () => {
164
- return;
165
- };
166
- }
167
- };
168
- const inspect = (ref) => {
169
- const hostRef = getHostRef(ref);
170
- if (!hostRef) {
171
- return undefined;
172
- }
173
- const flags = hostRef.$flags$;
174
- const hostElement = hostRef.$hostElement$;
175
- return {
176
- renderCount: hostRef.$renderCount$,
177
- flags: {
178
- hasRendered: !!(flags & 2 /* hasRendered */),
179
- hasConnected: !!(flags & 1 /* hasConnected */),
180
- isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
181
- isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
182
- isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
183
- hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
184
- hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
185
- isWatchReady: !!(flags & 128 /* isWatchReady */),
186
- isListenReady: !!(flags & 256 /* isListenReady */),
187
- needsRerender: !!(flags & 512 /* needsRerender */),
188
- },
189
- instanceValues: hostRef.$instanceValues$,
190
- ancestorComponent: hostRef.$ancestorComponent$,
191
- hostElement,
192
- lazyInstance: hostRef.$lazyInstance$,
193
- vnode: hostRef.$vnode$,
194
- modeName: hostRef.$modeName$,
195
- onReadyPromise: hostRef.$onReadyPromise$,
196
- onReadyResolve: hostRef.$onReadyResolve$,
197
- onInstancePromise: hostRef.$onInstancePromise$,
198
- onInstanceResolve: hostRef.$onInstanceResolve$,
199
- onRenderResolve: hostRef.$onRenderResolve$,
200
- queuedListeners: hostRef.$queuedListeners$,
201
- rmListeners: hostRef.$rmListeners$,
202
- ['s-id']: hostElement['s-id'],
203
- ['s-cr']: hostElement['s-cr'],
204
- ['s-lr']: hostElement['s-lr'],
205
- ['s-p']: hostElement['s-p'],
206
- ['s-rc']: hostElement['s-rc'],
207
- ['s-sc']: hostElement['s-sc'],
208
- };
209
- };
210
- const installDevTools = () => {
211
- if (BUILD.devTools) {
212
- const stencil = (win.stencil = win.stencil || {});
213
- const originalInspect = stencil.inspect;
214
- stencil.inspect = (ref) => {
215
- let result = inspect(ref);
216
- if (!result && typeof originalInspect === 'function') {
217
- result = originalInspect(ref);
218
- }
219
- return result;
220
- };
221
- }
222
- };
223
- const rootAppliedStyles = new WeakMap();
224
- const registerStyle = (scopeId, cssText, allowCS) => {
225
- let style = styles.get(scopeId);
226
- if (supportsConstructableStylesheets && allowCS) {
227
- style = (style || new CSSStyleSheet());
228
- if (typeof style === 'string') {
229
- style = cssText;
230
- }
231
- else {
232
- style.replaceSync(cssText);
233
- }
234
- }
235
- else {
236
- style = cssText;
237
- }
238
- styles.set(scopeId, style);
239
- };
240
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
241
- let scopeId = getScopeId(cmpMeta, mode);
242
- const style = styles.get(scopeId);
243
- if (!BUILD.attachStyles) {
244
- return scopeId;
245
- }
246
- // if an element is NOT connected then getRootNode() will return the wrong root node
247
- // so the fallback is to always use the document for the root node in those cases
248
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
249
- if (style) {
250
- if (typeof style === 'string') {
251
- styleContainerNode = styleContainerNode.head || styleContainerNode;
252
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
253
- let styleElm;
254
- if (!appliedStyles) {
255
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
256
- }
257
- if (!appliedStyles.has(scopeId)) {
258
- if (BUILD.hydrateClientSide &&
259
- styleContainerNode.host &&
260
- (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
261
- // This is only happening on native shadow-dom, do not needs CSS var shim
262
- styleElm.innerHTML = style;
263
- }
264
- else {
265
- if (BUILD.cssVarShim && plt.$cssShim$) {
266
- styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */));
267
- const newScopeId = styleElm['s-sc'];
268
- if (newScopeId) {
269
- scopeId = newScopeId;
270
- // we don't want to add this styleID to the appliedStyles Set
271
- // since the cssVarShim might need to apply several different
272
- // stylesheets for the same component
273
- appliedStyles = null;
274
- }
275
- }
276
- else {
277
- styleElm = doc.createElement('style');
278
- styleElm.innerHTML = style;
279
- }
280
- if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
281
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);
282
- }
283
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
284
- }
285
- if (appliedStyles) {
286
- appliedStyles.add(scopeId);
287
- }
288
- }
289
- }
290
- else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
291
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
292
- }
293
- }
294
- return scopeId;
295
- };
296
- const attachStyles = (hostRef) => {
297
- const cmpMeta = hostRef.$cmpMeta$;
298
- const elm = hostRef.$hostElement$;
299
- const flags = cmpMeta.$flags$;
300
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
301
- const scopeId = addStyle(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
302
- if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
303
- // only required when we're NOT using native shadow dom (slot)
304
- // or this browser doesn't support native shadow dom
305
- // and this host element was NOT created with SSR
306
- // let's pick out the inner content for slot projection
307
- // create a node to represent where the original
308
- // content was first placed, which is useful later on
309
- // DOM WRITE!!
310
- elm['s-sc'] = scopeId;
311
- elm.classList.add(scopeId + '-h');
312
- if (BUILD.scoped && flags & 2 /* scopedCssEncapsulation */) {
313
- elm.classList.add(scopeId + '-s');
314
- }
315
- }
316
- endAttachStyles();
317
- };
318
- const getScopeId = (cmp, mode) => 'sc-' + (BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);
319
- const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
320
- // Private
321
- const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
322
- // Public
323
- const setMode = (handler) => modeResolutionChain.push(handler);
324
- const getMode = (ref) => getHostRef(ref).$modeName$;
325
- /**
326
- * Default style mode id
327
- */
328
- /**
329
- * Reusable empty obj/array
330
- * Don't add values to these!!
331
- */
332
- const EMPTY_OBJ = {};
333
- /**
334
- * Namespaces
335
- */
336
- const SVG_NS = 'http://www.w3.org/2000/svg';
337
- const HTML_NS = 'http://www.w3.org/1999/xhtml';
338
- const isDef = (v) => v != null;
339
- const isComplexType = (o) => {
340
- // https://jsperf.com/typeof-fn-object/5
341
- o = typeof o;
342
- return o === 'object' || o === 'function';
343
- };
344
- /**
345
- * Production h() function based on Preact by
346
- * Jason Miller (@developit)
347
- * Licensed under the MIT License
348
- * https://github.com/developit/preact/blob/master/LICENSE
349
- *
350
- * Modified for Stencil's compiler and vdom
351
- */
352
- // const stack: any[] = [];
353
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
354
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
355
- const h = (nodeName, vnodeData, ...children) => {
356
- let child = null;
357
- let key = null;
358
- let slotName = null;
359
- let simple = false;
360
- let lastSimple = false;
361
- const vNodeChildren = [];
362
- const walk = (c) => {
363
- for (let i = 0; i < c.length; i++) {
364
- child = c[i];
365
- if (Array.isArray(child)) {
366
- walk(child);
367
- }
368
- else if (child != null && typeof child !== 'boolean') {
369
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
370
- child = String(child);
371
- }
372
- else if (BUILD.isDev && typeof nodeName !== 'function' && child.$flags$ === undefined) {
373
- consoleDevError(`vNode passed as children has unexpected type.
374
- Make sure it's using the correct h() function.
375
- Empty objects can also be the cause, look for JSX comments that became objects.`);
376
- }
377
- if (simple && lastSimple) {
378
- // If the previous child was simple (string), we merge both
379
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
380
- }
381
- else {
382
- // Append a new vNode, if it's text, we create a text vNode
383
- vNodeChildren.push(simple ? newVNode(null, child) : child);
384
- }
385
- lastSimple = simple;
386
- }
387
- }
388
- };
389
- walk(children);
390
- if (vnodeData) {
391
- if (BUILD.isDev && nodeName === 'input') {
392
- validateInputProperties(vnodeData);
393
- }
394
- // normalize class / classname attributes
395
- if (BUILD.vdomKey && vnodeData.key) {
396
- key = vnodeData.key;
397
- }
398
- if (BUILD.slotRelocation && vnodeData.name) {
399
- slotName = vnodeData.name;
400
- }
401
- if (BUILD.vdomClass) {
402
- const classData = vnodeData.className || vnodeData.class;
403
- if (classData) {
404
- vnodeData.class =
405
- typeof classData !== 'object'
406
- ? classData
407
- : Object.keys(classData)
408
- .filter((k) => classData[k])
409
- .join(' ');
410
- }
411
- }
412
- }
413
- if (BUILD.isDev && vNodeChildren.some(isHost)) {
414
- consoleDevError(`The <Host> must be the single root component. Make sure:
415
- - You are NOT using hostData() and <Host> in the same component.
416
- - <Host> is used once, and it's the single root component of the render() function.`);
417
- }
418
- if (BUILD.vdomFunctional && typeof nodeName === 'function') {
419
- // nodeName is a functional component
420
- return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
421
- }
422
- const vnode = newVNode(nodeName, null);
423
- vnode.$attrs$ = vnodeData;
424
- if (vNodeChildren.length > 0) {
425
- vnode.$children$ = vNodeChildren;
426
- }
427
- if (BUILD.vdomKey) {
428
- vnode.$key$ = key;
429
- }
430
- if (BUILD.slotRelocation) {
431
- vnode.$name$ = slotName;
432
- }
433
- return vnode;
434
- };
435
- const newVNode = (tag, text) => {
436
- const vnode = {
437
- $flags$: 0,
438
- $tag$: tag,
439
- $text$: text,
440
- $elm$: null,
441
- $children$: null,
442
- };
443
- if (BUILD.vdomAttribute) {
444
- vnode.$attrs$ = null;
445
- }
446
- if (BUILD.vdomKey) {
447
- vnode.$key$ = null;
448
- }
449
- if (BUILD.slotRelocation) {
450
- vnode.$name$ = null;
451
- }
452
- return vnode;
453
- };
454
- const Host = {};
455
- const isHost = (node) => node && node.$tag$ === Host;
456
- const vdomFnUtils = {
457
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
458
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
459
- };
460
- const convertToPublic = (node) => ({
461
- vattrs: node.$attrs$,
462
- vchildren: node.$children$,
463
- vkey: node.$key$,
464
- vname: node.$name$,
465
- vtag: node.$tag$,
466
- vtext: node.$text$,
467
- });
468
- const convertToPrivate = (node) => {
469
- if (typeof node.vtag === 'function') {
470
- const vnodeData = Object.assign({}, node.vattrs);
471
- if (node.vkey) {
472
- vnodeData.key = node.vkey;
473
- }
474
- if (node.vname) {
475
- vnodeData.name = node.vname;
476
- }
477
- return h(node.vtag, vnodeData, ...(node.vchildren || []));
478
- }
479
- const vnode = newVNode(node.vtag, node.vtext);
480
- vnode.$attrs$ = node.vattrs;
481
- vnode.$children$ = node.vchildren;
482
- vnode.$key$ = node.vkey;
483
- vnode.$name$ = node.vname;
484
- return vnode;
485
- };
486
- /**
487
- * Validates the ordering of attributes on an input element
488
- * @param inputElm the element to validate
489
- */
490
- const validateInputProperties = (inputElm) => {
491
- const props = Object.keys(inputElm);
492
- const value = props.indexOf('value');
493
- if (value === -1) {
494
- return;
495
- }
496
- const typeIndex = props.indexOf('type');
497
- const minIndex = props.indexOf('min');
498
- const maxIndex = props.indexOf('max');
499
- const stepIndex = props.indexOf('step');
500
- if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
501
- consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
502
- }
503
- };
504
- /**
505
- * Production setAccessor() function based on Preact by
506
- * Jason Miller (@developit)
507
- * Licensed under the MIT License
508
- * https://github.com/developit/preact/blob/master/LICENSE
509
- *
510
- * Modified for Stencil's compiler and vdom
511
- */
512
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
513
- if (oldValue !== newValue) {
514
- let isProp = isMemberInElement(elm, memberName);
515
- let ln = memberName.toLowerCase();
516
- if (BUILD.vdomClass && memberName === 'class') {
517
- const classList = elm.classList;
518
- const oldClasses = parseClassList(oldValue);
519
- const newClasses = parseClassList(newValue);
520
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
521
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
522
- }
523
- else if (BUILD.vdomStyle && memberName === 'style') {
524
- // update style attribute, css properties and values
525
- if (BUILD.updatable) {
526
- for (const prop in oldValue) {
527
- if (!newValue || newValue[prop] == null) {
528
- if (!BUILD.hydrateServerSide && prop.includes('-')) {
529
- elm.style.removeProperty(prop);
530
- }
531
- else {
532
- elm.style[prop] = '';
533
- }
534
- }
535
- }
536
- }
537
- for (const prop in newValue) {
538
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
539
- if (!BUILD.hydrateServerSide && prop.includes('-')) {
540
- elm.style.setProperty(prop, newValue[prop]);
541
- }
542
- else {
543
- elm.style[prop] = newValue[prop];
544
- }
545
- }
546
- }
547
- }
548
- else if (BUILD.vdomKey && memberName === 'key')
549
- ;
550
- else if (BUILD.vdomRef && memberName === 'ref') {
551
- // minifier will clean this up
552
- if (newValue) {
553
- newValue(elm);
554
- }
555
- }
556
- else if (BUILD.vdomListener &&
557
- (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
558
- memberName[0] === 'o' &&
559
- memberName[1] === 'n') {
560
- // Event Handlers
561
- // so if the member name starts with "on" and the 3rd characters is
562
- // a capital letter, and it's not already a member on the element,
563
- // then we're assuming it's an event listener
564
- if (memberName[2] === '-') {
565
- // on- prefixed events
566
- // allows to be explicit about the dom event to listen without any magic
567
- // under the hood:
568
- // <my-cmp on-click> // listens for "click"
569
- // <my-cmp on-Click> // listens for "Click"
570
- // <my-cmp on-ionChange> // listens for "ionChange"
571
- // <my-cmp on-EVENTS> // listens for "EVENTS"
572
- memberName = memberName.slice(3);
573
- }
574
- else if (isMemberInElement(win, ln)) {
575
- // standard event
576
- // the JSX attribute could have been "onMouseOver" and the
577
- // member name "onmouseover" is on the window's prototype
578
- // so let's add the listener "mouseover", which is all lowercased
579
- memberName = ln.slice(2);
580
- }
581
- else {
582
- // custom event
583
- // the JSX attribute could have been "onMyCustomEvent"
584
- // so let's trim off the "on" prefix and lowercase the first character
585
- // and add the listener "myCustomEvent"
586
- // except for the first character, we keep the event name case
587
- memberName = ln[2] + memberName.slice(3);
588
- }
589
- if (oldValue) {
590
- plt.rel(elm, memberName, oldValue, false);
591
- }
592
- if (newValue) {
593
- plt.ael(elm, memberName, newValue, false);
594
- }
595
- }
596
- else if (BUILD.vdomPropOrAttr) {
597
- // Set property if it exists and it's not a SVG
598
- const isComplex = isComplexType(newValue);
599
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
600
- try {
601
- if (!elm.tagName.includes('-')) {
602
- const n = newValue == null ? '' : newValue;
603
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
604
- if (memberName === 'list') {
605
- isProp = false;
606
- }
607
- else if (oldValue == null || elm[memberName] != n) {
608
- elm[memberName] = n;
609
- }
610
- }
611
- else {
612
- elm[memberName] = newValue;
613
- }
614
- }
615
- catch (e) { }
616
- }
617
- /**
618
- * Need to manually update attribute if:
619
- * - memberName is not an attribute
620
- * - if we are rendering the host element in order to reflect attribute
621
- * - if it's a SVG, since properties might not work in <svg>
622
- * - if the newValue is null/undefined or 'false'.
623
- */
624
- let xlink = false;
625
- if (BUILD.vdomXlink) {
626
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
627
- memberName = ln;
628
- xlink = true;
629
- }
630
- }
631
- if (newValue == null || newValue === false) {
632
- if (newValue !== false || elm.getAttribute(memberName) === '') {
633
- if (BUILD.vdomXlink && xlink) {
634
- elm.removeAttributeNS(XLINK_NS, memberName);
635
- }
636
- else {
637
- elm.removeAttribute(memberName);
638
- }
639
- }
640
- }
641
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
642
- newValue = newValue === true ? '' : newValue;
643
- if (BUILD.vdomXlink && xlink) {
644
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
645
- }
646
- else {
647
- elm.setAttribute(memberName, newValue);
648
- }
649
- }
650
- }
651
- }
652
- };
653
- const parseClassListRegex = /\s/;
654
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
655
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
656
- // if the element passed in is a shadow root, which is a document fragment
657
- // then we want to be adding attrs/props to the shadow root's "host" element
658
- // if it's not a shadow root, then we add attrs/props to the same element
659
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
660
- ? newVnode.$elm$.host
661
- : newVnode.$elm$;
662
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
663
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
664
- if (BUILD.updatable) {
665
- // remove attributes no longer present on the vnode by setting them to undefined
666
- for (memberName in oldVnodeAttrs) {
667
- if (!(memberName in newVnodeAttrs)) {
668
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
669
- }
670
- }
671
- }
672
- // add new & update changed attributes
673
- for (memberName in newVnodeAttrs) {
674
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
675
- }
676
- };
677
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
678
- // tslint:disable-next-line: prefer-const
679
- const newVNode = newParentVNode.$children$[childIndex];
680
- let i = 0;
681
- let elm;
682
- let childNode;
683
- let oldVNode;
684
- if (BUILD.slotRelocation && !useNativeShadowDom) {
685
- // remember for later we need to check to relocate nodes
686
- checkSlotRelocate = true;
687
- if (newVNode.$tag$ === 'slot') {
688
- if (scopeId) {
689
- // scoped css needs to add its scoped id to the parent element
690
- parentElm.classList.add(scopeId + '-s');
691
- }
692
- newVNode.$flags$ |= newVNode.$children$
693
- ? // slot element has fallback content
694
- 2 /* isSlotFallback */
695
- : // slot element does not have fallback content
696
- 1 /* isSlotReference */;
697
- }
698
- }
699
- if (BUILD.isDev && newVNode.$elm$) {
700
- consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${newVNode.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
701
- }
702
- if (BUILD.vdomText && newVNode.$text$ !== null) {
703
- // create text node
704
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
705
- }
706
- else if (BUILD.slotRelocation && newVNode.$flags$ & 1 /* isSlotReference */) {
707
- // create a slot reference node
708
- elm = newVNode.$elm$ =
709
- BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : doc.createTextNode('');
710
- }
711
- else {
712
- if (BUILD.svg && !isSvgMode) {
713
- isSvgMode = newVNode.$tag$ === 'svg';
714
- }
715
- // create element
716
- elm = newVNode.$elm$ = (BUILD.svg
717
- ? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* isSlotFallback */
718
- ? 'slot-fb'
719
- : newVNode.$tag$)
720
- : doc.createElement(BUILD.slotRelocation && newVNode.$flags$ & 2 /* isSlotFallback */
721
- ? 'slot-fb'
722
- : newVNode.$tag$));
723
- if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {
724
- isSvgMode = false;
725
- }
726
- // add css classes, attrs, props, listeners, etc.
727
- if (BUILD.vdomAttribute) {
728
- updateElement(null, newVNode, isSvgMode);
729
- }
730
- if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm['s-si'] !== scopeId) {
731
- // if there is a scopeId and this is the initial render
732
- // then let's add the scopeId as a css class
733
- elm.classList.add((elm['s-si'] = scopeId));
734
- }
735
- if (newVNode.$children$) {
736
- for (i = 0; i < newVNode.$children$.length; ++i) {
737
- // create the node
738
- childNode = createElm(oldParentVNode, newVNode, i, elm);
739
- // return node could have been null
740
- if (childNode) {
741
- // append our new node
742
- elm.appendChild(childNode);
743
- }
744
- }
745
- }
746
- if (BUILD.svg) {
747
- if (newVNode.$tag$ === 'svg') {
748
- // Only reset the SVG context when we're exiting <svg> element
749
- isSvgMode = false;
750
- }
751
- else if (elm.tagName === 'foreignObject') {
752
- // Reenter SVG context when we're exiting <foreignObject> element
753
- isSvgMode = true;
754
- }
755
- }
756
- }
757
- if (BUILD.slotRelocation) {
758
- elm['s-hn'] = hostTagName;
759
- if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
760
- // remember the content reference comment
761
- elm['s-sr'] = true;
762
- // remember the content reference comment
763
- elm['s-cr'] = contentRef;
764
- // remember the slot name, or empty string for default slot
765
- elm['s-sn'] = newVNode.$name$ || '';
766
- // check if we've got an old vnode for this slot
767
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
768
- if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
769
- // we've got an old slot vnode and the wrapper is being replaced
770
- // so let's move the old slot content back to it's original location
771
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
772
- }
773
- }
774
- }
775
- return elm;
776
- };
777
- const putBackInOriginalLocation = (parentElm, recursive) => {
778
- plt.$flags$ |= 1 /* isTmpDisconnected */;
779
- const oldSlotChildNodes = parentElm.childNodes;
780
- for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
781
- const childNode = oldSlotChildNodes[i];
782
- if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
783
- // // this child node in the old element is from another component
784
- // // remove this node from the old slot's parent
785
- // childNode.remove();
786
- // and relocate it back to it's original location
787
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
788
- // remove the old original location comment entirely
789
- // later on the patch function will know what to do
790
- // and move this to the correct spot in need be
791
- childNode['s-ol'].remove();
792
- childNode['s-ol'] = undefined;
793
- checkSlotRelocate = true;
794
- }
795
- if (recursive) {
796
- putBackInOriginalLocation(childNode, recursive);
797
- }
798
- }
799
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
800
- };
801
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
802
- let containerElm = ((BUILD.slotRelocation && parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
803
- let childNode;
804
- if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
805
- containerElm = containerElm.shadowRoot;
806
- }
807
- for (; startIdx <= endIdx; ++startIdx) {
808
- if (vnodes[startIdx]) {
809
- childNode = createElm(null, parentVNode, startIdx, parentElm);
810
- if (childNode) {
811
- vnodes[startIdx].$elm$ = childNode;
812
- containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before);
813
- }
814
- }
815
- }
816
- };
817
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
818
- for (; startIdx <= endIdx; ++startIdx) {
819
- if ((vnode = vnodes[startIdx])) {
820
- elm = vnode.$elm$;
821
- callNodeRefs(vnode);
822
- if (BUILD.slotRelocation) {
823
- // we're removing this element
824
- // so it's possible we need to show slot fallback content now
825
- checkSlotFallbackVisibility = true;
826
- if (elm['s-ol']) {
827
- // remove the original location comment
828
- elm['s-ol'].remove();
829
- }
830
- else {
831
- // it's possible that child nodes of the node
832
- // that's being removed are slot nodes
833
- putBackInOriginalLocation(elm, true);
834
- }
835
- }
836
- // remove the vnode's element from the dom
837
- elm.remove();
838
- }
839
- }
840
- };
841
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
842
- let oldStartIdx = 0;
843
- let newStartIdx = 0;
844
- let idxInOld = 0;
845
- let i = 0;
846
- let oldEndIdx = oldCh.length - 1;
847
- let oldStartVnode = oldCh[0];
848
- let oldEndVnode = oldCh[oldEndIdx];
849
- let newEndIdx = newCh.length - 1;
850
- let newStartVnode = newCh[0];
851
- let newEndVnode = newCh[newEndIdx];
852
- let node;
853
- let elmToMove;
854
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
855
- if (oldStartVnode == null) {
856
- // Vnode might have been moved left
857
- oldStartVnode = oldCh[++oldStartIdx];
858
- }
859
- else if (oldEndVnode == null) {
860
- oldEndVnode = oldCh[--oldEndIdx];
861
- }
862
- else if (newStartVnode == null) {
863
- newStartVnode = newCh[++newStartIdx];
864
- }
865
- else if (newEndVnode == null) {
866
- newEndVnode = newCh[--newEndIdx];
867
- }
868
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
869
- patch(oldStartVnode, newStartVnode);
870
- oldStartVnode = oldCh[++oldStartIdx];
871
- newStartVnode = newCh[++newStartIdx];
872
- }
873
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
874
- patch(oldEndVnode, newEndVnode);
875
- oldEndVnode = oldCh[--oldEndIdx];
876
- newEndVnode = newCh[--newEndIdx];
877
- }
878
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
879
- // Vnode moved right
880
- if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
881
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
882
- }
883
- patch(oldStartVnode, newEndVnode);
884
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
885
- oldStartVnode = oldCh[++oldStartIdx];
886
- newEndVnode = newCh[--newEndIdx];
887
- }
888
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
889
- // Vnode moved left
890
- if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
891
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
892
- }
893
- patch(oldEndVnode, newStartVnode);
894
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
895
- oldEndVnode = oldCh[--oldEndIdx];
896
- newStartVnode = newCh[++newStartIdx];
897
- }
898
- else {
899
- // createKeyToOldIdx
900
- idxInOld = -1;
901
- if (BUILD.vdomKey) {
902
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
903
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
904
- idxInOld = i;
905
- break;
906
- }
907
- }
908
- }
909
- if (BUILD.vdomKey && idxInOld >= 0) {
910
- elmToMove = oldCh[idxInOld];
911
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
912
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
913
- }
914
- else {
915
- patch(elmToMove, newStartVnode);
916
- oldCh[idxInOld] = undefined;
917
- node = elmToMove.$elm$;
918
- }
919
- newStartVnode = newCh[++newStartIdx];
920
- }
921
- else {
922
- // new element
923
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
924
- newStartVnode = newCh[++newStartIdx];
925
- }
926
- if (node) {
927
- if (BUILD.slotRelocation) {
928
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
929
- }
930
- else {
931
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
932
- }
933
- }
934
- }
935
- }
936
- if (oldStartIdx > oldEndIdx) {
937
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
938
- }
939
- else if (BUILD.updatable && newStartIdx > newEndIdx) {
940
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
941
- }
942
- };
943
- const isSameVnode = (vnode1, vnode2) => {
944
- // compare if two vnode to see if they're "technically" the same
945
- // need to have the same element tag, and same key to be the same
946
- if (vnode1.$tag$ === vnode2.$tag$) {
947
- if (BUILD.slotRelocation && vnode1.$tag$ === 'slot') {
948
- return vnode1.$name$ === vnode2.$name$;
949
- }
950
- if (BUILD.vdomKey) {
951
- return vnode1.$key$ === vnode2.$key$;
952
- }
953
- return true;
954
- }
955
- return false;
956
- };
957
- const referenceNode = (node) => {
958
- // this node was relocated to a new location in the dom
959
- // because of some other component's slot
960
- // but we still have an html comment in place of where
961
- // it's original location was according to it's original vdom
962
- return (node && node['s-ol']) || node;
963
- };
964
- const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
965
- const patch = (oldVNode, newVNode) => {
966
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
967
- const oldChildren = oldVNode.$children$;
968
- const newChildren = newVNode.$children$;
969
- const tag = newVNode.$tag$;
970
- const text = newVNode.$text$;
971
- let defaultHolder;
972
- if (!BUILD.vdomText || text === null) {
973
- if (BUILD.svg) {
974
- // test if we're rendering an svg element, or still rendering nodes inside of one
975
- // only add this to the when the compiler sees we're using an svg somewhere
976
- isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
977
- }
978
- // element node
979
- if (BUILD.vdomAttribute || BUILD.reflect) {
980
- if (BUILD.slot && tag === 'slot')
981
- ;
982
- else {
983
- // either this is the first render of an element OR it's an update
984
- // AND we already know it's possible it could have changed
985
- // this updates the element's css classes, attrs, props, listeners, etc.
986
- updateElement(oldVNode, newVNode, isSvgMode);
987
- }
988
- }
989
- if (BUILD.updatable && oldChildren !== null && newChildren !== null) {
990
- // looks like there's child vnodes for both the old and new vnodes
991
- updateChildren(elm, oldChildren, newVNode, newChildren);
992
- }
993
- else if (newChildren !== null) {
994
- // no old child vnodes, but there are new child vnodes to add
995
- if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) {
996
- // the old vnode was text, so be sure to clear it out
997
- elm.textContent = '';
998
- }
999
- // add the new vnode children
1000
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1001
- }
1002
- else if (BUILD.updatable && oldChildren !== null) {
1003
- // no new child vnodes, but there are old child vnodes to remove
1004
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
1005
- }
1006
- if (BUILD.svg && isSvgMode && tag === 'svg') {
1007
- isSvgMode = false;
1008
- }
1009
- }
1010
- else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm['s-cr'])) {
1011
- // this element has slotted content
1012
- defaultHolder.parentNode.textContent = text;
1013
- }
1014
- else if (BUILD.vdomText && oldVNode.$text$ !== text) {
1015
- // update the text content for the text only vnode
1016
- // and also only if the text is different than before
1017
- elm.data = text;
1018
- }
1019
- };
1020
- const updateFallbackSlotVisibility = (elm) => {
1021
- // tslint:disable-next-line: prefer-const
1022
- const childNodes = elm.childNodes;
1023
- let childNode;
1024
- let i;
1025
- let ilen;
1026
- let j;
1027
- let slotNameAttr;
1028
- let nodeType;
1029
- for (i = 0, ilen = childNodes.length; i < ilen; i++) {
1030
- childNode = childNodes[i];
1031
- if (childNode.nodeType === 1 /* ElementNode */) {
1032
- if (childNode['s-sr']) {
1033
- // this is a slot fallback node
1034
- // get the slot name for this slot reference node
1035
- slotNameAttr = childNode['s-sn'];
1036
- // by default always show a fallback slot node
1037
- // then hide it if there are other slots in the light dom
1038
- childNode.hidden = false;
1039
- for (j = 0; j < ilen; j++) {
1040
- nodeType = childNodes[j].nodeType;
1041
- if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
1042
- // this sibling node is from a different component OR is a named fallback slot node
1043
- if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
1044
- childNode.hidden = true;
1045
- break;
1046
- }
1047
- }
1048
- else {
1049
- // this is a default fallback slot node
1050
- // any element or text node (with content)
1051
- // should hide the default fallback slot node
1052
- if (nodeType === 1 /* ElementNode */ ||
1053
- (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
1054
- childNode.hidden = true;
1055
- break;
1056
- }
1057
- }
1058
- }
1059
- }
1060
- // keep drilling down
1061
- updateFallbackSlotVisibility(childNode);
1062
- }
1063
- }
1064
- };
1065
- const relocateNodes = [];
1066
- const relocateSlotContent = (elm) => {
1067
- // tslint:disable-next-line: prefer-const
1068
- let childNode;
1069
- let node;
1070
- let hostContentNodes;
1071
- let slotNameAttr;
1072
- let relocateNodeData;
1073
- let j;
1074
- let i = 0;
1075
- const childNodes = elm.childNodes;
1076
- const ilen = childNodes.length;
1077
- for (; i < ilen; i++) {
1078
- childNode = childNodes[i];
1079
- if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1080
- // first got the content reference comment node
1081
- // then we got it's parent, which is where all the host content is in now
1082
- hostContentNodes = node.parentNode.childNodes;
1083
- slotNameAttr = childNode['s-sn'];
1084
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
1085
- node = hostContentNodes[j];
1086
- if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
1087
- // let's do some relocating to its new home
1088
- // but never relocate a content reference node
1089
- // that is suppose to always represent the original content location
1090
- if (isNodeLocatedInSlot(node, slotNameAttr)) {
1091
- // it's possible we've already decided to relocate this node
1092
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1093
- // made some changes to slots
1094
- // let's make sure we also double check
1095
- // fallbacks are correctly hidden or shown
1096
- checkSlotFallbackVisibility = true;
1097
- node['s-sn'] = node['s-sn'] || slotNameAttr;
1098
- if (relocateNodeData) {
1099
- // previously we never found a slot home for this node
1100
- // but turns out we did, so let's remember it now
1101
- relocateNodeData.$slotRefNode$ = childNode;
1102
- }
1103
- else {
1104
- // add to our list of nodes to relocate
1105
- relocateNodes.push({
1106
- $slotRefNode$: childNode,
1107
- $nodeToRelocate$: node,
1108
- });
1109
- }
1110
- if (node['s-sr']) {
1111
- relocateNodes.map((relocateNode) => {
1112
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1113
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1114
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
1115
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1116
- }
1117
- }
1118
- });
1119
- }
1120
- }
1121
- else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1122
- // so far this element does not have a slot home, not setting slotRefNode on purpose
1123
- // if we never find a home for this element then we'll need to hide it
1124
- relocateNodes.push({
1125
- $nodeToRelocate$: node,
1126
- });
1127
- }
1128
- }
1129
- }
1130
- }
1131
- if (childNode.nodeType === 1 /* ElementNode */) {
1132
- relocateSlotContent(childNode);
1133
- }
1134
- }
1135
- };
1136
- const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
1137
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1138
- if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
1139
- return true;
1140
- }
1141
- if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
1142
- return true;
1143
- }
1144
- return false;
1145
- }
1146
- if (nodeToRelocate['s-sn'] === slotNameAttr) {
1147
- return true;
1148
- }
1149
- return slotNameAttr === '';
1150
- };
1151
- const callNodeRefs = (vNode) => {
1152
- if (BUILD.vdomRef) {
1153
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1154
- vNode.$children$ && vNode.$children$.map(callNodeRefs);
1155
- }
1156
- };
1157
- const renderVdom = (hostRef, renderFnResults) => {
1158
- const hostElm = hostRef.$hostElement$;
1159
- const cmpMeta = hostRef.$cmpMeta$;
1160
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1161
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1162
- hostTagName = hostElm.tagName;
1163
- // <Host> runtime check
1164
- if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1165
- throw new Error(`The <Host> must be the single root component.
1166
- Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1167
-
1168
- The render() function should look like this instead:
1169
-
1170
- render() {
1171
- // Do not return an array
1172
- return (
1173
- <Host>{content}</Host>
1174
- );
1175
- }
1176
- `);
1177
- }
1178
- if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
1179
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1180
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1181
- }
1182
- rootVnode.$tag$ = null;
1183
- rootVnode.$flags$ |= 4 /* isHost */;
1184
- hostRef.$vnode$ = rootVnode;
1185
- rootVnode.$elm$ = oldVNode.$elm$ = (BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm);
1186
- if (BUILD.scoped || BUILD.shadowDom) {
1187
- scopeId = hostElm['s-sc'];
1188
- }
1189
- if (BUILD.slotRelocation) {
1190
- contentRef = hostElm['s-cr'];
1191
- useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1192
- // always reset
1193
- checkSlotFallbackVisibility = false;
1194
- }
1195
- // synchronous patch
1196
- patch(oldVNode, rootVnode);
1197
- if (BUILD.slotRelocation) {
1198
- // while we're moving nodes around existing nodes, temporarily disable
1199
- // the disconnectCallback from working
1200
- plt.$flags$ |= 1 /* isTmpDisconnected */;
1201
- if (checkSlotRelocate) {
1202
- relocateSlotContent(rootVnode.$elm$);
1203
- let relocateData;
1204
- let nodeToRelocate;
1205
- let orgLocationNode;
1206
- let parentNodeRef;
1207
- let insertBeforeNode;
1208
- let refNode;
1209
- let i = 0;
1210
- for (; i < relocateNodes.length; i++) {
1211
- relocateData = relocateNodes[i];
1212
- nodeToRelocate = relocateData.$nodeToRelocate$;
1213
- if (!nodeToRelocate['s-ol']) {
1214
- // add a reference node marking this node's original location
1215
- // keep a reference to this node for later lookups
1216
- orgLocationNode =
1217
- BUILD.isDebug || BUILD.hydrateServerSide
1218
- ? originalLocationDebugNode(nodeToRelocate)
1219
- : doc.createTextNode('');
1220
- orgLocationNode['s-nr'] = nodeToRelocate;
1221
- nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1222
- }
1223
- }
1224
- for (i = 0; i < relocateNodes.length; i++) {
1225
- relocateData = relocateNodes[i];
1226
- nodeToRelocate = relocateData.$nodeToRelocate$;
1227
- if (relocateData.$slotRefNode$) {
1228
- // by default we're just going to insert it directly
1229
- // after the slot reference node
1230
- parentNodeRef = relocateData.$slotRefNode$.parentNode;
1231
- insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
1232
- orgLocationNode = nodeToRelocate['s-ol'];
1233
- while ((orgLocationNode = orgLocationNode.previousSibling)) {
1234
- refNode = orgLocationNode['s-nr'];
1235
- if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1236
- refNode = refNode.nextSibling;
1237
- if (!refNode || !refNode['s-nr']) {
1238
- insertBeforeNode = refNode;
1239
- break;
1240
- }
1241
- }
1242
- }
1243
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1244
- nodeToRelocate.nextSibling !== insertBeforeNode) {
1245
- // we've checked that it's worth while to relocate
1246
- // since that the node to relocate
1247
- // has a different next sibling or parent relocated
1248
- if (nodeToRelocate !== insertBeforeNode) {
1249
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1250
- // probably a component in the index.html that doesn't have it's hostname set
1251
- nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1252
- }
1253
- // add it back to the dom but in its new home
1254
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1255
- }
1256
- }
1257
- }
1258
- else {
1259
- // this node doesn't have a slot home to go to, so let's hide it
1260
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1261
- nodeToRelocate.hidden = true;
1262
- }
1263
- }
1264
- }
1265
- }
1266
- if (checkSlotFallbackVisibility) {
1267
- updateFallbackSlotVisibility(rootVnode.$elm$);
1268
- }
1269
- // done moving nodes around
1270
- // allow the disconnect callback to work again
1271
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1272
- // always reset
1273
- relocateNodes.length = 0;
1274
- }
1275
- };
1276
- // slot comment debug nodes only created with the `--debug` flag
1277
- // otherwise these nodes are text nodes w/out content
1278
- const slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ''}> (host=${hostTagName.toLowerCase()})`);
1279
- const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
1280
- (nodeToRelocate.localName
1281
- ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate['s-hn']})`
1282
- : `[${nodeToRelocate.textContent}]`));
1283
- const getElement = (ref) => (BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref);
1284
- const createEvent = (ref, name, flags) => {
1285
- const elm = getElement(ref);
1286
- return {
1287
- emit: (detail) => {
1288
- if (BUILD.isDev && !elm.isConnected) {
1289
- consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
1290
- }
1291
- return emitEvent(elm, name, {
1292
- bubbles: !!(flags & 4 /* Bubbles */),
1293
- composed: !!(flags & 2 /* Composed */),
1294
- cancelable: !!(flags & 1 /* Cancellable */),
1295
- detail,
1296
- });
1297
- },
1298
- };
1299
- };
1300
- /**
1301
- * Helper function to create & dispatch a custom Event on a provided target
1302
- * @param elm the target of the Event
1303
- * @param name the name to give the custom Event
1304
- * @param opts options for configuring a custom Event
1305
- * @returns the custom Event
1306
- */
1307
- const emitEvent = (elm, name, opts) => {
1308
- const ev = plt.ce(name, opts);
1309
- elm.dispatchEvent(ev);
1310
- return ev;
1311
- };
1312
- const attachToAncestor = (hostRef, ancestorComponent) => {
1313
- if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1314
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1315
- }
1316
- };
1317
- const scheduleUpdate = (hostRef, isInitialLoad) => {
1318
- if (BUILD.taskQueue && BUILD.updatable) {
1319
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1320
- }
1321
- if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1322
- hostRef.$flags$ |= 512 /* needsRerender */;
1323
- return;
1324
- }
1325
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1326
- // there is no ancestor component or the ancestor component
1327
- // has already fired off its lifecycle update then
1328
- // fire off the initial update
1329
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1330
- return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
1331
- };
1332
- const dispatchHooks = (hostRef, isInitialLoad) => {
1333
- const elm = hostRef.$hostElement$;
1334
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1335
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
1336
- let promise;
1337
- if (isInitialLoad) {
1338
- if (BUILD.lazyLoad && BUILD.hostListener) {
1339
- hostRef.$flags$ |= 256 /* isListenReady */;
1340
- if (hostRef.$queuedListeners$) {
1341
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1342
- hostRef.$queuedListeners$ = null;
1343
- }
1344
- }
1345
- emitLifecycleEvent(elm, 'componentWillLoad');
1346
- if (BUILD.cmpWillLoad) {
1347
- promise = safeCall(instance, 'componentWillLoad');
1348
- }
1349
- }
1350
- else {
1351
- emitLifecycleEvent(elm, 'componentWillUpdate');
1352
- if (BUILD.cmpWillUpdate) {
1353
- promise = safeCall(instance, 'componentWillUpdate');
1354
- }
1355
- }
1356
- emitLifecycleEvent(elm, 'componentWillRender');
1357
- if (BUILD.cmpWillRender) {
1358
- promise = then(promise, () => safeCall(instance, 'componentWillRender'));
1359
- }
1360
- endSchedule();
1361
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
1362
- };
1363
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1364
- // updateComponent
1365
- const elm = hostRef.$hostElement$;
1366
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1367
- const rc = elm['s-rc'];
1368
- if (BUILD.style && isInitialLoad) {
1369
- // DOM WRITE!
1370
- attachStyles(hostRef);
1371
- }
1372
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1373
- if (BUILD.isDev) {
1374
- hostRef.$flags$ |= 1024 /* devOnRender */;
1375
- }
1376
- if (BUILD.hydrateServerSide) {
1377
- await callRender(hostRef, instance, elm);
1378
- }
1379
- else {
1380
- callRender(hostRef, instance, elm);
1381
- }
1382
- if (BUILD.cssVarShim && plt.$cssShim$) {
1383
- plt.$cssShim$.updateHost(elm);
1384
- }
1385
- if (BUILD.isDev) {
1386
- hostRef.$renderCount$++;
1387
- hostRef.$flags$ &= ~1024 /* devOnRender */;
1388
- }
1389
- if (BUILD.hydrateServerSide) {
1390
- try {
1391
- // manually connected child components during server-side hydrate
1392
- serverSideConnected(elm);
1393
- if (isInitialLoad) {
1394
- // using only during server-side hydrate
1395
- if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) {
1396
- elm['s-en'] = '';
1397
- }
1398
- else if (hostRef.$cmpMeta$.$flags$ & 2 /* scopedCssEncapsulation */) {
1399
- elm['s-en'] = 'c';
1400
- }
1401
- }
1402
- }
1403
- catch (e) {
1404
- consoleError(e, elm);
1405
- }
1406
- }
1407
- if (BUILD.asyncLoading && rc) {
1408
- // ok, so turns out there are some child host elements
1409
- // waiting on this parent element to load
1410
- // let's fire off all update callbacks waiting
1411
- rc.map((cb) => cb());
1412
- elm['s-rc'] = undefined;
1413
- }
1414
- endRender();
1415
- endUpdate();
1416
- if (BUILD.asyncLoading) {
1417
- const childrenPromises = elm['s-p'];
1418
- const postUpdate = () => postUpdateComponent(hostRef);
1419
- if (childrenPromises.length === 0) {
1420
- postUpdate();
1421
- }
1422
- else {
1423
- Promise.all(childrenPromises).then(postUpdate);
1424
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1425
- childrenPromises.length = 0;
1426
- }
1427
- }
1428
- else {
1429
- postUpdateComponent(hostRef);
1430
- }
1431
- };
1432
- const callRender = (hostRef, instance, elm) => {
1433
- // in order for bundlers to correctly treeshake the BUILD object
1434
- // we need to ensure BUILD is not deoptimized within a try/catch
1435
- // https://rollupjs.org/guide/en/#treeshake tryCatchDeoptimization
1436
- const allRenderFn = BUILD.allRenderFn ? true : false;
1437
- const lazyLoad = BUILD.lazyLoad ? true : false;
1438
- const taskQueue = BUILD.taskQueue ? true : false;
1439
- const updatable = BUILD.updatable ? true : false;
1440
- try {
1441
- renderingRef = instance;
1442
- instance = allRenderFn ? instance.render() : instance.render && instance.render();
1443
- if (updatable && taskQueue) {
1444
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1445
- }
1446
- if (updatable || lazyLoad) {
1447
- hostRef.$flags$ |= 2 /* hasRendered */;
1448
- }
1449
- if (BUILD.hasRenderFn || BUILD.reflect) {
1450
- if (BUILD.vdomRender || BUILD.reflect) {
1451
- // looks like we've got child nodes to render into this host element
1452
- // or we need to update the css class/attrs on the host element
1453
- // DOM WRITE!
1454
- if (BUILD.hydrateServerSide) {
1455
- return Promise.resolve(instance).then((value) => renderVdom(hostRef, value));
1456
- }
1457
- else {
1458
- renderVdom(hostRef, instance);
1459
- }
1460
- }
1461
- else {
1462
- elm.textContent = instance;
1463
- }
1464
- }
1465
- }
1466
- catch (e) {
1467
- consoleError(e, hostRef.$hostElement$);
1468
- }
1469
- renderingRef = null;
1470
- return null;
1471
- };
1472
- const getRenderingRef = () => renderingRef;
1473
- const postUpdateComponent = (hostRef) => {
1474
- const tagName = hostRef.$cmpMeta$.$tagName$;
1475
- const elm = hostRef.$hostElement$;
1476
- const endPostUpdate = createTime('postUpdate', tagName);
1477
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
1478
- const ancestorComponent = hostRef.$ancestorComponent$;
1479
- if (BUILD.cmpDidRender) {
1480
- if (BUILD.isDev) {
1481
- hostRef.$flags$ |= 1024 /* devOnRender */;
1482
- }
1483
- safeCall(instance, 'componentDidRender');
1484
- if (BUILD.isDev) {
1485
- hostRef.$flags$ &= ~1024 /* devOnRender */;
1486
- }
1487
- }
1488
- emitLifecycleEvent(elm, 'componentDidRender');
1489
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1490
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1491
- if (BUILD.asyncLoading && BUILD.cssAnnotations) {
1492
- // DOM WRITE!
1493
- addHydratedFlag(elm);
1494
- }
1495
- if (BUILD.cmpDidLoad) {
1496
- if (BUILD.isDev) {
1497
- hostRef.$flags$ |= 2048 /* devOnDidLoad */;
1498
- }
1499
- safeCall(instance, 'componentDidLoad');
1500
- if (BUILD.isDev) {
1501
- hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
1502
- }
1503
- }
1504
- emitLifecycleEvent(elm, 'componentDidLoad');
1505
- endPostUpdate();
1506
- if (BUILD.asyncLoading) {
1507
- hostRef.$onReadyResolve$(elm);
1508
- if (!ancestorComponent) {
1509
- appDidLoad(tagName);
1510
- }
1511
- }
1512
- }
1513
- else {
1514
- if (BUILD.cmpDidUpdate) {
1515
- // we've already loaded this component
1516
- // fire off the user's componentDidUpdate method (if one was provided)
1517
- // componentDidUpdate runs AFTER render() has been called
1518
- // and all child components have finished updating
1519
- if (BUILD.isDev) {
1520
- hostRef.$flags$ |= 1024 /* devOnRender */;
1521
- }
1522
- safeCall(instance, 'componentDidUpdate');
1523
- if (BUILD.isDev) {
1524
- hostRef.$flags$ &= ~1024 /* devOnRender */;
1525
- }
1526
- }
1527
- emitLifecycleEvent(elm, 'componentDidUpdate');
1528
- endPostUpdate();
1529
- }
1530
- if (BUILD.hotModuleReplacement) {
1531
- elm['s-hmr-load'] && elm['s-hmr-load']();
1532
- }
1533
- if (BUILD.method && BUILD.lazyLoad) {
1534
- hostRef.$onInstanceResolve$(elm);
1535
- }
1536
- // load events fire from bottom to top
1537
- // the deepest elements load first then bubbles up
1538
- if (BUILD.asyncLoading) {
1539
- if (hostRef.$onRenderResolve$) {
1540
- hostRef.$onRenderResolve$();
1541
- hostRef.$onRenderResolve$ = undefined;
1542
- }
1543
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1544
- nextTick(() => scheduleUpdate(hostRef, false));
1545
- }
1546
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1547
- }
1548
- // ( •_•)
1549
- // ( •_•)>⌐■-■
1550
- // (⌐■_■)
1551
- };
1552
- const forceUpdate = (ref) => {
1553
- if (BUILD.updatable) {
1554
- const hostRef = getHostRef(ref);
1555
- const isConnected = hostRef.$hostElement$.isConnected;
1556
- if (isConnected &&
1557
- (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1558
- scheduleUpdate(hostRef, false);
1559
- }
1560
- // Returns "true" when the forced update was successfully scheduled
1561
- return isConnected;
1562
- }
1563
- return false;
1564
- };
1565
- const appDidLoad = (who) => {
1566
- // on appload
1567
- // we have finish the first big initial render
1568
- if (BUILD.cssAnnotations) {
1569
- addHydratedFlag(doc.documentElement);
1570
- }
1571
- if (BUILD.asyncQueue) {
1572
- plt.$flags$ |= 2 /* appLoaded */;
1573
- }
1574
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1575
- if (BUILD.profile && performance.measure) {
1576
- performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, 'st:app:start');
1577
- }
1578
- };
1579
- const safeCall = (instance, method, arg) => {
1580
- if (instance && instance[method]) {
1581
- try {
1582
- return instance[method](arg);
1583
- }
1584
- catch (e) {
1585
- consoleError(e);
1586
- }
1587
- }
1588
- return undefined;
1589
- };
1590
- const then = (promise, thenFn) => {
1591
- return promise && promise.then ? promise.then(thenFn) : thenFn();
1592
- };
1593
- const emitLifecycleEvent = (elm, lifecycleName) => {
1594
- if (BUILD.lifecycleDOMEvents) {
1595
- emitEvent(elm, 'stencil_' + lifecycleName, {
1596
- bubbles: true,
1597
- composed: true,
1598
- detail: {
1599
- namespace: NAMESPACE,
1600
- },
1601
- });
1602
- }
1603
- };
1604
- const addHydratedFlag = (elm) => BUILD.hydratedClass
1605
- ? elm.classList.add('hydrated')
1606
- : BUILD.hydratedAttribute
1607
- ? elm.setAttribute('hydrated', '')
1608
- : undefined;
1609
- const serverSideConnected = (elm) => {
1610
- const children = elm.children;
1611
- if (children != null) {
1612
- for (let i = 0, ii = children.length; i < ii; i++) {
1613
- const childElm = children[i];
1614
- if (typeof childElm.connectedCallback === 'function') {
1615
- childElm.connectedCallback();
1616
- }
1617
- serverSideConnected(childElm);
1618
- }
1619
- }
1620
- };
1621
- const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1622
- const endHydrate = createTime('hydrateClient', tagName);
1623
- const shadowRoot = hostElm.shadowRoot;
1624
- const childRenderNodes = [];
1625
- const slotNodes = [];
1626
- const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;
1627
- const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
1628
- if (!plt.$orgLocNodes$) {
1629
- initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
1630
- }
1631
- hostElm[HYDRATE_ID] = hostId;
1632
- hostElm.removeAttribute(HYDRATE_ID);
1633
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
1634
- childRenderNodes.map((c) => {
1635
- const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
1636
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1637
- const node = c.$elm$;
1638
- if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
1639
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1640
- }
1641
- if (!shadowRoot) {
1642
- node['s-hn'] = tagName;
1643
- if (orgLocationNode) {
1644
- node['s-ol'] = orgLocationNode;
1645
- node['s-ol']['s-nr'] = node;
1646
- }
1647
- }
1648
- plt.$orgLocNodes$.delete(orgLocationId);
1649
- });
1650
- if (BUILD.shadowDom && shadowRoot) {
1651
- shadowRootNodes.map((shadowRootNode) => {
1652
- if (shadowRootNode) {
1653
- shadowRoot.appendChild(shadowRootNode);
1654
- }
1655
- });
1656
- }
1657
- endHydrate();
1658
- };
1659
- const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
1660
- let childNodeType;
1661
- let childIdSplt;
1662
- let childVNode;
1663
- let i;
1664
- if (node.nodeType === 1 /* ElementNode */) {
1665
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
1666
- if (childNodeType) {
1667
- // got the node data from the element's attribute
1668
- // `${hostId}.${nodeId}.${depth}.${index}`
1669
- childIdSplt = childNodeType.split('.');
1670
- if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
1671
- childVNode = {
1672
- $flags$: 0,
1673
- $hostId$: childIdSplt[0],
1674
- $nodeId$: childIdSplt[1],
1675
- $depth$: childIdSplt[2],
1676
- $index$: childIdSplt[3],
1677
- $tag$: node.tagName.toLowerCase(),
1678
- $elm$: node,
1679
- $attrs$: null,
1680
- $children$: null,
1681
- $key$: null,
1682
- $name$: null,
1683
- $text$: null,
1684
- };
1685
- childRenderNodes.push(childVNode);
1686
- node.removeAttribute(HYDRATE_CHILD_ID);
1687
- // this is a new child vnode
1688
- // so ensure its parent vnode has the vchildren array
1689
- if (!parentVNode.$children$) {
1690
- parentVNode.$children$ = [];
1691
- }
1692
- // add our child vnode to a specific index of the vnode's children
1693
- parentVNode.$children$[childVNode.$index$] = childVNode;
1694
- // this is now the new parent vnode for all the next child checks
1695
- parentVNode = childVNode;
1696
- if (shadowRootNodes && childVNode.$depth$ === '0') {
1697
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1698
- }
1699
- }
1700
- }
1701
- // recursively drill down, end to start so we can remove nodes
1702
- for (i = node.childNodes.length - 1; i >= 0; i--) {
1703
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
1704
- }
1705
- if (node.shadowRoot) {
1706
- // keep drilling down through the shadow root nodes
1707
- for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
1708
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
1709
- }
1710
- }
1711
- }
1712
- else if (node.nodeType === 8 /* CommentNode */) {
1713
- // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
1714
- childIdSplt = node.nodeValue.split('.');
1715
- if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
1716
- // comment node for either the host id or a 0 host id
1717
- childNodeType = childIdSplt[0];
1718
- childVNode = {
1719
- $flags$: 0,
1720
- $hostId$: childIdSplt[1],
1721
- $nodeId$: childIdSplt[2],
1722
- $depth$: childIdSplt[3],
1723
- $index$: childIdSplt[4],
1724
- $elm$: node,
1725
- $attrs$: null,
1726
- $children$: null,
1727
- $key$: null,
1728
- $name$: null,
1729
- $tag$: null,
1730
- $text$: null,
1731
- };
1732
- if (childNodeType === TEXT_NODE_ID) {
1733
- childVNode.$elm$ = node.nextSibling;
1734
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
1735
- childVNode.$text$ = childVNode.$elm$.textContent;
1736
- childRenderNodes.push(childVNode);
1737
- // remove the text comment since it's no longer needed
1738
- node.remove();
1739
- if (!parentVNode.$children$) {
1740
- parentVNode.$children$ = [];
1741
- }
1742
- parentVNode.$children$[childVNode.$index$] = childVNode;
1743
- if (shadowRootNodes && childVNode.$depth$ === '0') {
1744
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1745
- }
1746
- }
1747
- }
1748
- else if (childVNode.$hostId$ === hostId) {
1749
- // this comment node is specifcally for this host id
1750
- if (childNodeType === SLOT_NODE_ID) {
1751
- // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
1752
- childVNode.$tag$ = 'slot';
1753
- if (childIdSplt[5]) {
1754
- node['s-sn'] = childVNode.$name$ = childIdSplt[5];
1755
- }
1756
- else {
1757
- node['s-sn'] = '';
1758
- }
1759
- node['s-sr'] = true;
1760
- if (BUILD.shadowDom && shadowRootNodes) {
1761
- // browser support shadowRoot and this is a shadow dom component
1762
- // create an actual slot element
1763
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
1764
- if (childVNode.$name$) {
1765
- // add the slot name attribute
1766
- childVNode.$elm$.setAttribute('name', childVNode.$name$);
1767
- }
1768
- // insert the new slot element before the slot comment
1769
- node.parentNode.insertBefore(childVNode.$elm$, node);
1770
- // remove the slot comment since it's not needed for shadow
1771
- node.remove();
1772
- if (childVNode.$depth$ === '0') {
1773
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1774
- }
1775
- }
1776
- slotNodes.push(childVNode);
1777
- if (!parentVNode.$children$) {
1778
- parentVNode.$children$ = [];
1779
- }
1780
- parentVNode.$children$[childVNode.$index$] = childVNode;
1781
- }
1782
- else if (childNodeType === CONTENT_REF_ID) {
1783
- // `${CONTENT_REF_ID}.${hostId}`;
1784
- if (BUILD.shadowDom && shadowRootNodes) {
1785
- // remove the content ref comment since it's not needed for shadow
1786
- node.remove();
1787
- }
1788
- else if (BUILD.slotRelocation) {
1789
- hostElm['s-cr'] = node;
1790
- node['s-cn'] = true;
1791
- }
1792
- }
1793
- }
1794
- }
1795
- }
1796
- else if (parentVNode && parentVNode.$tag$ === 'style') {
1797
- const vnode = newVNode(null, node.textContent);
1798
- vnode.$elm$ = node;
1799
- vnode.$index$ = '0';
1800
- parentVNode.$children$ = [vnode];
1801
- }
1802
- };
1803
- const initializeDocumentHydrate = (node, orgLocNodes) => {
1804
- if (node.nodeType === 1 /* ElementNode */) {
1805
- let i = 0;
1806
- for (; i < node.childNodes.length; i++) {
1807
- initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
1808
- }
1809
- if (node.shadowRoot) {
1810
- for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
1811
- initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
1812
- }
1813
- }
1814
- }
1815
- else if (node.nodeType === 8 /* CommentNode */) {
1816
- const childIdSplt = node.nodeValue.split('.');
1817
- if (childIdSplt[0] === ORG_LOCATION_ID) {
1818
- orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
1819
- node.nodeValue = '';
1820
- // useful to know if the original location is
1821
- // the root light-dom of a shadow dom component
1822
- node['s-en'] = childIdSplt[3];
1823
- }
1824
- }
1825
- };
1826
- /**
1827
- * Parse a new property value for a given property type.
1828
- *
1829
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
1830
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
1831
- * 1. `any`, the type given to `propValue` in the function signature
1832
- * 2. the type stored from `propType`.
1833
- *
1834
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
1835
- *
1836
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
1837
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
1838
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
1839
- * ```tsx
1840
- * <my-cmp prop-val={0}></my-cmp>
1841
- * ```
1842
- *
1843
- * HTML prop values on the other hand, will always a string
1844
- *
1845
- * @param propValue the new value to coerce to some type
1846
- * @param propType the type of the prop, expressed as a binary number
1847
- * @returns the parsed/coerced value
1848
- */
1849
- const parsePropertyValue = (propValue, propType) => {
1850
- // ensure this value is of the correct prop type
1851
- if (propValue != null && !isComplexType(propValue)) {
1852
- if (BUILD.propBoolean && propType & 4 /* Boolean */) {
1853
- // per the HTML spec, any string value means it is a boolean true value
1854
- // but we'll cheat here and say that the string "false" is the boolean false
1855
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1856
- }
1857
- if (BUILD.propNumber && propType & 2 /* Number */) {
1858
- // force it to be a number
1859
- return parseFloat(propValue);
1860
- }
1861
- if (BUILD.propString && propType & 1 /* String */) {
1862
- // could have been passed as a number or boolean
1863
- // but we still want it as a string
1864
- return String(propValue);
1865
- }
1866
- // redundant return here for better minification
1867
- return propValue;
1868
- }
1869
- // not sure exactly what type we want
1870
- // so no need to change to a different type
1871
- return propValue;
1872
- };
1873
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1874
- const setValue = (ref, propName, newVal, cmpMeta) => {
1875
- // check our new property value against our internal value
1876
- const hostRef = getHostRef(ref);
1877
- const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
1878
- const oldVal = hostRef.$instanceValues$.get(propName);
1879
- const flags = hostRef.$flags$;
1880
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
1881
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1882
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1883
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1884
- const didValueChange = newVal !== oldVal && !areBothNaN;
1885
- if ((!BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1886
- // gadzooks! the property's value has changed!!
1887
- // set our new value!
1888
- hostRef.$instanceValues$.set(propName, newVal);
1889
- if (BUILD.isDev) {
1890
- if (hostRef.$flags$ & 1024 /* devOnRender */) {
1891
- consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
1892
- }
1893
- else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) {
1894
- consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
1895
- }
1896
- }
1897
- if (!BUILD.lazyLoad || instance) {
1898
- // get an array of method names of watch functions to call
1899
- if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1900
- const watchMethods = cmpMeta.$watchers$[propName];
1901
- if (watchMethods) {
1902
- // this instance is watching for when this property changed
1903
- watchMethods.map((watchMethodName) => {
1904
- try {
1905
- // fire off each of the watch methods that are watching this property
1906
- instance[watchMethodName](newVal, oldVal, propName);
1907
- }
1908
- catch (e) {
1909
- consoleError(e, elm);
1910
- }
1911
- });
1912
- }
1913
- }
1914
- if (BUILD.updatable &&
1915
- (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1916
- if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
1917
- if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1918
- return;
1919
- }
1920
- }
1921
- // looks like this value actually changed, so we've got work to do!
1922
- // but only if we've already rendered, otherwise just chill out
1923
- // queue that we need to do an update, but don't worry about queuing
1924
- // up millions cuz this function ensures it only runs once
1925
- scheduleUpdate(hostRef, false);
1926
- }
1927
- }
1928
- }
1929
- };
1930
- const proxyComponent = (Cstr, cmpMeta, flags) => {
1931
- if (BUILD.member && cmpMeta.$members$) {
1932
- if (BUILD.watchCallback && Cstr.watchers) {
1933
- cmpMeta.$watchers$ = Cstr.watchers;
1934
- }
1935
- // It's better to have a const than two Object.entries()
1936
- const members = Object.entries(cmpMeta.$members$);
1937
- const prototype = Cstr.prototype;
1938
- members.map(([memberName, [memberFlags]]) => {
1939
- if ((BUILD.prop || BUILD.state) &&
1940
- (memberFlags & 31 /* Prop */ ||
1941
- ((!BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1942
- // proxyComponent - prop
1943
- Object.defineProperty(prototype, memberName, {
1944
- get() {
1945
- // proxyComponent, get value
1946
- return getValue(this, memberName);
1947
- },
1948
- set(newValue) {
1949
- // only during dev time
1950
- if (BUILD.isDev) {
1951
- const ref = getHostRef(this);
1952
- if (
1953
- // we are proxying the instance (not element)
1954
- (flags & 1 /* isElementConstructor */) === 0 &&
1955
- // the element is not constructing
1956
- (ref.$flags$ & 8 /* isConstructingInstance */) === 0 &&
1957
- // the member is a prop
1958
- (memberFlags & 31 /* Prop */) !== 0 &&
1959
- // the member is not mutable
1960
- (memberFlags & 1024 /* Mutable */) === 0) {
1961
- consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
1962
- }
1963
- }
1964
- // proxyComponent, set value
1965
- setValue(this, memberName, newValue, cmpMeta);
1966
- },
1967
- configurable: true,
1968
- enumerable: true,
1969
- });
1970
- }
1971
- else if (BUILD.lazyLoad &&
1972
- BUILD.method &&
1973
- flags & 1 /* isElementConstructor */ &&
1974
- memberFlags & 64 /* Method */) {
1975
- // proxyComponent - method
1976
- Object.defineProperty(prototype, memberName, {
1977
- value(...args) {
1978
- const ref = getHostRef(this);
1979
- return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
1980
- },
1981
- });
1982
- }
1983
- });
1984
- if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1 /* isElementConstructor */)) {
1985
- const attrNameToPropName = new Map();
1986
- prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1987
- plt.jmp(() => {
1988
- const propName = attrNameToPropName.get(attrName);
1989
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1990
- // in the case where an attribute was set inline.
1991
- // ```html
1992
- // <my-component some-attribute="some-value"></my-component>
1993
- // ```
1994
- //
1995
- // There is an edge case where a developer sets the attribute inline on a custom element and then
1996
- // programmatically changes it before it has been upgraded as shown below:
1997
- //
1998
- // ```html
1999
- // <!-- this component has _not_ been upgraded yet -->
2000
- // <my-component id="test" some-attribute="some-value"></my-component>
2001
- // <script>
2002
- // // grab non-upgraded component
2003
- // el = document.querySelector("#test");
2004
- // el.someAttribute = "another-value";
2005
- // // upgrade component
2006
- // customElements.define('my-component', MyComponent);
2007
- // </script>
2008
- // ```
2009
- // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
2010
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
2011
- // to the value that was set inline i.e. "some-value" from above example. When
2012
- // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
2013
- //
2014
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
2015
- // by connectedCallback as this attributeChangedCallback will not fire.
2016
- //
2017
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2018
- //
2019
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
2020
- // properties here given that this goes against best practices outlined here
2021
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
2022
- if (this.hasOwnProperty(propName)) {
2023
- newValue = this[propName];
2024
- delete this[propName];
2025
- }
2026
- else if (prototype.hasOwnProperty(propName) &&
2027
- typeof this[propName] === 'number' &&
2028
- this[propName] == newValue) {
2029
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
2030
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
2031
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
2032
- return;
2033
- }
2034
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
2035
- });
2036
- };
2037
- // create an array of attributes to observe
2038
- // and also create a map of html attribute name to js property name
2039
- Cstr.observedAttributes = members
2040
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
2041
- .map(([propName, m]) => {
2042
- const attrName = m[1] || propName;
2043
- attrNameToPropName.set(attrName, propName);
2044
- if (BUILD.reflect && m[0] & 512 /* ReflectAttr */) {
2045
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
2046
- }
2047
- return attrName;
2048
- });
2049
- }
2050
- }
2051
- return Cstr;
2052
- };
2053
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
2054
- // initializeComponent
2055
- if ((BUILD.lazyLoad || BUILD.hydrateServerSide || BUILD.style) &&
2056
- (hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
2057
- if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
2058
- // we haven't initialized this element yet
2059
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
2060
- // lazy loaded components
2061
- // request the component's implementation to be
2062
- // wired up with the host element
2063
- Cstr = loadModule(cmpMeta, hostRef, hmrVersionId);
2064
- if (Cstr.then) {
2065
- // Await creates a micro-task avoid if possible
2066
- const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`);
2067
- Cstr = await Cstr;
2068
- endLoad();
2069
- }
2070
- if ((BUILD.isDev || BUILD.isDebug) && !Cstr) {
2071
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2072
- }
2073
- if (BUILD.member && !Cstr.isProxied) {
2074
- // we've never proxied this Constructor before
2075
- // let's add the getters/setters to its prototype before
2076
- // the first time we create an instance of the implementation
2077
- if (BUILD.watchCallback) {
2078
- cmpMeta.$watchers$ = Cstr.watchers;
2079
- }
2080
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
2081
- Cstr.isProxied = true;
2082
- }
2083
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
2084
- // ok, time to construct the instance
2085
- // but let's keep track of when we start and stop
2086
- // so that the getters/setters don't incorrectly step on data
2087
- if (BUILD.member) {
2088
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
2089
- }
2090
- // construct the lazy-loaded component implementation
2091
- // passing the hostRef is very important during
2092
- // construction in order to directly wire together the
2093
- // host element and the lazy-loaded instance
2094
- try {
2095
- new Cstr(hostRef);
2096
- }
2097
- catch (e) {
2098
- consoleError(e);
2099
- }
2100
- if (BUILD.member) {
2101
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
2102
- }
2103
- if (BUILD.watchCallback) {
2104
- hostRef.$flags$ |= 128 /* isWatchReady */;
2105
- }
2106
- endNewInstance();
2107
- fireConnectedCallback(hostRef.$lazyInstance$);
2108
- }
2109
- else {
2110
- // sync constructor component
2111
- Cstr = elm.constructor;
2112
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
2113
- // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
2114
- // watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
2115
- // Stencil has completed instantiating the component.
2116
- customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* isWatchReady */));
2117
- }
2118
- if (BUILD.style && Cstr.style) {
2119
- // this component has styles but we haven't registered them yet
2120
- let style = Cstr.style;
2121
- if (BUILD.mode && typeof style !== 'string') {
2122
- style = style[(hostRef.$modeName$ = computeMode(elm))];
2123
- if (BUILD.hydrateServerSide && hostRef.$modeName$) {
2124
- elm.setAttribute('s-mode', hostRef.$modeName$);
2125
- }
2126
- }
2127
- const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
2128
- if (!styles.has(scopeId)) {
2129
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2130
- if (!BUILD.hydrateServerSide &&
2131
- BUILD.shadowDom &&
2132
- BUILD.shadowDomShim &&
2133
- cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2134
- style = await import('./shadow-css-1257b266.js').then((m) => m.scopeCss(style, scopeId, false));
2135
- }
2136
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
2137
- endRegisterStyles();
2138
- }
2139
- }
2140
- }
2141
- // we've successfully created a lazy instance
2142
- const ancestorComponent = hostRef.$ancestorComponent$;
2143
- const schedule = () => scheduleUpdate(hostRef, true);
2144
- if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {
2145
- // this is the initial load and this component it has an ancestor component
2146
- // but the ancestor component has NOT fired its will update lifecycle yet
2147
- // so let's just cool our jets and wait for the ancestor to continue first
2148
- // this will get fired off when the ancestor component
2149
- // finally gets around to rendering its lazy self
2150
- // fire off the initial update
2151
- ancestorComponent['s-rc'].push(schedule);
2152
- }
2153
- else {
2154
- schedule();
2155
- }
2156
- };
2157
- const fireConnectedCallback = (instance) => {
2158
- if (BUILD.lazyLoad && BUILD.connectedCallback) {
2159
- safeCall(instance, 'connectedCallback');
2160
- }
2161
- };
2162
- const connectedCallback = (elm) => {
2163
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2164
- const hostRef = getHostRef(elm);
2165
- const cmpMeta = hostRef.$cmpMeta$;
2166
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2167
- if (BUILD.hostListenerTargetParent) {
2168
- // only run if we have listeners being attached to a parent
2169
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2170
- }
2171
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2172
- // first time this component has connected
2173
- hostRef.$flags$ |= 1 /* hasConnected */;
2174
- let hostId;
2175
- if (BUILD.hydrateClientSide) {
2176
- hostId = elm.getAttribute(HYDRATE_ID);
2177
- if (hostId) {
2178
- if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2179
- const scopeId = BUILD.mode
2180
- ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))
2181
- : addStyle(elm.shadowRoot, cmpMeta);
2182
- elm.classList.remove(scopeId + '-h', scopeId + '-s');
2183
- }
2184
- initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2185
- }
2186
- }
2187
- if (BUILD.slotRelocation && !hostId) {
2188
- // initUpdate
2189
- // if the slot polyfill is required we'll need to put some nodes
2190
- // in here to act as original content anchors as we move nodes around
2191
- // host element has been connected to the DOM
2192
- if (BUILD.hydrateServerSide ||
2193
- ((BUILD.slot || BUILD.shadowDom) &&
2194
- cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
2195
- setContentReference(elm);
2196
- }
2197
- }
2198
- if (BUILD.asyncLoading) {
2199
- // find the first ancestor component (if there is one) and register
2200
- // this component as one of the actively loading child components for its ancestor
2201
- let ancestorComponent = elm;
2202
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2203
- // climb up the ancestors looking for the first
2204
- // component that hasn't finished its lifecycle update yet
2205
- if ((BUILD.hydrateClientSide &&
2206
- ancestorComponent.nodeType === 1 /* ElementNode */ &&
2207
- ancestorComponent.hasAttribute('s-id') &&
2208
- ancestorComponent['s-p']) ||
2209
- ancestorComponent['s-p']) {
2210
- // we found this components first ancestor component
2211
- // keep a reference to this component's ancestor component
2212
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
2213
- break;
2214
- }
2215
- }
2216
- }
2217
- // Lazy properties
2218
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2219
- if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
2220
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2221
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
2222
- const value = elm[memberName];
2223
- delete elm[memberName];
2224
- elm[memberName] = value;
2225
- }
2226
- });
2227
- }
2228
- if (BUILD.initializeNextTick) {
2229
- // connectedCallback, taskQueue, initialLoad
2230
- // angular sets attribute AFTER connectCallback
2231
- // https://github.com/angular/angular/issues/18909
2232
- // https://github.com/angular/angular/issues/19940
2233
- nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2234
- }
2235
- else {
2236
- initializeComponent(elm, hostRef, cmpMeta);
2237
- }
2238
- }
2239
- else {
2240
- // not the first time this has connected
2241
- // reattach any event listeners to the host
2242
- // since they would have been removed when disconnected
2243
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
2244
- // fire off connectedCallback() on component instance
2245
- fireConnectedCallback(hostRef.$lazyInstance$);
2246
- }
2247
- endConnected();
2248
- }
2249
- };
2250
- const setContentReference = (elm) => {
2251
- // only required when we're NOT using native shadow dom (slot)
2252
- // or this browser doesn't support native shadow dom
2253
- // and this host element was NOT created with SSR
2254
- // let's pick out the inner content for slot projection
2255
- // create a node to represent where the original
2256
- // content was first placed, which is useful later on
2257
- const contentRefElm = (elm['s-cr'] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : ''));
2258
- contentRefElm['s-cn'] = true;
2259
- elm.insertBefore(contentRefElm, elm.firstChild);
2260
- };
2261
- const disconnectedCallback = (elm) => {
2262
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2263
- const hostRef = getHostRef(elm);
2264
- const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2265
- if (BUILD.hostListener) {
2266
- if (hostRef.$rmListeners$) {
2267
- hostRef.$rmListeners$.map((rmListener) => rmListener());
2268
- hostRef.$rmListeners$ = undefined;
2269
- }
2270
- }
2271
- // clear CSS var-shim tracking
2272
- if (BUILD.cssVarShim && plt.$cssShim$) {
2273
- plt.$cssShim$.removeHost(elm);
2274
- }
2275
- if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
2276
- safeCall(instance, 'disconnectedCallback');
2277
- }
2278
- if (BUILD.cmpDidUnload) {
2279
- safeCall(instance, 'componentDidUnload');
2280
- }
2281
- }
2282
- };
2283
- const defineCustomElement = (Cstr, compactMeta) => {
2284
- customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
2285
- };
2286
- const proxyCustomElement = (Cstr, compactMeta) => {
2287
- const cmpMeta = {
2288
- $flags$: compactMeta[0],
2289
- $tagName$: compactMeta[1],
2290
- };
2291
- if (BUILD.member) {
2292
- cmpMeta.$members$ = compactMeta[2];
2293
- }
2294
- if (BUILD.hostListener) {
2295
- cmpMeta.$listeners$ = compactMeta[3];
2296
- }
2297
- if (BUILD.watchCallback) {
2298
- cmpMeta.$watchers$ = Cstr.$watchers$;
2299
- }
2300
- if (BUILD.reflect) {
2301
- cmpMeta.$attrsToReflect$ = [];
2302
- }
2303
- if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2304
- cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2305
- }
2306
- const originalConnectedCallback = Cstr.prototype.connectedCallback;
2307
- const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
2308
- Object.assign(Cstr.prototype, {
2309
- __registerHost() {
2310
- registerHost(this, cmpMeta);
2311
- },
2312
- connectedCallback() {
2313
- connectedCallback(this);
2314
- if (BUILD.connectedCallback && originalConnectedCallback) {
2315
- originalConnectedCallback.call(this);
2316
- }
2317
- },
2318
- disconnectedCallback() {
2319
- disconnectedCallback(this);
2320
- if (BUILD.disconnectedCallback && originalDisconnectedCallback) {
2321
- originalDisconnectedCallback.call(this);
2322
- }
2323
- },
2324
- __attachShadow() {
2325
- if (supportsShadow) {
2326
- if (BUILD.shadowDelegatesFocus) {
2327
- this.attachShadow({
2328
- mode: 'open',
2329
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */),
2330
- });
2331
- }
2332
- else {
2333
- this.attachShadow({ mode: 'open' });
2334
- }
2335
- }
2336
- else {
2337
- this.shadowRoot = this;
2338
- }
2339
- },
2340
- });
2341
- Cstr.is = cmpMeta.$tagName$;
2342
- return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
2343
- };
2344
- const forceModeUpdate = (elm) => {
2345
- if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
2346
- const mode = computeMode(elm);
2347
- const hostRef = getHostRef(elm);
2348
- if (hostRef.$modeName$ !== mode) {
2349
- const cmpMeta = hostRef.$cmpMeta$;
2350
- const oldScopeId = elm['s-sc'];
2351
- const scopeId = getScopeId(cmpMeta, mode);
2352
- const style = elm.constructor.style[mode];
2353
- const flags = cmpMeta.$flags$;
2354
- if (style) {
2355
- if (!styles.has(scopeId)) {
2356
- registerStyle(scopeId, style, !!(flags & 1 /* shadowDomEncapsulation */));
2357
- }
2358
- hostRef.$modeName$ = mode;
2359
- elm.classList.remove(oldScopeId + '-h', oldScopeId + '-s');
2360
- attachStyles(hostRef);
2361
- forceUpdate(elm);
2362
- }
2363
- }
2364
- }
2365
- };
2366
- const hmrStart = (elm, cmpMeta, hmrVersionId) => {
2367
- // ¯\_(ツ)_/¯
2368
- const hostRef = getHostRef(elm);
2369
- // reset state flags to only have been connected
2370
- hostRef.$flags$ = 1 /* hasConnected */;
2371
- // TODO
2372
- // detatch any event listeners that may have been added
2373
- // because we're not passing an exact event name it'll
2374
- // remove all of this element's event, which is good
2375
- // create a callback for when this component finishes hmr
2376
- elm['s-hmr-load'] = () => {
2377
- // finished hmr for this element
2378
- delete elm['s-hmr-load'];
2379
- };
2380
- // re-initialize the component
2381
- initializeComponent(elm, hostRef, cmpMeta, hmrVersionId);
2382
- };
2383
- const patchCloneNode = (HostElementPrototype) => {
2384
- const orgCloneNode = HostElementPrototype.cloneNode;
2385
- HostElementPrototype.cloneNode = function (deep) {
2386
- const srcNode = this;
2387
- const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2388
- const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2389
- if (BUILD.slot && !isShadowDom && deep) {
2390
- let i = 0;
2391
- let slotted, nonStencilNode;
2392
- const stencilPrivates = [
2393
- 's-id',
2394
- 's-cr',
2395
- 's-lr',
2396
- 's-rc',
2397
- 's-sc',
2398
- 's-p',
2399
- 's-cn',
2400
- 's-sr',
2401
- 's-sn',
2402
- 's-hn',
2403
- 's-ol',
2404
- 's-nr',
2405
- 's-si',
2406
- ];
2407
- for (; i < srcNode.childNodes.length; i++) {
2408
- slotted = srcNode.childNodes[i]['s-nr'];
2409
- nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);
2410
- if (slotted) {
2411
- if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {
2412
- clonedNode.__appendChild(slotted.cloneNode(true));
2413
- }
2414
- else {
2415
- clonedNode.appendChild(slotted.cloneNode(true));
2416
- }
2417
- }
2418
- if (nonStencilNode) {
2419
- clonedNode.appendChild(srcNode.childNodes[i].cloneNode(true));
2420
- }
2421
- }
2422
- }
2423
- return clonedNode;
2424
- };
2425
- };
2426
- const patchSlotAppendChild = (HostElementPrototype) => {
2427
- HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2428
- HostElementPrototype.appendChild = function (newChild) {
2429
- const slotName = (newChild['s-sn'] = getSlotName(newChild));
2430
- const slotNode = getHostSlotNode(this.childNodes, slotName);
2431
- if (slotNode) {
2432
- const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2433
- const appendAfter = slotChildNodes[slotChildNodes.length - 1];
2434
- return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
2435
- }
2436
- return this.__appendChild(newChild);
2437
- };
2438
- };
2439
- /**
2440
- * Patches the text content of an unnamed slotted node inside a scoped component
2441
- * @param hostElementPrototype the `Element` to be patched
2442
- * @param cmpMeta component runtime metadata used to determine if the component should be patched or not
2443
- */
2444
- const patchTextContent = (hostElementPrototype, cmpMeta) => {
2445
- if (BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2446
- const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
2447
- Object.defineProperty(hostElementPrototype, '__textContent', descriptor);
2448
- Object.defineProperty(hostElementPrototype, 'textContent', {
2449
- get() {
2450
- var _a;
2451
- // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
2452
- // the empty string
2453
- const slotNode = getHostSlotNode(this.childNodes, '');
2454
- // when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how
2455
- // nodes were reordered during the vdom render. first try to get the text content from the sibling.
2456
- if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
2457
- return slotNode.nextSibling.textContent;
2458
- }
2459
- else if (slotNode) {
2460
- return slotNode.textContent;
2461
- }
2462
- else {
2463
- // fallback to the original implementation
2464
- return this.__textContent;
2465
- }
2466
- },
2467
- set(value) {
2468
- var _a;
2469
- // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
2470
- // the empty string
2471
- const slotNode = getHostSlotNode(this.childNodes, '');
2472
- // when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,
2473
- // depending on how nodes were reordered during the vdom render. first try to set the text content on the
2474
- // sibling.
2475
- if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
2476
- slotNode.nextSibling.textContent = value;
2477
- }
2478
- else if (slotNode) {
2479
- slotNode.textContent = value;
2480
- }
2481
- else {
2482
- // we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM
2483
- // loaded, we could have missed it. check for a content reference element on the scoped component and insert
2484
- // it there
2485
- this.__textContent = value;
2486
- const contentRefElm = this['s-cr'];
2487
- if (contentRefElm) {
2488
- this.insertBefore(contentRefElm, this.firstChild);
2489
- }
2490
- }
2491
- },
2492
- });
2493
- }
2494
- };
2495
- const patchChildSlotNodes = (elm, cmpMeta) => {
2496
- class FakeNodeList extends Array {
2497
- item(n) {
2498
- return this[n];
2499
- }
2500
- }
2501
- if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2502
- const childNodesFn = elm.__lookupGetter__('childNodes');
2503
- Object.defineProperty(elm, 'children', {
2504
- get() {
2505
- return this.childNodes.map((n) => n.nodeType === 1);
2506
- },
2507
- });
2508
- Object.defineProperty(elm, 'childElementCount', {
2509
- get() {
2510
- return elm.children.length;
2511
- },
2512
- });
2513
- Object.defineProperty(elm, 'childNodes', {
2514
- get() {
2515
- const childNodes = childNodesFn.call(this);
2516
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 &&
2517
- getHostRef(this).$flags$ & 2 /* hasRendered */) {
2518
- const result = new FakeNodeList();
2519
- for (let i = 0; i < childNodes.length; i++) {
2520
- const slot = childNodes[i]['s-nr'];
2521
- if (slot) {
2522
- result.push(slot);
2523
- }
2524
- }
2525
- return result;
2526
- }
2527
- return FakeNodeList.from(childNodes);
2528
- },
2529
- });
2530
- }
2531
- };
2532
- const getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';
2533
- /**
2534
- * Recursively searches a series of child nodes for a slot with the provided name.
2535
- * @param childNodes the nodes to search for a slot with a specific name.
2536
- * @param slotName the name of the slot to match on.
2537
- * @returns a reference to the slot node that matches the provided name, `null` otherwise
2538
- */
2539
- const getHostSlotNode = (childNodes, slotName) => {
2540
- let i = 0;
2541
- let childNode;
2542
- for (; i < childNodes.length; i++) {
2543
- childNode = childNodes[i];
2544
- if (childNode['s-sr'] && childNode['s-sn'] === slotName) {
2545
- return childNode;
2546
- }
2547
- childNode = getHostSlotNode(childNode.childNodes, slotName);
2548
- if (childNode) {
2549
- return childNode;
2550
- }
2551
- }
2552
- return null;
2553
- };
2554
- const getHostSlotChildNodes = (n, slotName) => {
2555
- const childNodes = [n];
2556
- while ((n = n.nextSibling) && n['s-sn'] === slotName) {
2557
- childNodes.push(n);
2558
- }
2559
- return childNodes;
2560
- };
2561
- const bootstrapLazy = (lazyBundles, options = {}) => {
2562
- if (BUILD.profile && performance.mark) {
2563
- performance.mark('st:app:start');
2564
- }
2565
- installDevTools();
2566
- const endBootstrap = createTime('bootstrapLazy');
2567
- const cmpTags = [];
2568
- const exclude = options.exclude || [];
2569
- const customElements = win.customElements;
2570
- const head = doc.head;
2571
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
2572
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
2573
- const deferredConnectedCallbacks = [];
2574
- const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2575
- let appLoadFallback;
2576
- let isBootstrapping = true;
2577
- let i = 0;
2578
- Object.assign(plt, options);
2579
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2580
- if (BUILD.asyncQueue) {
2581
- if (options.syncQueue) {
2582
- plt.$flags$ |= 4 /* queueSync */;
2583
- }
2584
- }
2585
- if (BUILD.hydrateClientSide) {
2586
- // If the app is already hydrated there is not point to disable the
2587
- // async queue. This will improve the first input delay
2588
- plt.$flags$ |= 2 /* appLoaded */;
2589
- }
2590
- if (BUILD.hydrateClientSide && BUILD.shadowDom) {
2591
- for (; i < styles.length; i++) {
2592
- registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
2593
- }
2594
- }
2595
- lazyBundles.map((lazyBundle) => {
2596
- lazyBundle[1].map((compactMeta) => {
2597
- const cmpMeta = {
2598
- $flags$: compactMeta[0],
2599
- $tagName$: compactMeta[1],
2600
- $members$: compactMeta[2],
2601
- $listeners$: compactMeta[3],
2602
- };
2603
- if (BUILD.member) {
2604
- cmpMeta.$members$ = compactMeta[2];
2605
- }
2606
- if (BUILD.hostListener) {
2607
- cmpMeta.$listeners$ = compactMeta[3];
2608
- }
2609
- if (BUILD.reflect) {
2610
- cmpMeta.$attrsToReflect$ = [];
2611
- }
2612
- if (BUILD.watchCallback) {
2613
- cmpMeta.$watchers$ = {};
2614
- }
2615
- if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2616
- cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2617
- }
2618
- const tagName = BUILD.transformTagName && options.transformTagName
2619
- ? options.transformTagName(cmpMeta.$tagName$)
2620
- : cmpMeta.$tagName$;
2621
- const HostElement = class extends HTMLElement {
2622
- // StencilLazyHost
2623
- constructor(self) {
2624
- // @ts-ignore
2625
- super(self);
2626
- self = this;
2627
- registerHost(self, cmpMeta);
2628
- if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2629
- // this component is using shadow dom
2630
- // and this browser supports shadow dom
2631
- // add the read-only property "shadowRoot" to the host element
2632
- // adding the shadow root build conditionals to minimize runtime
2633
- if (supportsShadow) {
2634
- if (BUILD.shadowDelegatesFocus) {
2635
- self.attachShadow({
2636
- mode: 'open',
2637
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */),
2638
- });
2639
- }
2640
- else {
2641
- self.attachShadow({ mode: 'open' });
2642
- }
2643
- }
2644
- else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
2645
- self.shadowRoot = self;
2646
- }
2647
- }
2648
- if (BUILD.slotChildNodesFix) {
2649
- patchChildSlotNodes(self, cmpMeta);
2650
- }
2651
- }
2652
- connectedCallback() {
2653
- if (appLoadFallback) {
2654
- clearTimeout(appLoadFallback);
2655
- appLoadFallback = null;
2656
- }
2657
- if (isBootstrapping) {
2658
- // connectedCallback will be processed once all components have been registered
2659
- deferredConnectedCallbacks.push(this);
2660
- }
2661
- else {
2662
- plt.jmp(() => connectedCallback(this));
2663
- }
2664
- }
2665
- disconnectedCallback() {
2666
- plt.jmp(() => disconnectedCallback(this));
2667
- }
2668
- componentOnReady() {
2669
- return getHostRef(this).$onReadyPromise$;
2670
- }
2671
- };
2672
- if (BUILD.cloneNodeFix) {
2673
- patchCloneNode(HostElement.prototype);
2674
- }
2675
- if (BUILD.appendChildSlotFix) {
2676
- patchSlotAppendChild(HostElement.prototype);
2677
- }
2678
- if (BUILD.hotModuleReplacement) {
2679
- HostElement.prototype['s-hmr'] = function (hmrVersionId) {
2680
- hmrStart(this, cmpMeta, hmrVersionId);
2681
- };
2682
- }
2683
- if (BUILD.scopedSlotTextContentFix) {
2684
- patchTextContent(HostElement.prototype, cmpMeta);
2685
- }
2686
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
2687
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2688
- cmpTags.push(tagName);
2689
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
2690
- }
2691
- });
2692
- });
2693
- if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
2694
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
2695
- visibilityStyle.setAttribute('data-styles', '');
2696
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
2697
- }
2698
- // Process deferred connectedCallbacks now all components have been registered
2699
- isBootstrapping = false;
2700
- if (deferredConnectedCallbacks.length) {
2701
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
2702
- }
2703
- else {
2704
- if (BUILD.profile) {
2705
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));
2706
- }
2707
- else {
2708
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2709
- }
2710
- }
2711
- // Fallback appLoad event
2712
- endBootstrap();
2713
- };
2714
- const getAssetPath = (path) => {
2715
- const assetUrl = new URL(path, plt.$resourcesUrl$);
2716
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
2717
- };
2718
- const setAssetPath = (path) => (plt.$resourcesUrl$ = path);
2719
- const getConnect = (_ref, tagName) => {
2720
- const componentOnReady = () => {
2721
- let elm = doc.querySelector(tagName);
2722
- if (!elm) {
2723
- elm = doc.createElement(tagName);
2724
- doc.body.appendChild(elm);
2725
- }
2726
- return typeof elm.componentOnReady === 'function' ? elm.componentOnReady() : Promise.resolve(elm);
2727
- };
2728
- const create = (...args) => {
2729
- return componentOnReady().then((el) => el.create(...args));
2730
- };
2731
- return {
2732
- create,
2733
- componentOnReady,
2734
- };
2735
- };
2736
- const getContext = (_elm, context) => {
2737
- if (context in Context) {
2738
- return Context[context];
2739
- }
2740
- else if (context === 'window') {
2741
- return win;
2742
- }
2743
- else if (context === 'document') {
2744
- return doc;
2745
- }
2746
- else if (context === 'isServer' || context === 'isPrerender') {
2747
- return BUILD.hydrateServerSide ? true : false;
2748
- }
2749
- else if (context === 'isClient') {
2750
- return BUILD.hydrateServerSide ? false : true;
2751
- }
2752
- else if (context === 'resourcesUrl' || context === 'publicPath') {
2753
- return getAssetPath('.');
2754
- }
2755
- else if (context === 'queue') {
2756
- return {
2757
- write: writeTask,
2758
- read: readTask,
2759
- tick: {
2760
- then(cb) {
2761
- return nextTick(cb);
2762
- },
2763
- },
2764
- };
2765
- }
2766
- return undefined;
2767
- };
2768
- const insertVdomAnnotations = (doc, staticComponents) => {
2769
- if (doc != null) {
2770
- const docData = {
2771
- hostIds: 0,
2772
- rootLevelIds: 0,
2773
- staticComponents: new Set(staticComponents),
2774
- };
2775
- const orgLocationNodes = [];
2776
- parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
2777
- orgLocationNodes.forEach((orgLocationNode) => {
2778
- if (orgLocationNode != null) {
2779
- const nodeRef = orgLocationNode['s-nr'];
2780
- let hostId = nodeRef['s-host-id'];
2781
- let nodeId = nodeRef['s-node-id'];
2782
- let childId = `${hostId}.${nodeId}`;
2783
- if (hostId == null) {
2784
- hostId = 0;
2785
- docData.rootLevelIds++;
2786
- nodeId = docData.rootLevelIds;
2787
- childId = `${hostId}.${nodeId}`;
2788
- if (nodeRef.nodeType === 1 /* ElementNode */) {
2789
- nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
2790
- }
2791
- else if (nodeRef.nodeType === 3 /* TextNode */) {
2792
- if (hostId === 0) {
2793
- const textContent = nodeRef.nodeValue.trim();
2794
- if (textContent === '') {
2795
- // useless whitespace node at the document root
2796
- orgLocationNode.remove();
2797
- return;
2798
- }
2799
- }
2800
- const commentBeforeTextNode = doc.createComment(childId);
2801
- commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
2802
- nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
2803
- }
2804
- }
2805
- let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
2806
- const orgLocationParentNode = orgLocationNode.parentElement;
2807
- if (orgLocationParentNode) {
2808
- if (orgLocationParentNode['s-en'] === '') {
2809
- // ending with a "." means that the parent element
2810
- // of this node's original location is a SHADOW dom element
2811
- // and this node is apart of the root level light dom
2812
- orgLocationNodeId += `.`;
2813
- }
2814
- else if (orgLocationParentNode['s-en'] === 'c') {
2815
- // ending with a ".c" means that the parent element
2816
- // of this node's original location is a SCOPED element
2817
- // and this node is apart of the root level light dom
2818
- orgLocationNodeId += `.c`;
2819
- }
2820
- }
2821
- orgLocationNode.nodeValue = orgLocationNodeId;
2822
- }
2823
- });
2824
- }
2825
- };
2826
- const parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
2827
- if (node == null) {
2828
- return;
2829
- }
2830
- if (node['s-nr'] != null) {
2831
- orgLocationNodes.push(node);
2832
- }
2833
- if (node.nodeType === 1 /* ElementNode */) {
2834
- node.childNodes.forEach((childNode) => {
2835
- const hostRef = getHostRef(childNode);
2836
- if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
2837
- const cmpData = {
2838
- nodeIds: 0,
2839
- };
2840
- insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);
2841
- }
2842
- parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);
2843
- });
2844
- }
2845
- };
2846
- const insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
2847
- if (vnode != null) {
2848
- const hostId = ++docData.hostIds;
2849
- hostElm.setAttribute(HYDRATE_ID, hostId);
2850
- if (hostElm['s-cr'] != null) {
2851
- hostElm['s-cr'].nodeValue = `${CONTENT_REF_ID}.${hostId}`;
2852
- }
2853
- if (vnode.$children$ != null) {
2854
- const depth = 0;
2855
- vnode.$children$.forEach((vnodeChild, index) => {
2856
- insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);
2857
- });
2858
- }
2859
- if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute('c-id')) {
2860
- const parent = hostElm.parentElement;
2861
- if (parent && parent.childNodes) {
2862
- const parentChildNodes = Array.from(parent.childNodes);
2863
- const comment = parentChildNodes.find((node) => node.nodeType === 8 /* CommentNode */ && node['s-sr']);
2864
- if (comment) {
2865
- const index = parentChildNodes.indexOf(hostElm) - 1;
2866
- vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);
2867
- }
2868
- }
2869
- }
2870
- }
2871
- };
2872
- const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {
2873
- const childElm = vnodeChild.$elm$;
2874
- if (childElm == null) {
2875
- return;
2876
- }
2877
- const nodeId = cmpData.nodeIds++;
2878
- const childId = `${hostId}.${nodeId}.${depth}.${index}`;
2879
- childElm['s-host-id'] = hostId;
2880
- childElm['s-node-id'] = nodeId;
2881
- if (childElm.nodeType === 1 /* ElementNode */) {
2882
- childElm.setAttribute(HYDRATE_CHILD_ID, childId);
2883
- }
2884
- else if (childElm.nodeType === 3 /* TextNode */) {
2885
- const parentNode = childElm.parentNode;
2886
- const nodeName = parentNode.nodeName;
2887
- if (nodeName !== 'STYLE' && nodeName !== 'SCRIPT') {
2888
- const textNodeId = `${TEXT_NODE_ID}.${childId}`;
2889
- const commentBeforeTextNode = doc.createComment(textNodeId);
2890
- parentNode.insertBefore(commentBeforeTextNode, childElm);
2891
- }
2892
- }
2893
- else if (childElm.nodeType === 8 /* CommentNode */) {
2894
- if (childElm['s-sr']) {
2895
- const slotName = childElm['s-sn'] || '';
2896
- const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;
2897
- childElm.nodeValue = slotNodeId;
2898
- }
2899
- }
2900
- if (vnodeChild.$children$ != null) {
2901
- const childDepth = depth + 1;
2902
- vnodeChild.$children$.forEach((vnode, index) => {
2903
- insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index);
2904
- });
2905
- }
2906
- };
2907
- const setPlatformOptions = (opts) => Object.assign(plt, opts);
2908
- const Fragment = (_, children) => children;
2909
- const hostRefs = new WeakMap();
2910
- const getHostRef = (ref) => hostRefs.get(ref);
2911
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2912
- const registerHost = (elm, cmpMeta) => {
2913
- const hostRef = {
2914
- $flags$: 0,
2915
- $hostElement$: elm,
2916
- $cmpMeta$: cmpMeta,
2917
- $instanceValues$: new Map(),
2918
- };
2919
- if (BUILD.isDev) {
2920
- hostRef.$renderCount$ = 0;
2921
- }
2922
- if (BUILD.method && BUILD.lazyLoad) {
2923
- hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
2924
- }
2925
- if (BUILD.asyncLoading) {
2926
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2927
- elm['s-p'] = [];
2928
- elm['s-rc'] = [];
2929
- }
2930
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
2931
- return hostRefs.set(elm, hostRef);
2932
- };
2933
- const isMemberInElement = (elm, memberName) => memberName in elm;
2934
- const consoleError = (e, el) => (customError || console.error)(e, el);
2935
- const STENCIL_DEV_MODE = BUILD.isTesting
2936
- ? ['STENCIL:'] // E2E testing
2937
- : [
2938
- '%cstencil',
2939
- 'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',
2940
- ];
2941
- const consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
2942
- const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
2943
- const consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
2944
- const setErrorHandler = (handler) => (customError = handler);
2945
- const cmpModules = /*@__PURE__*/ new Map();
2946
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2947
- // loadModuleImport
2948
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2949
- const bundleId = cmpMeta.$lazyBundleId$;
2950
- if (BUILD.isDev && typeof bundleId !== 'string') {
2951
- consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`);
2952
- return undefined;
2953
- }
2954
- const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
2955
- if (module) {
2956
- return module[exportName];
2957
- }
2958
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
2959
- return import(
2960
- /* @vite-ignore */
2961
- /* webpackInclude: /\.entry\.js$/ */
2962
- /* webpackExclude: /\.system\.entry\.js$/ */
2963
- /* webpackMode: "lazy" */
2964
- `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then((importedModule) => {
2965
- if (!BUILD.hotModuleReplacement) {
2966
- cmpModules.set(bundleId, importedModule);
2967
- }
2968
- return importedModule[exportName];
2969
- }, consoleError);
2970
- };
2971
- const styles = new Map();
2972
- const modeResolutionChain = [];
2973
- const queueDomReads = [];
2974
- const queueDomWrites = [];
2975
- const queueDomWritesLow = [];
2976
- const queueTask = (queue, write) => (cb) => {
2977
- queue.push(cb);
2978
- if (!queuePending) {
2979
- queuePending = true;
2980
- if (write && plt.$flags$ & 4 /* queueSync */) {
2981
- nextTick(flush);
2982
- }
2983
- else {
2984
- plt.raf(flush);
2985
- }
2986
- }
2987
- };
2988
- const consume = (queue) => {
2989
- for (let i = 0; i < queue.length; i++) {
2990
- try {
2991
- queue[i](performance.now());
2992
- }
2993
- catch (e) {
2994
- consoleError(e);
2995
- }
2996
- }
2997
- queue.length = 0;
2998
- };
2999
- const consumeTimeout = (queue, timeout) => {
3000
- let i = 0;
3001
- let ts = 0;
3002
- while (i < queue.length && (ts = performance.now()) < timeout) {
3003
- try {
3004
- queue[i++](ts);
3005
- }
3006
- catch (e) {
3007
- consoleError(e);
3008
- }
3009
- }
3010
- if (i === queue.length) {
3011
- queue.length = 0;
3012
- }
3013
- else if (i !== 0) {
3014
- queue.splice(0, i);
3015
- }
3016
- };
3017
- const flush = () => {
3018
- if (BUILD.asyncQueue) {
3019
- queueCongestion++;
3020
- }
3021
- // always force a bunch of medium callbacks to run, but still have
3022
- // a throttle on how many can run in a certain time
3023
- // DOM READS!!!
3024
- consume(queueDomReads);
3025
- // DOM WRITES!!!
3026
- if (BUILD.asyncQueue) {
3027
- const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */
3028
- ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
3029
- : Infinity;
3030
- consumeTimeout(queueDomWrites, timeout);
3031
- consumeTimeout(queueDomWritesLow, timeout);
3032
- if (queueDomWrites.length > 0) {
3033
- queueDomWritesLow.push(...queueDomWrites);
3034
- queueDomWrites.length = 0;
3035
- }
3036
- if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
3037
- // still more to do yet, but we've run out of time
3038
- // let's let this thing cool off and try again in the next tick
3039
- plt.raf(flush);
3040
- }
3041
- else {
3042
- queueCongestion = 0;
3043
- }
3044
- }
3045
- else {
3046
- consume(queueDomWrites);
3047
- if ((queuePending = queueDomReads.length > 0)) {
3048
- // still more to do yet, but we've run out of time
3049
- // let's let this thing cool off and try again in the next tick
3050
- plt.raf(flush);
3051
- }
3052
- }
3053
- };
3054
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
3055
- const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
3056
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
3057
- const Build = {
3058
- isDev: BUILD.isDev ? true : false,
3059
- isBrowser: true,
3060
- isServer: false,
3061
- isTesting: BUILD.isTesting ? true : false,
3062
- };
3063
-
3064
- export { BUILD as B, Context as C, Fragment as F, H, NAMESPACE as N, promiseResolve as a, bootstrapLazy as b, consoleDevInfo as c, doc as d, setMode as e, CSS as f, getMode as g, getAssetPath as h, getRenderingRef as i, forceUpdate as j, h as k, writeTask as l, Build as m, Host as n, getElement as o, plt as p, createEvent as q, registerInstance as r, setPlatformHelpers as s, readTask as t, getContext as u, win as w };