@sparkle-learning/core 0.0.19 → 0.0.20
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.
- package/dist/cjs/{PrivateRoute-20e27028.js → PrivateRoute-cee9b061.js} +43 -43
- package/dist/cjs/{active-router-dca7573e.js → active-router-3bd7b540.js} +1 -1
- package/dist/cjs/{app-globals-bea78913.js → app-globals-98121d6d.js} +1 -1
- package/dist/cjs/{assets.service-5098e79c.js → assets.service-0c759d51.js} +2 -27
- package/dist/cjs/{httpService-6377985c.js → auth.store-aba3d22f.js} +31 -5
- package/dist/cjs/{button-active-1edcd24e.js → button-active-9456fb4d.js} +1 -1
- package/dist/cjs/compass-svg.cjs.entry.js +132 -0
- package/dist/cjs/context-consumer.cjs.entry.js +1 -1
- package/dist/cjs/course-select.cjs.entry.js +1 -1
- package/dist/cjs/environment-config.service-0e02b049.js +29 -0
- package/dist/cjs/facilitator.service-e1e2f719.js +94 -0
- package/dist/cjs/feed.service-518d18fd.js +5802 -0
- package/dist/cjs/header-mobile-collapse_60.cjs.entry.js +86 -0
- package/dist/cjs/{icons-fda1e4fc.js → icons-a0fef92b.js} +2 -6
- package/dist/cjs/{index-123ceda0.js → index-58b3ee93.js} +3 -3
- package/dist/cjs/{index-786a6369.js → index-7bcd36a0.js} +1 -1
- package/dist/cjs/{index-56cc404a.js → index-fbf4d3bf.js} +2 -0
- package/dist/cjs/index.cjs.js +9 -8
- package/dist/cjs/index.es-6a9d5ef8.js +13834 -0
- package/dist/cjs/ion-action-sheet.cjs.entry.js +4 -4
- package/dist/cjs/ion-alert.cjs.entry.js +4 -4
- package/dist/cjs/ion-app.cjs.entry.js +3 -3
- package/dist/cjs/ion-back-button.cjs.entry.js +89 -0
- package/dist/cjs/ion-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/ion-badge.cjs.entry.js +2 -2
- package/dist/cjs/{ion-back-button_4.cjs.entry.js → ion-buttons_3.cjs.entry.js} +2 -83
- package/dist/cjs/ion-card-header.cjs.entry.js +2 -2
- package/dist/cjs/ion-card-subtitle.cjs.entry.js +2 -2
- package/dist/cjs/ion-card-title.cjs.entry.js +2 -2
- package/dist/cjs/ion-chip.cjs.entry.js +2 -2
- package/dist/cjs/{ion-content.cjs.entry.js → ion-content_2.cjs.entry.js} +259 -2
- package/dist/cjs/ion-datetime.cjs.entry.js +3 -3
- package/dist/cjs/ion-fab-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-fab-list.cjs.entry.js +2 -2
- package/dist/cjs/ion-fab.cjs.entry.js +2 -2
- package/dist/cjs/ion-footer.cjs.entry.js +2 -2
- package/dist/cjs/ion-img.cjs.entry.js +2 -2
- package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +2 -2
- package/dist/cjs/ion-infinite-scroll.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-divider.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-group.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-option.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-options.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-sliding.cjs.entry.js +2 -2
- package/dist/cjs/ion-loading.cjs.entry.js +3 -3
- package/dist/cjs/ion-menu-button.cjs.entry.js +4 -4
- package/dist/cjs/ion-menu-toggle.cjs.entry.js +4 -4
- package/dist/cjs/ion-menu.cjs.entry.js +3 -3
- package/dist/cjs/ion-modal.cjs.entry.js +4 -4
- package/dist/cjs/ion-nav-link.cjs.entry.js +1 -1
- package/dist/cjs/ion-nav.cjs.entry.js +3 -3
- package/dist/cjs/ion-note.cjs.entry.js +2 -2
- package/dist/cjs/ion-picker-column.cjs.entry.js +2 -2
- package/dist/cjs/ion-picker.cjs.entry.js +3 -3
- package/dist/cjs/ion-popover.cjs.entry.js +4 -4
- package/dist/cjs/ion-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/ion-refresher-content.cjs.entry.js +2 -2
- package/dist/cjs/ion-refresher.cjs.entry.js +2 -2
- package/dist/cjs/ion-reorder-group.cjs.entry.js +2 -2
- package/dist/cjs/ion-reorder.cjs.entry.js +2 -2
- package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
- package/dist/cjs/ion-route.cjs.entry.js +1 -1
- package/dist/cjs/ion-router-link.cjs.entry.js +2 -2
- package/dist/cjs/ion-router-outlet.cjs.entry.js +3 -3
- package/dist/cjs/ion-router.cjs.entry.js +1 -1
- package/dist/cjs/ion-searchbar.cjs.entry.js +2 -2
- package/dist/cjs/ion-segment-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-segment.cjs.entry.js +2 -2
- package/dist/cjs/ion-select-popover.cjs.entry.js +3 -3
- package/dist/cjs/ion-select_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-skeleton-text.cjs.entry.js +2 -2
- package/dist/cjs/ion-slide.cjs.entry.js +2 -2
- package/dist/cjs/ion-slides.cjs.entry.js +2 -2
- package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-bar.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab.cjs.entry.js +1 -1
- package/dist/cjs/ion-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +3 -3
- package/dist/cjs/ion-toggle.cjs.entry.js +2 -2
- package/dist/cjs/ion-virtual-scroll.cjs.entry.js +1 -1
- package/dist/cjs/{ionic-global-57e21b7b.js → ionic-global-4930d319.js} +1 -1
- package/dist/cjs/{ios.transition-b6898b4e.js → ios.transition-6e1fd3d6.js} +2 -2
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{md.transition-dcccb17e.js → md.transition-3652ad78.js} +2 -2
- package/dist/cjs/{menu-toggle-util-36785376.js → menu-toggle-util-a8fb4c56.js} +1 -1
- package/dist/cjs/{overlays-09ece60d.js → overlays-08a817ea.js} +1 -1
- package/dist/cjs/purify-9804ff8d.js +1355 -0
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-code.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-compass-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-compass.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-core.cjs.js +4 -4
- package/dist/cjs/sparkle-emoji.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +118 -0
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-feedback.cjs.entry.js +19 -6
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +75 -34
- package/dist/cjs/sparkle-gww-comment-list.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-gww-graph.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-lower-content-nav.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-modal-image.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-notfound-page.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-overlay.cjs.entry.js +92 -0
- package/dist/cjs/sparkle-poll.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz.cjs.entry.js +4 -3
- package/dist/cjs/sparkle-select.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-sidebar.cjs.entry.js +43 -0
- package/dist/cjs/sparkle-tab.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-table-of-contents.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-youtube.cjs.entry.js +1 -1
- package/dist/cjs/{status-tap-18630b4c.js → status-tap-466a7c6a.js} +1 -1
- package/dist/cjs/stencil-async-content.cjs.entry.js +1 -1
- package/dist/cjs/stencil-route-title.cjs.entry.js +2 -2
- package/dist/cjs/stencil-router-prompt.cjs.entry.js +2 -2
- package/dist/cjs/{student.service-93a3c3e1.js → student.service-41c7c78d.js} +17 -14
- package/dist/collection/assets/svg/profile.svg +2 -0
- package/dist/collection/collection-manifest.json +8 -0
- package/dist/collection/components/compass-svg/compass-svg.css +15 -0
- package/dist/collection/components/compass-svg/compass-svg.js +156 -0
- package/dist/collection/components/layout/facilitator/export-lessons/export-lessons.css +7 -0
- package/dist/collection/components/layout/facilitator/export-lessons/export-lessons.js +110 -0
- package/dist/collection/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.css +3 -0
- package/dist/collection/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.js +214 -0
- package/dist/collection/components/layout/facilitator/facilitator-header/facilitator-header.js +2 -8
- package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.css +3 -0
- package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.js +144 -0
- package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes.css +14 -0
- package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes.js +64 -0
- package/dist/collection/components/layout/facilitator/facilitator-page.css +13 -3
- package/dist/collection/components/layout/facilitator/facilitator-page.js +147 -24
- package/dist/collection/components/layout/facilitator/online-students/online-students.js +59 -2
- package/dist/collection/components/layout/page/page.js +93 -4
- package/dist/collection/components/layout/page/templates/index.js +2 -0
- package/dist/collection/components/layout/page/templates/pdf.js +8 -0
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.css +3 -3
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.js +98 -64
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.css +12 -29
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.js +23 -6
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.css +33 -0
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.js +37 -0
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goals.css +8 -8
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goals.js +15 -60
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-comment-list/sparkle-gww-comment-list.css +7 -7
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-comment-list/sparkle-gww-comment-list.js +3 -1
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-graph/sparkle-gww-graph.css +3 -3
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.css +30 -29
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.js +111 -11
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww.css +3 -3
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww.js +30 -64
- package/dist/collection/components/mini-apps/sparkle-health/sparkle-health.css +10 -3
- package/dist/collection/components/mini-apps/sparkle-health/sparkle-health.js +51 -11
- package/dist/collection/components/mini-apps/sparkle-mood/sparkle-mood.css +11 -11
- package/dist/collection/components/mini-apps/sparkle-mood/sparkle-mood.js +38 -8
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.css +3 -3
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +24 -25
- package/dist/collection/components/sparkle-emoji/sparkle-emoji.css +16 -16
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.css +3 -3
- package/dist/collection/components/sparkle-feedback/sparkle-feedback.css +3 -3
- package/dist/collection/components/sparkle-feedback/sparkle-feedback.js +14 -1
- package/dist/collection/components/sparkle-forgot-password/sparkle-forgot-password.js +39 -5
- package/dist/collection/components/sparkle-login/sparkle-login.js +3 -1
- package/dist/collection/components/sparkle-poll/sparkle-poll.css +3 -3
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-feedback/sparkle-quiz-feedback.css +3 -3
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-input/sparkle-quiz-input.css +3 -3
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-poll/sparkle-quiz-poll.css +3 -3
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-select/sparkle-quiz-select.css +3 -3
- package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.css +3 -3
- package/dist/collection/components/sparkle-reset-password/sparkle-reset-password.css +3 -0
- package/dist/collection/components/sparkle-reset-password/sparkle-reset-password.js +126 -0
- package/dist/collection/components/sparkle-root/sparkle-root.css +16 -0
- package/dist/collection/components/sparkle-root/sparkle-root.js +24 -1
- package/dist/collection/components/sparkle-signup/sparkle-signup.js +16 -12
- package/dist/collection/components/sparkle-unauthorized/sparkle-unauthorized.css +13 -13
- package/dist/collection/components/sparkle-user-enrollment/sparkle-user-enrollment.css +3 -3
- package/dist/collection/components/sparkle-user-profile/sparkle-user-profile.css +54 -3
- package/dist/collection/components/sparkle-user-profile/sparkle-user-profile.js +35 -8
- package/dist/collection/components/sparkle-validation-error/sparkle-validation-error.css +11 -0
- package/dist/collection/components/sparkle-validation-error/sparkle-validation-error.js +44 -0
- package/dist/collection/icons.js +1 -0
- package/dist/collection/models/class.model.js +5 -1
- package/dist/collection/models/facilitator-dashboard.model.js +5 -0
- package/dist/collection/services/account.service.js +42 -4
- package/dist/collection/services/appdata.service.js +60 -0
- package/dist/collection/services/auth/auth.service.js +34 -25
- package/dist/collection/services/environment/environment-config.js +4 -1
- package/dist/collection/services/facilitator.service.js +76 -0
- package/dist/collection/services/feed.service.js +43 -0
- package/dist/collection/services/httpService.js +16 -3
- package/dist/collection/services/media.service.js +29 -0
- package/dist/collection/services/signalR.service.js +85 -0
- package/dist/collection/services/student.service.js +8 -7
- package/dist/collection/stores/auth.store.js +2 -1
- package/dist/collection/stores/facilitator.store.js +11 -2
- package/dist/collection/stores/feed.store.js +3 -1
- package/dist/collection/stores/goal.store.js +2 -0
- package/dist/collection/stores/media.store.js +5 -0
- package/dist/collection/stores/signalR.store.js +6 -0
- package/dist/collection/stores/user.store.js +3 -1
- package/dist/collection/util.js +23 -1
- package/dist/esm/{PrivateRoute-c10669e7.js → PrivateRoute-9f0973bb.js} +41 -40
- package/dist/esm/{active-router-044bf79e.js → active-router-b3ae32c7.js} +1 -1
- package/dist/esm/{app-globals-d592451f.js → app-globals-6451faf3.js} +1 -1
- package/dist/esm/{assets.service-da511a45.js → assets.service-66e848b8.js} +2 -26
- package/dist/esm/{httpService-010551aa.js → auth.store-dd944bc2.js} +31 -6
- package/dist/esm/{button-active-32a41594.js → button-active-97535443.js} +1 -1
- package/dist/esm/compass-svg.entry.js +128 -0
- package/dist/esm/context-consumer.entry.js +1 -1
- package/dist/esm/course-select.entry.js +1 -1
- package/dist/esm/environment-config.service-2b5d692b.js +27 -0
- package/dist/esm/facilitator.service-cddb2feb.js +91 -0
- package/dist/esm/feed.service-0fda1e36.js +5787 -0
- package/dist/esm/header-mobile-collapse_60.entry.js +19 -0
- package/dist/esm/{icons-212531e8.js → icons-33e5804c.js} +3 -6
- package/dist/esm/{index-24b18689.js → index-55fc9f5e.js} +2 -1
- package/dist/esm/{index-243ec2f9.js → index-a94619f9.js} +3 -3
- package/dist/esm/{index-c539b2bc.js → index-dc09784f.js} +1 -1
- package/dist/esm/index.es-8ad3b6a1.js +13748 -0
- package/dist/esm/index.js +7 -6
- package/dist/esm/ion-action-sheet.entry.js +4 -4
- package/dist/esm/ion-alert.entry.js +4 -4
- package/dist/esm/ion-app.entry.js +3 -3
- package/dist/esm/ion-back-button.entry.js +85 -0
- package/dist/esm/ion-backdrop.entry.js +2 -2
- package/dist/esm/ion-badge.entry.js +2 -2
- package/dist/esm/{ion-back-button_4.entry.js → ion-buttons_3.entry.js} +4 -84
- package/dist/esm/ion-card-header.entry.js +2 -2
- package/dist/esm/ion-card-subtitle.entry.js +2 -2
- package/dist/esm/ion-card-title.entry.js +2 -2
- package/dist/esm/ion-chip.entry.js +2 -2
- package/dist/esm/{ion-content.entry.js → ion-content_2.entry.js} +259 -3
- package/dist/esm/ion-datetime.entry.js +3 -3
- package/dist/esm/ion-fab-button.entry.js +2 -2
- package/dist/esm/ion-fab-list.entry.js +2 -2
- package/dist/esm/ion-fab.entry.js +2 -2
- package/dist/esm/ion-footer.entry.js +2 -2
- package/dist/esm/ion-img.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll-content.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll.entry.js +2 -2
- package/dist/esm/ion-item-divider.entry.js +2 -2
- package/dist/esm/ion-item-group.entry.js +2 -2
- package/dist/esm/ion-item-option.entry.js +2 -2
- package/dist/esm/ion-item-options.entry.js +2 -2
- package/dist/esm/ion-item-sliding.entry.js +2 -2
- package/dist/esm/ion-loading.entry.js +3 -3
- package/dist/esm/ion-menu-button.entry.js +4 -4
- package/dist/esm/ion-menu-toggle.entry.js +4 -4
- package/dist/esm/ion-menu.entry.js +3 -3
- package/dist/esm/ion-modal.entry.js +4 -4
- package/dist/esm/ion-nav-link.entry.js +1 -1
- package/dist/esm/ion-nav.entry.js +3 -3
- package/dist/esm/ion-note.entry.js +2 -2
- package/dist/esm/ion-picker-column.entry.js +2 -2
- package/dist/esm/ion-picker.entry.js +3 -3
- package/dist/esm/ion-popover.entry.js +4 -4
- package/dist/esm/ion-progress-bar.entry.js +2 -2
- package/dist/esm/ion-refresher-content.entry.js +2 -2
- package/dist/esm/ion-refresher.entry.js +2 -2
- package/dist/esm/ion-reorder-group.entry.js +2 -2
- package/dist/esm/ion-reorder.entry.js +2 -2
- package/dist/esm/ion-route-redirect.entry.js +1 -1
- package/dist/esm/ion-route.entry.js +1 -1
- package/dist/esm/ion-router-link.entry.js +2 -2
- package/dist/esm/ion-router-outlet.entry.js +3 -3
- package/dist/esm/ion-router.entry.js +1 -1
- package/dist/esm/ion-searchbar.entry.js +2 -2
- package/dist/esm/ion-segment-button.entry.js +2 -2
- package/dist/esm/ion-segment.entry.js +2 -2
- package/dist/esm/ion-select-popover.entry.js +3 -3
- package/dist/esm/ion-select_2.entry.js +3 -3
- package/dist/esm/ion-skeleton-text.entry.js +2 -2
- package/dist/esm/ion-slide.entry.js +2 -2
- package/dist/esm/ion-slides.entry.js +2 -2
- package/dist/esm/ion-split-pane.entry.js +2 -2
- package/dist/esm/ion-tab-bar.entry.js +2 -2
- package/dist/esm/ion-tab-button.entry.js +2 -2
- package/dist/esm/ion-tab.entry.js +1 -1
- package/dist/esm/ion-tabs.entry.js +1 -1
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +3 -3
- package/dist/esm/ion-toggle.entry.js +2 -2
- package/dist/esm/ion-virtual-scroll.entry.js +1 -1
- package/dist/esm/{ionic-global-fddd88d0.js → ionic-global-1f9287cc.js} +1 -1
- package/dist/esm/{ios.transition-1ffb59e3.js → ios.transition-d01abefd.js} +2 -2
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{md.transition-18b7b80d.js → md.transition-245ffa55.js} +2 -2
- package/dist/esm/{menu-toggle-util-729c91ad.js → menu-toggle-util-fe83fcf5.js} +1 -1
- package/dist/esm/{overlays-8606ae17.js → overlays-8363621c.js} +2 -2
- package/dist/esm/purify-76634fc8.js +1353 -0
- package/dist/esm/sparkle-animation-player.entry.js +1 -1
- package/dist/esm/sparkle-code.entry.js +2 -2
- package/dist/esm/sparkle-compass-post.entry.js +1 -1
- package/dist/esm/sparkle-compass.entry.js +1 -1
- package/dist/esm/sparkle-core.js +4 -4
- package/dist/esm/sparkle-emoji.entry.js +1 -1
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +114 -0
- package/dist/esm/sparkle-feed-post.entry.js +1 -1
- package/dist/esm/sparkle-feedback.entry.js +19 -6
- package/dist/esm/sparkle-goal-form.entry.js +73 -32
- package/dist/esm/sparkle-gww-comment-list.entry.js +2 -2
- package/dist/esm/sparkle-gww-graph.entry.js +1 -1
- package/dist/esm/sparkle-lower-content-nav.entry.js +1 -1
- package/dist/esm/sparkle-menu-collapsible.entry.js +2 -2
- package/dist/esm/sparkle-modal-image.entry.js +1 -1
- package/dist/esm/sparkle-notfound-page.entry.js +1 -1
- package/dist/esm/sparkle-overlay.entry.js +88 -0
- package/dist/esm/sparkle-poll.entry.js +1 -1
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/sparkle-quiz-feedback_5.entry.js +1 -1
- package/dist/esm/sparkle-quiz.entry.js +3 -2
- package/dist/esm/sparkle-select.entry.js +1 -1
- package/dist/esm/sparkle-sidebar.entry.js +39 -0
- package/dist/esm/sparkle-tab.entry.js +1 -1
- package/dist/esm/sparkle-table-of-contents.entry.js +1 -1
- package/dist/esm/sparkle-tabs.entry.js +1 -1
- package/dist/esm/sparkle-youtube.entry.js +1 -1
- package/dist/esm/{status-tap-83804717.js → status-tap-9221cd79.js} +1 -1
- package/dist/esm/stencil-async-content.entry.js +1 -1
- package/dist/esm/stencil-route-title.entry.js +2 -2
- package/dist/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/esm/{student.service-a99d0248.js → student.service-c36c5a75.js} +12 -9
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/{p-7dbe06d4.entry.js → p-016bf847.entry.js} +1 -1
- package/dist/sparkle-core/{p-5f6e7530.entry.js → p-019d9d02.entry.js} +1 -1
- package/dist/sparkle-core/{p-10bcf9e6.js → p-03eb2164.js} +1 -1
- package/dist/sparkle-core/{p-c94a7e74.entry.js → p-03fd27d0.entry.js} +1 -1
- package/dist/sparkle-core/p-07018d29.js +1 -0
- package/dist/sparkle-core/p-083d57a6.entry.js +1 -0
- package/dist/sparkle-core/p-090f2624.js +1 -0
- package/dist/sparkle-core/{p-db5369a3.entry.js → p-09d43bee.entry.js} +1 -1
- package/dist/sparkle-core/{p-010fc9dd.entry.js → p-0bd3e81f.entry.js} +1 -1
- package/dist/sparkle-core/{p-9c3e864e.js → p-0e1c7c8c.js} +1 -1
- package/dist/sparkle-core/{p-b0f4601a.entry.js → p-0efbc0b3.entry.js} +1 -1
- package/dist/sparkle-core/{p-cf4068ca.entry.js → p-13b0cdfc.entry.js} +1 -1
- package/dist/sparkle-core/{p-b8da1d60.entry.js → p-13c9bf3a.entry.js} +1 -1
- package/dist/sparkle-core/{p-5ef558e2.entry.js → p-151afa9e.entry.js} +1 -1
- package/dist/sparkle-core/{p-a3115b74.entry.js → p-15d68269.entry.js} +1 -1
- package/dist/sparkle-core/p-17507402.entry.js +1 -0
- package/dist/sparkle-core/{p-f7fe74de.entry.js → p-1bf8bed6.entry.js} +1 -1
- package/dist/sparkle-core/p-1ca4bf1d.entry.js +1 -0
- package/dist/sparkle-core/{p-a0be4cda.entry.js → p-1e866c41.entry.js} +1 -1
- package/dist/sparkle-core/p-22926eed.entry.js +1 -0
- package/dist/sparkle-core/{p-d9f138ff.entry.js → p-2474bf60.entry.js} +1 -1
- package/dist/sparkle-core/{p-c92e20cf.entry.js → p-25bbf9b4.entry.js} +1 -1
- package/dist/sparkle-core/p-2a45b732.js +1 -0
- package/dist/sparkle-core/{p-ec5f3b00.entry.js → p-2abf4d37.entry.js} +1 -1
- package/dist/sparkle-core/{p-380dc0b7.entry.js → p-2c5edb9f.entry.js} +1 -1
- package/dist/sparkle-core/p-30b641a4.entry.js +1 -0
- package/dist/sparkle-core/{p-e1d9420b.entry.js → p-359422b6.entry.js} +1 -1
- package/dist/sparkle-core/{p-dec1556a.entry.js → p-37bfb548.entry.js} +1 -1
- package/dist/sparkle-core/{p-c0f92ba3.entry.js → p-3a29a75b.entry.js} +1 -1
- package/dist/sparkle-core/{p-0de00e5e.entry.js → p-3bb55510.entry.js} +1 -1
- package/dist/sparkle-core/p-3be0a218.js +1 -0
- package/dist/sparkle-core/{p-edde077c.entry.js → p-3cd28c60.entry.js} +1 -1
- package/dist/sparkle-core/{p-f3b47828.entry.js → p-3f5d7a08.entry.js} +1 -1
- package/dist/sparkle-core/p-40db85ac.entry.js +1 -0
- package/dist/sparkle-core/{p-4c3378e6.entry.js → p-447163be.entry.js} +1 -1
- package/dist/sparkle-core/{p-3fa3bad0.entry.js → p-49265a8e.entry.js} +1 -1
- package/dist/sparkle-core/{p-105a015d.entry.js → p-4950f841.entry.js} +1 -1
- package/dist/sparkle-core/p-4d8cb365.entry.js +1 -0
- package/dist/sparkle-core/{p-6025bf4c.entry.js → p-4e28ca37.entry.js} +1 -1
- package/dist/sparkle-core/{p-0f5def84.entry.js → p-5073899e.entry.js} +1 -1
- package/dist/sparkle-core/p-52355989.entry.js +1 -0
- package/dist/sparkle-core/{p-a2d7538f.entry.js → p-581ca370.entry.js} +1 -1
- package/dist/sparkle-core/{p-0b9b51ad.entry.js → p-5b366c20.entry.js} +1 -1
- package/dist/sparkle-core/{p-2f7aca1a.entry.js → p-5dce20b9.entry.js} +1 -1
- package/dist/sparkle-core/{p-76b1778e.entry.js → p-6006beec.entry.js} +1 -1
- package/dist/sparkle-core/{p-4e1f43b3.entry.js → p-600d04fc.entry.js} +1 -1
- package/dist/sparkle-core/{p-be4c1900.entry.js → p-60828739.entry.js} +1 -1
- package/dist/sparkle-core/{p-dedb1e25.entry.js → p-6112b180.entry.js} +1 -1
- package/dist/sparkle-core/p-660fccf6.js +1 -0
- package/dist/sparkle-core/{p-1865fef1.entry.js → p-66e3bd1c.entry.js} +1 -1
- package/dist/sparkle-core/{p-90e2a1a4.entry.js → p-66eb6b7a.entry.js} +1 -1
- package/dist/sparkle-core/p-67ddec3f.entry.js +1 -0
- package/dist/sparkle-core/p-68cb7d41.entry.js +1 -0
- package/dist/sparkle-core/{p-31bfcaa8.entry.js → p-68f3c93d.entry.js} +1 -1
- package/dist/sparkle-core/p-69cd49de.js +1 -0
- package/dist/sparkle-core/{p-be2f0921.js → p-6d506f4e.js} +1 -1
- package/dist/sparkle-core/{p-a32fd85b.entry.js → p-6edbdde5.entry.js} +1 -1
- package/dist/sparkle-core/p-6f0ecbe3.js +1 -0
- package/dist/sparkle-core/{p-b3563859.entry.js → p-73a646fb.entry.js} +1 -1
- package/dist/sparkle-core/{p-c9ada4d9.js → p-765b8593.js} +1 -1
- package/dist/sparkle-core/{p-fa952096.js → p-770128c8.js} +1 -1
- package/dist/sparkle-core/{p-355ace68.entry.js → p-7b37d523.entry.js} +1 -1
- package/dist/sparkle-core/{p-950a716b.entry.js → p-7d83d006.entry.js} +1 -1
- package/dist/sparkle-core/p-7f3d5344.js +1 -0
- package/dist/sparkle-core/{p-6ac166bf.entry.js → p-81651f26.entry.js} +1 -1
- package/dist/sparkle-core/{p-163a6f39.entry.js → p-85d31769.entry.js} +1 -1
- package/dist/sparkle-core/{p-ce4abe36.entry.js → p-86148067.entry.js} +1 -1
- package/dist/sparkle-core/{p-c590df76.entry.js → p-8b5bc1d6.entry.js} +1 -1
- package/dist/sparkle-core/{p-d80f9e60.entry.js → p-8c3ee44c.entry.js} +1 -1
- package/dist/sparkle-core/{p-5479a3af.entry.js → p-9007a06b.entry.js} +1 -1
- package/dist/sparkle-core/{p-7776c809.entry.js → p-90482861.entry.js} +1 -1
- package/dist/sparkle-core/{p-0962db66.entry.js → p-92d42c10.entry.js} +1 -1
- package/dist/sparkle-core/p-9a443f51.js +1 -0
- package/dist/sparkle-core/{p-76613f4e.entry.js → p-9ca56f5d.entry.js} +1 -1
- package/dist/sparkle-core/{p-5d0fe13c.entry.js → p-a061537e.entry.js} +1 -1
- package/dist/sparkle-core/{p-f3d79061.entry.js → p-a250e2ae.entry.js} +1 -1
- package/dist/sparkle-core/{p-a78910ca.entry.js → p-abe2676a.entry.js} +1 -1
- package/dist/sparkle-core/{p-dac72f8f.entry.js → p-ac5e5308.entry.js} +1 -1
- package/dist/sparkle-core/{p-52c98e23.entry.js → p-afbaad64.entry.js} +1 -1
- package/dist/sparkle-core/p-b080c1e3.entry.js +1 -0
- package/dist/sparkle-core/p-b226f54d.js +1 -0
- package/dist/sparkle-core/p-b2d4840f.js +3 -0
- package/dist/sparkle-core/{p-7cf984f4.entry.js → p-bac45a26.entry.js} +1 -1
- package/dist/sparkle-core/p-bbe5977b.entry.js +1 -0
- package/dist/sparkle-core/p-bc568dcb.js +1 -0
- package/dist/sparkle-core/p-bccd9036.entry.js +1 -0
- package/dist/sparkle-core/{p-47c18479.entry.js → p-c163c16d.entry.js} +1 -1
- package/dist/sparkle-core/{p-a1227663.entry.js → p-c3166584.entry.js} +1 -1
- package/dist/sparkle-core/{p-1f06b38f.entry.js → p-c34269ae.entry.js} +1 -1
- package/dist/sparkle-core/{p-1cbcfe63.js → p-c466ee32.js} +1 -1
- package/dist/sparkle-core/{p-13cf6a32.entry.js → p-c6710592.entry.js} +1 -1
- package/dist/sparkle-core/{p-1f20b217.entry.js → p-c7022391.entry.js} +1 -1
- package/dist/sparkle-core/{p-2734a99d.entry.js → p-c70b9765.entry.js} +1 -1
- package/dist/sparkle-core/{p-50e824ef.entry.js → p-c82b05e0.entry.js} +1 -1
- package/dist/sparkle-core/{p-3d200504.entry.js → p-cf2332bb.entry.js} +1 -1
- package/dist/sparkle-core/{p-268eb6c0.entry.js → p-d069b834.entry.js} +1 -1
- package/dist/sparkle-core/{p-fec7a97a.js → p-d4ad796c.js} +1 -1
- package/dist/sparkle-core/{p-fa192cf5.entry.js → p-d4d9aa4a.entry.js} +1 -1
- package/dist/sparkle-core/p-d5023db0.entry.js +1 -0
- package/dist/sparkle-core/p-d6152660.entry.js +1 -0
- package/dist/sparkle-core/{p-3d23a42a.js → p-d63406d8.js} +1 -1
- package/dist/sparkle-core/{p-63915a84.entry.js → p-dba672d5.entry.js} +1 -1
- package/dist/sparkle-core/{p-20be4996.entry.js → p-dd73d01a.entry.js} +1 -1
- package/dist/sparkle-core/p-de33872d.entry.js +1 -0
- package/dist/sparkle-core/p-dee2128a.entry.js +1 -0
- package/dist/sparkle-core/{p-2b5cc8a6.entry.js → p-df07e132.entry.js} +1 -1
- package/dist/sparkle-core/p-e5d5aaa5.js +1 -0
- package/dist/sparkle-core/{p-511b5347.entry.js → p-e72c6d87.entry.js} +1 -1
- package/dist/sparkle-core/{p-bcf3d05a.entry.js → p-e818b11d.entry.js} +1 -1
- package/dist/sparkle-core/{p-7dd253f8.entry.js → p-e8df6ea6.entry.js} +1 -1
- package/dist/sparkle-core/{p-4c7d0f6b.entry.js → p-e975924a.entry.js} +1 -1
- package/dist/sparkle-core/{p-46757cdc.entry.js → p-eb56aa20.entry.js} +1 -1
- package/dist/sparkle-core/p-ec2e029e.js +483 -0
- package/dist/sparkle-core/{p-97e03cb4.js → p-ef2a2172.js} +1 -1
- package/dist/sparkle-core/p-f1a4ab33.entry.js +1 -0
- package/dist/sparkle-core/p-f43ac631.entry.js +1 -0
- package/dist/sparkle-core/{p-495e321e.entry.js → p-f72a6e6d.entry.js} +1 -1
- package/dist/sparkle-core/{p-14a861e1.entry.js → p-f9143c5d.entry.js} +1 -1
- package/dist/sparkle-core/{p-8d1ec1bb.entry.js → p-fd62283e.entry.js} +1 -1
- package/dist/sparkle-core/{p-396c0198.entry.js → p-fef71e0e.entry.js} +1 -1
- package/dist/sparkle-core/sparkle-core.css +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/compass-svg/compass-svg.d.ts +34 -0
- package/dist/types/components/layout/facilitator/export-lessons/export-lessons.d.ts +16 -0
- package/dist/types/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.d.ts +22 -0
- package/dist/types/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.d.ts +24 -0
- package/dist/types/components/layout/facilitator/facilitator-notes/facilitator-notes.d.ts +9 -0
- package/dist/types/components/layout/facilitator/facilitator-page.d.ts +19 -2
- package/dist/types/components/layout/facilitator/online-students/online-students.d.ts +6 -0
- package/dist/types/components/layout/page/page.d.ts +8 -0
- package/dist/types/components/layout/page/templates/index.d.ts +1 -0
- package/dist/types/components/layout/page/templates/pdf.d.ts +2 -0
- package/dist/types/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.d.ts +6 -5
- package/dist/types/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.d.ts +1 -0
- package/dist/types/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.d.ts +4 -0
- package/dist/types/components/mini-apps/sparkle-goals/sparkle-goals.d.ts +3 -3
- package/dist/types/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.d.ts +9 -2
- package/dist/types/components/mini-apps/sparkle-gww/sparkle-gww.d.ts +4 -2
- package/dist/types/components/mini-apps/sparkle-health/sparkle-health.d.ts +4 -1
- package/dist/types/components/mini-apps/sparkle-mood/sparkle-mood.d.ts +3 -0
- package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +3 -3
- package/dist/types/components/sparkle-forgot-password/sparkle-forgot-password.d.ts +3 -0
- package/dist/types/components/sparkle-reset-password/sparkle-reset-password.d.ts +22 -0
- package/dist/types/components/sparkle-root/sparkle-root.d.ts +4 -0
- package/dist/types/components/sparkle-signup/sparkle-signup.d.ts +1 -1
- package/dist/types/components/sparkle-user-profile/sparkle-user-profile.d.ts +4 -0
- package/dist/types/components/sparkle-validation-error/sparkle-validation-error.d.ts +7 -0
- package/dist/types/components.d.ts +141 -6
- package/dist/types/models/api.model.d.ts +8 -0
- package/dist/types/models/class.model.d.ts +59 -6
- package/dist/types/models/facilitator-dashboard.model.d.ts +61 -0
- package/dist/types/models/goal.model.d.ts +3 -2
- package/dist/types/services/account.service.d.ts +11 -2
- package/dist/types/services/appdata.service.d.ts +13 -0
- package/dist/types/services/facilitator.service.d.ts +22 -0
- package/dist/types/services/feed.service.d.ts +10 -0
- package/dist/types/services/httpService.d.ts +1 -0
- package/dist/types/services/media.service.d.ts +8 -0
- package/dist/types/services/signalR.service.d.ts +10 -0
- package/dist/types/services/student.service.d.ts +1 -1
- package/dist/types/stores/auth.store.d.ts +1 -0
- package/dist/types/stores/facilitator.store.d.ts +11 -2
- package/dist/types/stores/feed.store.d.ts +3 -1
- package/dist/types/stores/goal.store.d.ts +4 -1
- package/dist/types/stores/media.store.d.ts +8 -0
- package/dist/types/stores/signalR.store.d.ts +10 -0
- package/dist/types/stores/user.store.d.ts +3 -1
- package/dist/types/util.d.ts +11 -0
- package/package.json +6 -2
- package/dist/cjs/header-mobile-collapse_51.cjs.entry.js +0 -5245
- package/dist/cjs/ion-card-content.cjs.entry.js +0 -30
- package/dist/cjs/ion-card.cjs.entry.js +0 -70
- package/dist/cjs/ion-header.cjs.entry.js +0 -264
- package/dist/cjs/ion-spinner.cjs.entry.js +0 -64
- package/dist/cjs/sparkle-page-footer.cjs.entry.js +0 -27
- package/dist/cjs/sparkle-pagination.cjs.entry.js +0 -31
- package/dist/cjs/util-dd1e6ff1.js +0 -23
- package/dist/collection/assets/lib/sparkle.js +0 -524
- package/dist/collection/assets/lib/sparkle.signalr-client.js +0 -135
- package/dist/collection/pages/course/welcome-to-mind-body/introduction/animation/m4l1p1.js +0 -2884
- package/dist/esm/header-mobile-collapse_51.entry.js +0 -5191
- package/dist/esm/ion-card-content.entry.js +0 -26
- package/dist/esm/ion-card.entry.js +0 -66
- package/dist/esm/ion-header.entry.js +0 -260
- package/dist/esm/ion-spinner.entry.js +0 -60
- package/dist/esm/sparkle-page-footer.entry.js +0 -23
- package/dist/esm/sparkle-pagination.entry.js +0 -27
- package/dist/esm/util-0e88110d.js +0 -17
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/button/button.css +0 -49
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/card/card.css +0 -208
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/cards.css +0 -31
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/code/code.css +0 -245
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/dropdown/dropdown.css +0 -111
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header-mobile-collapse/header-mobile-collapse.css +0 -255
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header.css +0 -232
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/collapsible/collapsible.css +0 -3
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu-toggle/menu-toggle.css +0 -25
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu.css +0 -71
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/nav/nav.css +0 -194
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/notfound-page/notfound-page.css +0 -4
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/overlay/overlay.css +0 -67
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/page-footer/page-footer.css +0 -18
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/pagination/pagination.css +0 -89
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/select/select.css +0 -52
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sidebar/sidebar.css +0 -98
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sparkle-lower-content-nav/sparkle-lower-content-nav.css +0 -8
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/table-of-contents/table-of-contents.css +0 -37
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/tabs/tabs.css +0 -64
- package/dist/sparkle-core/p-05928d94.js +0 -1
- package/dist/sparkle-core/p-0986aad3.entry.js +0 -1
- package/dist/sparkle-core/p-0df2b695.entry.js +0 -1
- package/dist/sparkle-core/p-12e5f5bf.entry.js +0 -1
- package/dist/sparkle-core/p-14a9aad3.js +0 -1
- package/dist/sparkle-core/p-1b5d4ef9.js +0 -1
- package/dist/sparkle-core/p-1bd160a6.entry.js +0 -1
- package/dist/sparkle-core/p-1e4381e5.entry.js +0 -1
- package/dist/sparkle-core/p-1f0bcf05.entry.js +0 -1
- package/dist/sparkle-core/p-22ae16f5.entry.js +0 -1
- package/dist/sparkle-core/p-44a2c21c.js +0 -1
- package/dist/sparkle-core/p-57076f68.entry.js +0 -1
- package/dist/sparkle-core/p-58ede27f.js +0 -1
- package/dist/sparkle-core/p-5c36d43b.entry.js +0 -1
- package/dist/sparkle-core/p-5c4eb08a.entry.js +0 -1
- package/dist/sparkle-core/p-5dd83ae8.entry.js +0 -1
- package/dist/sparkle-core/p-68c1261b.js +0 -1
- package/dist/sparkle-core/p-70a02fac.entry.js +0 -1
- package/dist/sparkle-core/p-8a3f8ce0.entry.js +0 -1
- package/dist/sparkle-core/p-9563bf6c.js +0 -1
- package/dist/sparkle-core/p-a220da33.entry.js +0 -1
- package/dist/sparkle-core/p-ad765e98.entry.js +0 -1
- package/dist/sparkle-core/p-b735f189.js +0 -1
- package/dist/sparkle-core/p-c4bbaebc.entry.js +0 -1
- package/dist/sparkle-core/p-cb119ac9.entry.js +0 -1
- package/dist/sparkle-core/p-cee6f4ba.entry.js +0 -1
- package/dist/sparkle-core/p-e72084e9.entry.js +0 -1
- package/dist/sparkle-core/p-f3a69821.entry.js +0 -1
- package/dist/sparkle-core/p-fbbfa021.js +0 -1
@@ -0,0 +1,1355 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const headerMobileCollapse_ionAvatar_ionButton_ionCard_ionCardContent_ionCheckbox_ionCol_ionGrid_ionIcon_ionInput_ionItem_ionLabel_ionList_ionListHeader_ionRadio_ionRadioGroup_ionRange_ionRippleEffect_ionRow_ionSpinner_ionText_sparkleButton_sparkleCard_sparkleCards_sparkleCourseRoot_sparkleDropdown_sparkleExportLessons_sparkleFacilitatorDashboard_sparkleFacilitatorHeader_sparkleFacilitatorNotes_sparkleFacilitatorPage_sparkleForgotPassword_sparkleGoalItem_sparkleGoalProgress_sparkleGoals_sparkleGww_sparkleGwwItem_sparkleHeader_sparkleHealth_sparkleLogin_sparkleMenu_sparkleMenuToggle_sparkleMood_sparkleNav_sparkleOnlineStudents_sparklePage_sparklePageFooter_sparklePagination_sparkleResetPassword_sparkleRoot_sparkleSignup_sparkleUnauthorized_sparkleUserEnrollment_sparkleUserProfile_sparkleValidationError_stencilRoute_stencilRouteLink_stencilRouteSwitch_stencilRouter_stencilRouterRedirect_entry = require('./header-mobile-collapse.ion-avatar.ion-button.ion-card.ion-card-content.ion-checkbox.ion-col.ion-grid.ion-icon.ion-input.ion-item.ion-label.ion-list.ion-list-header.ion-radio.ion-radio-group.ion-range.ion-ripple-effect.ion-row.ion-spinner.ion-text.sparkle-button.sparkle-card.sparkle-cards.sparkle-course-root.sparkle-dropdown.sparkle-export-lessons.sparkle-facilitator-dashboard.sparkle-facilitator-header.sparkle-facilitator-notes.sparkle-facilitator-page.sparkle-forgot-password.sparkle-goal-item.sparkle-goal-progress.sparkle-goals.sparkle-gww.sparkle-gww-item.sparkle-header.sparkle-health.sparkle-login.sparkle-menu.sparkle-menu-toggle.sparkle-mood.sparkle-nav.sparkle-online-students.sparkle-page.sparkle-page-footer.sparkle-pagination.sparkle-reset-password.sparkle-root.sparkle-signup.sparkle-unauthorized.sparkle-user-enrollment.sparkle-user-profile.sparkle-validation-error.stencil-route.stencil-route-link.stencil-route-switch.stencil-router.stencil-router-redirect-1c389e19.js');
|
4
|
+
|
5
|
+
var purify = headerMobileCollapse_ionAvatar_ionButton_ionCard_ionCardContent_ionCheckbox_ionCol_ionGrid_ionIcon_ionInput_ionItem_ionLabel_ionList_ionListHeader_ionRadio_ionRadioGroup_ionRange_ionRippleEffect_ionRow_ionSpinner_ionText_sparkleButton_sparkleCard_sparkleCards_sparkleCourseRoot_sparkleDropdown_sparkleExportLessons_sparkleFacilitatorDashboard_sparkleFacilitatorHeader_sparkleFacilitatorNotes_sparkleFacilitatorPage_sparkleForgotPassword_sparkleGoalItem_sparkleGoalProgress_sparkleGoals_sparkleGww_sparkleGwwItem_sparkleHeader_sparkleHealth_sparkleLogin_sparkleMenu_sparkleMenuToggle_sparkleMood_sparkleNav_sparkleOnlineStudents_sparklePage_sparklePageFooter_sparklePagination_sparkleResetPassword_sparkleRoot_sparkleSignup_sparkleUnauthorized_sparkleUserEnrollment_sparkleUserProfile_sparkleValidationError_stencilRoute_stencilRouteLink_stencilRouteSwitch_stencilRouter_stencilRouterRedirect_entry.createCommonjsModule(function (module, exports) {
|
6
|
+
/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
|
7
|
+
|
8
|
+
(function (global, factory) {
|
9
|
+
module.exports = factory() ;
|
10
|
+
}(headerMobileCollapse_ionAvatar_ionButton_ionCard_ionCardContent_ionCheckbox_ionCol_ionGrid_ionIcon_ionInput_ionItem_ionLabel_ionList_ionListHeader_ionRadio_ionRadioGroup_ionRange_ionRippleEffect_ionRow_ionSpinner_ionText_sparkleButton_sparkleCard_sparkleCards_sparkleCourseRoot_sparkleDropdown_sparkleExportLessons_sparkleFacilitatorDashboard_sparkleFacilitatorHeader_sparkleFacilitatorNotes_sparkleFacilitatorPage_sparkleForgotPassword_sparkleGoalItem_sparkleGoalProgress_sparkleGoals_sparkleGww_sparkleGwwItem_sparkleHeader_sparkleHealth_sparkleLogin_sparkleMenu_sparkleMenuToggle_sparkleMood_sparkleNav_sparkleOnlineStudents_sparklePage_sparklePageFooter_sparklePagination_sparkleResetPassword_sparkleRoot_sparkleSignup_sparkleUnauthorized_sparkleUserEnrollment_sparkleUserProfile_sparkleValidationError_stencilRoute_stencilRouteLink_stencilRouteSwitch_stencilRouter_stencilRouterRedirect_entry.commonjsGlobal, function () {
|
11
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
12
|
+
|
13
|
+
var hasOwnProperty = Object.hasOwnProperty,
|
14
|
+
setPrototypeOf = Object.setPrototypeOf,
|
15
|
+
isFrozen = Object.isFrozen,
|
16
|
+
getPrototypeOf = Object.getPrototypeOf,
|
17
|
+
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
18
|
+
var freeze = Object.freeze,
|
19
|
+
seal = Object.seal,
|
20
|
+
create = Object.create; // eslint-disable-line import/no-mutable-exports
|
21
|
+
|
22
|
+
var _ref = typeof Reflect !== 'undefined' && Reflect,
|
23
|
+
apply = _ref.apply,
|
24
|
+
construct = _ref.construct;
|
25
|
+
|
26
|
+
if (!apply) {
|
27
|
+
apply = function apply(fun, thisValue, args) {
|
28
|
+
return fun.apply(thisValue, args);
|
29
|
+
};
|
30
|
+
}
|
31
|
+
|
32
|
+
if (!freeze) {
|
33
|
+
freeze = function freeze(x) {
|
34
|
+
return x;
|
35
|
+
};
|
36
|
+
}
|
37
|
+
|
38
|
+
if (!seal) {
|
39
|
+
seal = function seal(x) {
|
40
|
+
return x;
|
41
|
+
};
|
42
|
+
}
|
43
|
+
|
44
|
+
if (!construct) {
|
45
|
+
construct = function construct(Func, args) {
|
46
|
+
return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();
|
47
|
+
};
|
48
|
+
}
|
49
|
+
|
50
|
+
var arrayForEach = unapply(Array.prototype.forEach);
|
51
|
+
var arrayPop = unapply(Array.prototype.pop);
|
52
|
+
var arrayPush = unapply(Array.prototype.push);
|
53
|
+
|
54
|
+
var stringToLowerCase = unapply(String.prototype.toLowerCase);
|
55
|
+
var stringMatch = unapply(String.prototype.match);
|
56
|
+
var stringReplace = unapply(String.prototype.replace);
|
57
|
+
var stringIndexOf = unapply(String.prototype.indexOf);
|
58
|
+
var stringTrim = unapply(String.prototype.trim);
|
59
|
+
|
60
|
+
var regExpTest = unapply(RegExp.prototype.test);
|
61
|
+
|
62
|
+
var typeErrorCreate = unconstruct(TypeError);
|
63
|
+
|
64
|
+
function unapply(func) {
|
65
|
+
return function (thisArg) {
|
66
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
67
|
+
args[_key - 1] = arguments[_key];
|
68
|
+
}
|
69
|
+
|
70
|
+
return apply(func, thisArg, args);
|
71
|
+
};
|
72
|
+
}
|
73
|
+
|
74
|
+
function unconstruct(func) {
|
75
|
+
return function () {
|
76
|
+
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
77
|
+
args[_key2] = arguments[_key2];
|
78
|
+
}
|
79
|
+
|
80
|
+
return construct(func, args);
|
81
|
+
};
|
82
|
+
}
|
83
|
+
|
84
|
+
/* Add properties to a lookup table */
|
85
|
+
function addToSet(set, array) {
|
86
|
+
if (setPrototypeOf) {
|
87
|
+
// Make 'in' and truthy checks like Boolean(set.constructor)
|
88
|
+
// independent of any properties defined on Object.prototype.
|
89
|
+
// Prevent prototype setters from intercepting set as a this value.
|
90
|
+
setPrototypeOf(set, null);
|
91
|
+
}
|
92
|
+
|
93
|
+
var l = array.length;
|
94
|
+
while (l--) {
|
95
|
+
var element = array[l];
|
96
|
+
if (typeof element === 'string') {
|
97
|
+
var lcElement = stringToLowerCase(element);
|
98
|
+
if (lcElement !== element) {
|
99
|
+
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
100
|
+
if (!isFrozen(array)) {
|
101
|
+
array[l] = lcElement;
|
102
|
+
}
|
103
|
+
|
104
|
+
element = lcElement;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
set[element] = true;
|
109
|
+
}
|
110
|
+
|
111
|
+
return set;
|
112
|
+
}
|
113
|
+
|
114
|
+
/* Shallow clone an object */
|
115
|
+
function clone(object) {
|
116
|
+
var newObject = create(null);
|
117
|
+
|
118
|
+
var property = void 0;
|
119
|
+
for (property in object) {
|
120
|
+
if (apply(hasOwnProperty, object, [property])) {
|
121
|
+
newObject[property] = object[property];
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
return newObject;
|
126
|
+
}
|
127
|
+
|
128
|
+
/* IE10 doesn't support __lookupGetter__ so lets'
|
129
|
+
* simulate it. It also automatically checks
|
130
|
+
* if the prop is function or getter and behaves
|
131
|
+
* accordingly. */
|
132
|
+
function lookupGetter(object, prop) {
|
133
|
+
while (object !== null) {
|
134
|
+
var desc = getOwnPropertyDescriptor(object, prop);
|
135
|
+
if (desc) {
|
136
|
+
if (desc.get) {
|
137
|
+
return unapply(desc.get);
|
138
|
+
}
|
139
|
+
|
140
|
+
if (typeof desc.value === 'function') {
|
141
|
+
return unapply(desc.value);
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
object = getPrototypeOf(object);
|
146
|
+
}
|
147
|
+
|
148
|
+
function fallbackValue(element) {
|
149
|
+
console.warn('fallback value for', element);
|
150
|
+
return null;
|
151
|
+
}
|
152
|
+
|
153
|
+
return fallbackValue;
|
154
|
+
}
|
155
|
+
|
156
|
+
var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
157
|
+
|
158
|
+
// SVG
|
159
|
+
var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
160
|
+
|
161
|
+
var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
162
|
+
|
163
|
+
// List of SVG elements that are disallowed by default.
|
164
|
+
// We still need to know them so that we can do namespace
|
165
|
+
// checks properly in case one wants to add them to
|
166
|
+
// allow-list.
|
167
|
+
var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'feimage', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
168
|
+
|
169
|
+
var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);
|
170
|
+
|
171
|
+
// Similarly to SVG, we want to know all MathML elements,
|
172
|
+
// even those that we disallow by default.
|
173
|
+
var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
174
|
+
|
175
|
+
var text = freeze(['#text']);
|
176
|
+
|
177
|
+
var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns']);
|
178
|
+
|
179
|
+
var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
180
|
+
|
181
|
+
var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
182
|
+
|
183
|
+
var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
184
|
+
|
185
|
+
// eslint-disable-next-line unicorn/better-regex
|
186
|
+
var MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
187
|
+
var ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm);
|
188
|
+
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
|
189
|
+
var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
190
|
+
var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
191
|
+
);
|
192
|
+
var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
193
|
+
var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
194
|
+
);
|
195
|
+
|
196
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
197
|
+
|
198
|
+
function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
199
|
+
|
200
|
+
var getGlobal = function getGlobal() {
|
201
|
+
return typeof window === 'undefined' ? null : window;
|
202
|
+
};
|
203
|
+
|
204
|
+
/**
|
205
|
+
* Creates a no-op policy for internal use only.
|
206
|
+
* Don't export this function outside this module!
|
207
|
+
* @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.
|
208
|
+
* @param {Document} document The document object (to determine policy name suffix)
|
209
|
+
* @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types
|
210
|
+
* are not supported).
|
211
|
+
*/
|
212
|
+
var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
|
213
|
+
if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
214
|
+
return null;
|
215
|
+
}
|
216
|
+
|
217
|
+
// Allow the callers to control the unique policy name
|
218
|
+
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
219
|
+
// Policy creation with duplicate names throws in Trusted Types.
|
220
|
+
var suffix = null;
|
221
|
+
var ATTR_NAME = 'data-tt-policy-suffix';
|
222
|
+
if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
|
223
|
+
suffix = document.currentScript.getAttribute(ATTR_NAME);
|
224
|
+
}
|
225
|
+
|
226
|
+
var policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
227
|
+
|
228
|
+
try {
|
229
|
+
return trustedTypes.createPolicy(policyName, {
|
230
|
+
createHTML: function createHTML(html$$1) {
|
231
|
+
return html$$1;
|
232
|
+
}
|
233
|
+
});
|
234
|
+
} catch (_) {
|
235
|
+
// Policy creation failed (most likely another DOMPurify script has
|
236
|
+
// already run). Skip creating the policy, as this will only cause errors
|
237
|
+
// if TT are enforced.
|
238
|
+
console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
|
239
|
+
return null;
|
240
|
+
}
|
241
|
+
};
|
242
|
+
|
243
|
+
function createDOMPurify() {
|
244
|
+
var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
245
|
+
|
246
|
+
var DOMPurify = function DOMPurify(root) {
|
247
|
+
return createDOMPurify(root);
|
248
|
+
};
|
249
|
+
|
250
|
+
/**
|
251
|
+
* Version label, exposed for easier checks
|
252
|
+
* if DOMPurify is up to date or not
|
253
|
+
*/
|
254
|
+
DOMPurify.version = '2.2.7';
|
255
|
+
|
256
|
+
/**
|
257
|
+
* Array of elements that DOMPurify removed during sanitation.
|
258
|
+
* Empty if nothing was removed.
|
259
|
+
*/
|
260
|
+
DOMPurify.removed = [];
|
261
|
+
|
262
|
+
if (!window || !window.document || window.document.nodeType !== 9) {
|
263
|
+
// Not running in a browser, provide a factory function
|
264
|
+
// so that you can pass your own Window
|
265
|
+
DOMPurify.isSupported = false;
|
266
|
+
|
267
|
+
return DOMPurify;
|
268
|
+
}
|
269
|
+
|
270
|
+
var originalDocument = window.document;
|
271
|
+
|
272
|
+
var document = window.document;
|
273
|
+
var DocumentFragment = window.DocumentFragment,
|
274
|
+
HTMLTemplateElement = window.HTMLTemplateElement,
|
275
|
+
Node = window.Node,
|
276
|
+
Element = window.Element,
|
277
|
+
NodeFilter = window.NodeFilter,
|
278
|
+
_window$NamedNodeMap = window.NamedNodeMap,
|
279
|
+
NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,
|
280
|
+
Text = window.Text,
|
281
|
+
Comment = window.Comment,
|
282
|
+
DOMParser = window.DOMParser,
|
283
|
+
trustedTypes = window.trustedTypes;
|
284
|
+
|
285
|
+
|
286
|
+
var ElementPrototype = Element.prototype;
|
287
|
+
|
288
|
+
var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
289
|
+
var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
290
|
+
var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
291
|
+
var getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
292
|
+
|
293
|
+
// As per issue #47, the web-components registry is inherited by a
|
294
|
+
// new document created via createHTMLDocument. As per the spec
|
295
|
+
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
296
|
+
// a new empty registry is used when creating a template contents owner
|
297
|
+
// document, so we use that as our parent document to ensure nothing
|
298
|
+
// is inherited.
|
299
|
+
if (typeof HTMLTemplateElement === 'function') {
|
300
|
+
var template = document.createElement('template');
|
301
|
+
if (template.content && template.content.ownerDocument) {
|
302
|
+
document = template.content.ownerDocument;
|
303
|
+
}
|
304
|
+
}
|
305
|
+
|
306
|
+
var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
|
307
|
+
var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';
|
308
|
+
|
309
|
+
var _document = document,
|
310
|
+
implementation = _document.implementation,
|
311
|
+
createNodeIterator = _document.createNodeIterator,
|
312
|
+
getElementsByTagName = _document.getElementsByTagName,
|
313
|
+
createDocumentFragment = _document.createDocumentFragment;
|
314
|
+
var importNode = originalDocument.importNode;
|
315
|
+
|
316
|
+
|
317
|
+
var documentMode = {};
|
318
|
+
try {
|
319
|
+
documentMode = clone(document).documentMode ? document.documentMode : {};
|
320
|
+
} catch (_) {}
|
321
|
+
|
322
|
+
var hooks = {};
|
323
|
+
|
324
|
+
/**
|
325
|
+
* Expose whether this browser supports running the full DOMPurify.
|
326
|
+
*/
|
327
|
+
DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;
|
328
|
+
|
329
|
+
var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,
|
330
|
+
ERB_EXPR$$1 = ERB_EXPR,
|
331
|
+
DATA_ATTR$$1 = DATA_ATTR,
|
332
|
+
ARIA_ATTR$$1 = ARIA_ATTR,
|
333
|
+
IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,
|
334
|
+
ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;
|
335
|
+
var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;
|
336
|
+
|
337
|
+
/**
|
338
|
+
* We consider the elements and attributes below to be safe. Ideally
|
339
|
+
* don't add any new ones but feel free to remove unwanted ones.
|
340
|
+
*/
|
341
|
+
|
342
|
+
/* allowed element names */
|
343
|
+
|
344
|
+
var ALLOWED_TAGS = null;
|
345
|
+
var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));
|
346
|
+
|
347
|
+
/* Allowed attribute names */
|
348
|
+
var ALLOWED_ATTR = null;
|
349
|
+
var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));
|
350
|
+
|
351
|
+
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
352
|
+
var FORBID_TAGS = null;
|
353
|
+
|
354
|
+
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
355
|
+
var FORBID_ATTR = null;
|
356
|
+
|
357
|
+
/* Decide if ARIA attributes are okay */
|
358
|
+
var ALLOW_ARIA_ATTR = true;
|
359
|
+
|
360
|
+
/* Decide if custom data attributes are okay */
|
361
|
+
var ALLOW_DATA_ATTR = true;
|
362
|
+
|
363
|
+
/* Decide if unknown protocols are okay */
|
364
|
+
var ALLOW_UNKNOWN_PROTOCOLS = false;
|
365
|
+
|
366
|
+
/* Output should be safe for common template engines.
|
367
|
+
* This means, DOMPurify removes data attributes, mustaches and ERB
|
368
|
+
*/
|
369
|
+
var SAFE_FOR_TEMPLATES = false;
|
370
|
+
|
371
|
+
/* Decide if document with <html>... should be returned */
|
372
|
+
var WHOLE_DOCUMENT = false;
|
373
|
+
|
374
|
+
/* Track whether config is already set on this instance of DOMPurify. */
|
375
|
+
var SET_CONFIG = false;
|
376
|
+
|
377
|
+
/* Decide if all elements (e.g. style, script) must be children of
|
378
|
+
* document.body. By default, browsers might move them to document.head */
|
379
|
+
var FORCE_BODY = false;
|
380
|
+
|
381
|
+
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
382
|
+
* string (or a TrustedHTML object if Trusted Types are supported).
|
383
|
+
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
384
|
+
*/
|
385
|
+
var RETURN_DOM = false;
|
386
|
+
|
387
|
+
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
388
|
+
* string (or a TrustedHTML object if Trusted Types are supported) */
|
389
|
+
var RETURN_DOM_FRAGMENT = false;
|
390
|
+
|
391
|
+
/* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM
|
392
|
+
* `Node` is imported into the current `Document`. If this flag is not enabled the
|
393
|
+
* `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by
|
394
|
+
* DOMPurify.
|
395
|
+
*
|
396
|
+
* This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false`
|
397
|
+
* might cause XSS from attacks hidden in closed shadowroots in case the browser
|
398
|
+
* supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/
|
399
|
+
*/
|
400
|
+
var RETURN_DOM_IMPORT = true;
|
401
|
+
|
402
|
+
/* Try to return a Trusted Type object instead of a string, return a string in
|
403
|
+
* case Trusted Types are not supported */
|
404
|
+
var RETURN_TRUSTED_TYPE = false;
|
405
|
+
|
406
|
+
/* Output should be free from DOM clobbering attacks? */
|
407
|
+
var SANITIZE_DOM = true;
|
408
|
+
|
409
|
+
/* Keep element content when removing element? */
|
410
|
+
var KEEP_CONTENT = true;
|
411
|
+
|
412
|
+
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
413
|
+
* of importing it into a new Document and returning a sanitized copy */
|
414
|
+
var IN_PLACE = false;
|
415
|
+
|
416
|
+
/* Allow usage of profiles like html, svg and mathMl */
|
417
|
+
var USE_PROFILES = {};
|
418
|
+
|
419
|
+
/* Tags to ignore content of when KEEP_CONTENT is true */
|
420
|
+
var FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
421
|
+
|
422
|
+
/* Tags that are safe for data: URIs */
|
423
|
+
var DATA_URI_TAGS = null;
|
424
|
+
var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
425
|
+
|
426
|
+
/* Attributes safe for values like "javascript:" */
|
427
|
+
var URI_SAFE_ATTRIBUTES = null;
|
428
|
+
var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']);
|
429
|
+
|
430
|
+
/* Keep a reference to config to pass to hooks */
|
431
|
+
var CONFIG = null;
|
432
|
+
|
433
|
+
/* Ideally, do not touch anything below this line */
|
434
|
+
/* ______________________________________________ */
|
435
|
+
|
436
|
+
var formElement = document.createElement('form');
|
437
|
+
|
438
|
+
/**
|
439
|
+
* _parseConfig
|
440
|
+
*
|
441
|
+
* @param {Object} cfg optional config literal
|
442
|
+
*/
|
443
|
+
// eslint-disable-next-line complexity
|
444
|
+
var _parseConfig = function _parseConfig(cfg) {
|
445
|
+
if (CONFIG && CONFIG === cfg) {
|
446
|
+
return;
|
447
|
+
}
|
448
|
+
|
449
|
+
/* Shield configuration object from tampering */
|
450
|
+
if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {
|
451
|
+
cfg = {};
|
452
|
+
}
|
453
|
+
|
454
|
+
/* Shield configuration object from prototype pollution */
|
455
|
+
cfg = clone(cfg);
|
456
|
+
|
457
|
+
/* Set configuration parameters */
|
458
|
+
ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;
|
459
|
+
ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;
|
460
|
+
URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
461
|
+
DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;
|
462
|
+
FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};
|
463
|
+
FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};
|
464
|
+
USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
|
465
|
+
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
466
|
+
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
467
|
+
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
468
|
+
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
469
|
+
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
470
|
+
RETURN_DOM = cfg.RETURN_DOM || false; // Default false
|
471
|
+
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
|
472
|
+
RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true
|
473
|
+
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
|
474
|
+
FORCE_BODY = cfg.FORCE_BODY || false; // Default false
|
475
|
+
SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
|
476
|
+
KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
|
477
|
+
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
478
|
+
IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;
|
479
|
+
if (SAFE_FOR_TEMPLATES) {
|
480
|
+
ALLOW_DATA_ATTR = false;
|
481
|
+
}
|
482
|
+
|
483
|
+
if (RETURN_DOM_FRAGMENT) {
|
484
|
+
RETURN_DOM = true;
|
485
|
+
}
|
486
|
+
|
487
|
+
/* Parse profile info */
|
488
|
+
if (USE_PROFILES) {
|
489
|
+
ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));
|
490
|
+
ALLOWED_ATTR = [];
|
491
|
+
if (USE_PROFILES.html === true) {
|
492
|
+
addToSet(ALLOWED_TAGS, html);
|
493
|
+
addToSet(ALLOWED_ATTR, html$1);
|
494
|
+
}
|
495
|
+
|
496
|
+
if (USE_PROFILES.svg === true) {
|
497
|
+
addToSet(ALLOWED_TAGS, svg);
|
498
|
+
addToSet(ALLOWED_ATTR, svg$1);
|
499
|
+
addToSet(ALLOWED_ATTR, xml);
|
500
|
+
}
|
501
|
+
|
502
|
+
if (USE_PROFILES.svgFilters === true) {
|
503
|
+
addToSet(ALLOWED_TAGS, svgFilters);
|
504
|
+
addToSet(ALLOWED_ATTR, svg$1);
|
505
|
+
addToSet(ALLOWED_ATTR, xml);
|
506
|
+
}
|
507
|
+
|
508
|
+
if (USE_PROFILES.mathMl === true) {
|
509
|
+
addToSet(ALLOWED_TAGS, mathMl);
|
510
|
+
addToSet(ALLOWED_ATTR, mathMl$1);
|
511
|
+
addToSet(ALLOWED_ATTR, xml);
|
512
|
+
}
|
513
|
+
}
|
514
|
+
|
515
|
+
/* Merge configuration parameters */
|
516
|
+
if (cfg.ADD_TAGS) {
|
517
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
518
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
519
|
+
}
|
520
|
+
|
521
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);
|
522
|
+
}
|
523
|
+
|
524
|
+
if (cfg.ADD_ATTR) {
|
525
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
526
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
527
|
+
}
|
528
|
+
|
529
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);
|
530
|
+
}
|
531
|
+
|
532
|
+
if (cfg.ADD_URI_SAFE_ATTR) {
|
533
|
+
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);
|
534
|
+
}
|
535
|
+
|
536
|
+
/* Add #text in case KEEP_CONTENT is set to true */
|
537
|
+
if (KEEP_CONTENT) {
|
538
|
+
ALLOWED_TAGS['#text'] = true;
|
539
|
+
}
|
540
|
+
|
541
|
+
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
542
|
+
if (WHOLE_DOCUMENT) {
|
543
|
+
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
544
|
+
}
|
545
|
+
|
546
|
+
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
547
|
+
if (ALLOWED_TAGS.table) {
|
548
|
+
addToSet(ALLOWED_TAGS, ['tbody']);
|
549
|
+
delete FORBID_TAGS.tbody;
|
550
|
+
}
|
551
|
+
|
552
|
+
// Prevent further manipulation of configuration.
|
553
|
+
// Not available in IE8, Safari 5, etc.
|
554
|
+
if (freeze) {
|
555
|
+
freeze(cfg);
|
556
|
+
}
|
557
|
+
|
558
|
+
CONFIG = cfg;
|
559
|
+
};
|
560
|
+
|
561
|
+
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
562
|
+
|
563
|
+
var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);
|
564
|
+
|
565
|
+
/* Keep track of all possible SVG and MathML tags
|
566
|
+
* so that we can perform the namespace checks
|
567
|
+
* correctly. */
|
568
|
+
var ALL_SVG_TAGS = addToSet({}, svg);
|
569
|
+
addToSet(ALL_SVG_TAGS, svgFilters);
|
570
|
+
addToSet(ALL_SVG_TAGS, svgDisallowed);
|
571
|
+
|
572
|
+
var ALL_MATHML_TAGS = addToSet({}, mathMl);
|
573
|
+
addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
|
574
|
+
|
575
|
+
var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
576
|
+
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
577
|
+
var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
578
|
+
|
579
|
+
/**
|
580
|
+
*
|
581
|
+
*
|
582
|
+
* @param {Element} element a DOM element whose namespace is being checked
|
583
|
+
* @returns {boolean} Return false if the element has a
|
584
|
+
* namespace that a spec-compliant parser would never
|
585
|
+
* return. Return true otherwise.
|
586
|
+
*/
|
587
|
+
var _checkValidNamespace = function _checkValidNamespace(element) {
|
588
|
+
var parent = getParentNode(element);
|
589
|
+
|
590
|
+
// In JSDOM, if we're inside shadow DOM, then parentNode
|
591
|
+
// can be null. We just simulate parent in this case.
|
592
|
+
if (!parent || !parent.tagName) {
|
593
|
+
parent = {
|
594
|
+
namespaceURI: HTML_NAMESPACE,
|
595
|
+
tagName: 'template'
|
596
|
+
};
|
597
|
+
}
|
598
|
+
|
599
|
+
var tagName = stringToLowerCase(element.tagName);
|
600
|
+
var parentTagName = stringToLowerCase(parent.tagName);
|
601
|
+
|
602
|
+
if (element.namespaceURI === SVG_NAMESPACE) {
|
603
|
+
// The only way to switch from HTML namespace to SVG
|
604
|
+
// is via <svg>. If it happens via any other tag, then
|
605
|
+
// it should be killed.
|
606
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
607
|
+
return tagName === 'svg';
|
608
|
+
}
|
609
|
+
|
610
|
+
// The only way to switch from MathML to SVG is via
|
611
|
+
// svg if parent is either <annotation-xml> or MathML
|
612
|
+
// text integration points.
|
613
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
614
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
615
|
+
}
|
616
|
+
|
617
|
+
// We only allow elements that are defined in SVG
|
618
|
+
// spec. All others are disallowed in SVG namespace.
|
619
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
620
|
+
}
|
621
|
+
|
622
|
+
if (element.namespaceURI === MATHML_NAMESPACE) {
|
623
|
+
// The only way to switch from HTML namespace to MathML
|
624
|
+
// is via <math>. If it happens via any other tag, then
|
625
|
+
// it should be killed.
|
626
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
627
|
+
return tagName === 'math';
|
628
|
+
}
|
629
|
+
|
630
|
+
// The only way to switch from SVG to MathML is via
|
631
|
+
// <math> and HTML integration points
|
632
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
633
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
634
|
+
}
|
635
|
+
|
636
|
+
// We only allow elements that are defined in MathML
|
637
|
+
// spec. All others are disallowed in MathML namespace.
|
638
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
639
|
+
}
|
640
|
+
|
641
|
+
if (element.namespaceURI === HTML_NAMESPACE) {
|
642
|
+
// The only way to switch from SVG to HTML is via
|
643
|
+
// HTML integration points, and from MathML to HTML
|
644
|
+
// is via MathML text integration points
|
645
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
646
|
+
return false;
|
647
|
+
}
|
648
|
+
|
649
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
650
|
+
return false;
|
651
|
+
}
|
652
|
+
|
653
|
+
// Certain elements are allowed in both SVG and HTML
|
654
|
+
// namespace. We need to specify them explicitly
|
655
|
+
// so that they don't get erronously deleted from
|
656
|
+
// HTML namespace.
|
657
|
+
var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
658
|
+
|
659
|
+
// We disallow tags that are specific for MathML
|
660
|
+
// or SVG and should never appear in HTML namespace
|
661
|
+
return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]);
|
662
|
+
}
|
663
|
+
|
664
|
+
// The code should never reach this place (this means
|
665
|
+
// that the element somehow got namespace that is not
|
666
|
+
// HTML, SVG or MathML). Return false just in case.
|
667
|
+
return false;
|
668
|
+
};
|
669
|
+
|
670
|
+
/**
|
671
|
+
* _forceRemove
|
672
|
+
*
|
673
|
+
* @param {Node} node a DOM node
|
674
|
+
*/
|
675
|
+
var _forceRemove = function _forceRemove(node) {
|
676
|
+
arrayPush(DOMPurify.removed, { element: node });
|
677
|
+
try {
|
678
|
+
node.parentNode.removeChild(node);
|
679
|
+
} catch (_) {
|
680
|
+
try {
|
681
|
+
node.outerHTML = emptyHTML;
|
682
|
+
} catch (_) {
|
683
|
+
node.remove();
|
684
|
+
}
|
685
|
+
}
|
686
|
+
};
|
687
|
+
|
688
|
+
/**
|
689
|
+
* _removeAttribute
|
690
|
+
*
|
691
|
+
* @param {String} name an Attribute name
|
692
|
+
* @param {Node} node a DOM node
|
693
|
+
*/
|
694
|
+
var _removeAttribute = function _removeAttribute(name, node) {
|
695
|
+
try {
|
696
|
+
arrayPush(DOMPurify.removed, {
|
697
|
+
attribute: node.getAttributeNode(name),
|
698
|
+
from: node
|
699
|
+
});
|
700
|
+
} catch (_) {
|
701
|
+
arrayPush(DOMPurify.removed, {
|
702
|
+
attribute: null,
|
703
|
+
from: node
|
704
|
+
});
|
705
|
+
}
|
706
|
+
|
707
|
+
node.removeAttribute(name);
|
708
|
+
|
709
|
+
// We void attribute values for unremovable "is"" attributes
|
710
|
+
if (name === 'is' && !ALLOWED_ATTR[name]) {
|
711
|
+
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
712
|
+
try {
|
713
|
+
_forceRemove(node);
|
714
|
+
} catch (_) {}
|
715
|
+
} else {
|
716
|
+
try {
|
717
|
+
node.setAttribute(name, '');
|
718
|
+
} catch (_) {}
|
719
|
+
}
|
720
|
+
}
|
721
|
+
};
|
722
|
+
|
723
|
+
/**
|
724
|
+
* _initDocument
|
725
|
+
*
|
726
|
+
* @param {String} dirty a string of dirty markup
|
727
|
+
* @return {Document} a DOM, filled with the dirty markup
|
728
|
+
*/
|
729
|
+
var _initDocument = function _initDocument(dirty) {
|
730
|
+
/* Create a HTML document */
|
731
|
+
var doc = void 0;
|
732
|
+
var leadingWhitespace = void 0;
|
733
|
+
|
734
|
+
if (FORCE_BODY) {
|
735
|
+
dirty = '<remove></remove>' + dirty;
|
736
|
+
} else {
|
737
|
+
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
738
|
+
var matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
739
|
+
leadingWhitespace = matches && matches[0];
|
740
|
+
}
|
741
|
+
|
742
|
+
var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
743
|
+
/* Use the DOMParser API by default, fallback later if needs be */
|
744
|
+
try {
|
745
|
+
doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');
|
746
|
+
} catch (_) {}
|
747
|
+
|
748
|
+
/* Use createHTMLDocument in case DOMParser is not available */
|
749
|
+
if (!doc || !doc.documentElement) {
|
750
|
+
doc = implementation.createHTMLDocument('');
|
751
|
+
var _doc = doc,
|
752
|
+
body = _doc.body;
|
753
|
+
|
754
|
+
body.parentNode.removeChild(body.parentNode.firstElementChild);
|
755
|
+
body.outerHTML = dirtyPayload;
|
756
|
+
}
|
757
|
+
|
758
|
+
if (dirty && leadingWhitespace) {
|
759
|
+
doc.body.insertBefore(document.createTextNode(leadingWhitespace), doc.body.childNodes[0] || null);
|
760
|
+
}
|
761
|
+
|
762
|
+
/* Work on whole document or just its body */
|
763
|
+
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
764
|
+
};
|
765
|
+
|
766
|
+
/**
|
767
|
+
* _createIterator
|
768
|
+
*
|
769
|
+
* @param {Document} root document/fragment to create iterator for
|
770
|
+
* @return {Iterator} iterator instance
|
771
|
+
*/
|
772
|
+
var _createIterator = function _createIterator(root) {
|
773
|
+
return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, function () {
|
774
|
+
return NodeFilter.FILTER_ACCEPT;
|
775
|
+
}, false);
|
776
|
+
};
|
777
|
+
|
778
|
+
/**
|
779
|
+
* _isClobbered
|
780
|
+
*
|
781
|
+
* @param {Node} elm element to check for clobbering attacks
|
782
|
+
* @return {Boolean} true if clobbered, false if safe
|
783
|
+
*/
|
784
|
+
var _isClobbered = function _isClobbered(elm) {
|
785
|
+
if (elm instanceof Text || elm instanceof Comment) {
|
786
|
+
return false;
|
787
|
+
}
|
788
|
+
|
789
|
+
if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') {
|
790
|
+
return true;
|
791
|
+
}
|
792
|
+
|
793
|
+
return false;
|
794
|
+
};
|
795
|
+
|
796
|
+
/**
|
797
|
+
* _isNode
|
798
|
+
*
|
799
|
+
* @param {Node} obj object to check whether it's a DOM node
|
800
|
+
* @return {Boolean} true is object is a DOM node
|
801
|
+
*/
|
802
|
+
var _isNode = function _isNode(object) {
|
803
|
+
return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
|
804
|
+
};
|
805
|
+
|
806
|
+
/**
|
807
|
+
* _executeHook
|
808
|
+
* Execute user configurable hooks
|
809
|
+
*
|
810
|
+
* @param {String} entryPoint Name of the hook's entry point
|
811
|
+
* @param {Node} currentNode node to work on with the hook
|
812
|
+
* @param {Object} data additional hook parameters
|
813
|
+
*/
|
814
|
+
var _executeHook = function _executeHook(entryPoint, currentNode, data) {
|
815
|
+
if (!hooks[entryPoint]) {
|
816
|
+
return;
|
817
|
+
}
|
818
|
+
|
819
|
+
arrayForEach(hooks[entryPoint], function (hook) {
|
820
|
+
hook.call(DOMPurify, currentNode, data, CONFIG);
|
821
|
+
});
|
822
|
+
};
|
823
|
+
|
824
|
+
/**
|
825
|
+
* _sanitizeElements
|
826
|
+
*
|
827
|
+
* @protect nodeName
|
828
|
+
* @protect textContent
|
829
|
+
* @protect removeChild
|
830
|
+
*
|
831
|
+
* @param {Node} currentNode to check for permission to exist
|
832
|
+
* @return {Boolean} true if node was killed, false if left alive
|
833
|
+
*/
|
834
|
+
var _sanitizeElements = function _sanitizeElements(currentNode) {
|
835
|
+
var content = void 0;
|
836
|
+
|
837
|
+
/* Execute a hook if present */
|
838
|
+
_executeHook('beforeSanitizeElements', currentNode, null);
|
839
|
+
|
840
|
+
/* Check if element is clobbered or can clobber */
|
841
|
+
if (_isClobbered(currentNode)) {
|
842
|
+
_forceRemove(currentNode);
|
843
|
+
return true;
|
844
|
+
}
|
845
|
+
|
846
|
+
/* Check if tagname contains Unicode */
|
847
|
+
if (stringMatch(currentNode.nodeName, /[\u0080-\uFFFF]/)) {
|
848
|
+
_forceRemove(currentNode);
|
849
|
+
return true;
|
850
|
+
}
|
851
|
+
|
852
|
+
/* Now let's check the element's type and name */
|
853
|
+
var tagName = stringToLowerCase(currentNode.nodeName);
|
854
|
+
|
855
|
+
/* Execute a hook if present */
|
856
|
+
_executeHook('uponSanitizeElement', currentNode, {
|
857
|
+
tagName: tagName,
|
858
|
+
allowedTags: ALLOWED_TAGS
|
859
|
+
});
|
860
|
+
|
861
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
862
|
+
if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
|
863
|
+
_forceRemove(currentNode);
|
864
|
+
return true;
|
865
|
+
}
|
866
|
+
|
867
|
+
/* Remove element if anything forbids its presence */
|
868
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
869
|
+
/* Keep content except for bad-listed elements */
|
870
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
871
|
+
var parentNode = getParentNode(currentNode);
|
872
|
+
var childNodes = getChildNodes(currentNode);
|
873
|
+
|
874
|
+
if (childNodes && parentNode) {
|
875
|
+
var childCount = childNodes.length;
|
876
|
+
|
877
|
+
for (var i = childCount - 1; i >= 0; --i) {
|
878
|
+
parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
|
879
|
+
}
|
880
|
+
}
|
881
|
+
}
|
882
|
+
|
883
|
+
_forceRemove(currentNode);
|
884
|
+
return true;
|
885
|
+
}
|
886
|
+
|
887
|
+
/* Check whether element has a valid namespace */
|
888
|
+
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
889
|
+
_forceRemove(currentNode);
|
890
|
+
return true;
|
891
|
+
}
|
892
|
+
|
893
|
+
if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
|
894
|
+
_forceRemove(currentNode);
|
895
|
+
return true;
|
896
|
+
}
|
897
|
+
|
898
|
+
/* Sanitize element content to be template-safe */
|
899
|
+
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
|
900
|
+
/* Get the element's text content */
|
901
|
+
content = currentNode.textContent;
|
902
|
+
content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');
|
903
|
+
content = stringReplace(content, ERB_EXPR$$1, ' ');
|
904
|
+
if (currentNode.textContent !== content) {
|
905
|
+
arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
|
906
|
+
currentNode.textContent = content;
|
907
|
+
}
|
908
|
+
}
|
909
|
+
|
910
|
+
/* Execute a hook if present */
|
911
|
+
_executeHook('afterSanitizeElements', currentNode, null);
|
912
|
+
|
913
|
+
return false;
|
914
|
+
};
|
915
|
+
|
916
|
+
/**
|
917
|
+
* _isValidAttribute
|
918
|
+
*
|
919
|
+
* @param {string} lcTag Lowercase tag name of containing element.
|
920
|
+
* @param {string} lcName Lowercase attribute name.
|
921
|
+
* @param {string} value Attribute value.
|
922
|
+
* @return {Boolean} Returns true if `value` is valid, otherwise false.
|
923
|
+
*/
|
924
|
+
// eslint-disable-next-line complexity
|
925
|
+
var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
926
|
+
/* Make sure attribute cannot clobber */
|
927
|
+
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
928
|
+
return false;
|
929
|
+
}
|
930
|
+
|
931
|
+
/* Allow valid data-* attributes: At least one character after "-"
|
932
|
+
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
933
|
+
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
934
|
+
We don't need to check the value; it's always URI safe. */
|
935
|
+
if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
936
|
+
return false;
|
937
|
+
|
938
|
+
/* Check value is safe. First, is attr inert? If so, is safe */
|
939
|
+
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {
|
940
|
+
return false;
|
941
|
+
}
|
942
|
+
|
943
|
+
return true;
|
944
|
+
};
|
945
|
+
|
946
|
+
/**
|
947
|
+
* _sanitizeAttributes
|
948
|
+
*
|
949
|
+
* @protect attributes
|
950
|
+
* @protect nodeName
|
951
|
+
* @protect removeAttribute
|
952
|
+
* @protect setAttribute
|
953
|
+
*
|
954
|
+
* @param {Node} currentNode to sanitize
|
955
|
+
*/
|
956
|
+
var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
957
|
+
var attr = void 0;
|
958
|
+
var value = void 0;
|
959
|
+
var lcName = void 0;
|
960
|
+
var l = void 0;
|
961
|
+
/* Execute a hook if present */
|
962
|
+
_executeHook('beforeSanitizeAttributes', currentNode, null);
|
963
|
+
|
964
|
+
var attributes = currentNode.attributes;
|
965
|
+
|
966
|
+
/* Check if we have attributes; if not we might have a text node */
|
967
|
+
|
968
|
+
if (!attributes) {
|
969
|
+
return;
|
970
|
+
}
|
971
|
+
|
972
|
+
var hookEvent = {
|
973
|
+
attrName: '',
|
974
|
+
attrValue: '',
|
975
|
+
keepAttr: true,
|
976
|
+
allowedAttributes: ALLOWED_ATTR
|
977
|
+
};
|
978
|
+
l = attributes.length;
|
979
|
+
|
980
|
+
/* Go backwards over all attributes; safely remove bad ones */
|
981
|
+
while (l--) {
|
982
|
+
attr = attributes[l];
|
983
|
+
var _attr = attr,
|
984
|
+
name = _attr.name,
|
985
|
+
namespaceURI = _attr.namespaceURI;
|
986
|
+
|
987
|
+
value = stringTrim(attr.value);
|
988
|
+
lcName = stringToLowerCase(name);
|
989
|
+
|
990
|
+
/* Execute a hook if present */
|
991
|
+
hookEvent.attrName = lcName;
|
992
|
+
hookEvent.attrValue = value;
|
993
|
+
hookEvent.keepAttr = true;
|
994
|
+
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
995
|
+
_executeHook('uponSanitizeAttribute', currentNode, hookEvent);
|
996
|
+
value = hookEvent.attrValue;
|
997
|
+
/* Did the hooks approve of the attribute? */
|
998
|
+
if (hookEvent.forceKeepAttr) {
|
999
|
+
continue;
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
/* Remove attribute */
|
1003
|
+
_removeAttribute(name, currentNode);
|
1004
|
+
|
1005
|
+
/* Did the hooks approve of the attribute? */
|
1006
|
+
if (!hookEvent.keepAttr) {
|
1007
|
+
continue;
|
1008
|
+
}
|
1009
|
+
|
1010
|
+
/* Work around a security issue in jQuery 3.0 */
|
1011
|
+
if (regExpTest(/\/>/i, value)) {
|
1012
|
+
_removeAttribute(name, currentNode);
|
1013
|
+
continue;
|
1014
|
+
}
|
1015
|
+
|
1016
|
+
/* Sanitize attribute content to be template-safe */
|
1017
|
+
if (SAFE_FOR_TEMPLATES) {
|
1018
|
+
value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');
|
1019
|
+
value = stringReplace(value, ERB_EXPR$$1, ' ');
|
1020
|
+
}
|
1021
|
+
|
1022
|
+
/* Is `value` valid for this attribute? */
|
1023
|
+
var lcTag = currentNode.nodeName.toLowerCase();
|
1024
|
+
if (!_isValidAttribute(lcTag, lcName, value)) {
|
1025
|
+
continue;
|
1026
|
+
}
|
1027
|
+
|
1028
|
+
/* Handle invalid data-* attribute set by try-catching it */
|
1029
|
+
try {
|
1030
|
+
if (namespaceURI) {
|
1031
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
1032
|
+
} else {
|
1033
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
1034
|
+
currentNode.setAttribute(name, value);
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
arrayPop(DOMPurify.removed);
|
1038
|
+
} catch (_) {}
|
1039
|
+
}
|
1040
|
+
|
1041
|
+
/* Execute a hook if present */
|
1042
|
+
_executeHook('afterSanitizeAttributes', currentNode, null);
|
1043
|
+
};
|
1044
|
+
|
1045
|
+
/**
|
1046
|
+
* _sanitizeShadowDOM
|
1047
|
+
*
|
1048
|
+
* @param {DocumentFragment} fragment to iterate over recursively
|
1049
|
+
*/
|
1050
|
+
var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
1051
|
+
var shadowNode = void 0;
|
1052
|
+
var shadowIterator = _createIterator(fragment);
|
1053
|
+
|
1054
|
+
/* Execute a hook if present */
|
1055
|
+
_executeHook('beforeSanitizeShadowDOM', fragment, null);
|
1056
|
+
|
1057
|
+
while (shadowNode = shadowIterator.nextNode()) {
|
1058
|
+
/* Execute a hook if present */
|
1059
|
+
_executeHook('uponSanitizeShadowNode', shadowNode, null);
|
1060
|
+
|
1061
|
+
/* Sanitize tags and elements */
|
1062
|
+
if (_sanitizeElements(shadowNode)) {
|
1063
|
+
continue;
|
1064
|
+
}
|
1065
|
+
|
1066
|
+
/* Deep shadow DOM detected */
|
1067
|
+
if (shadowNode.content instanceof DocumentFragment) {
|
1068
|
+
_sanitizeShadowDOM(shadowNode.content);
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
/* Check attributes, sanitize if necessary */
|
1072
|
+
_sanitizeAttributes(shadowNode);
|
1073
|
+
}
|
1074
|
+
|
1075
|
+
/* Execute a hook if present */
|
1076
|
+
_executeHook('afterSanitizeShadowDOM', fragment, null);
|
1077
|
+
};
|
1078
|
+
|
1079
|
+
/**
|
1080
|
+
* Sanitize
|
1081
|
+
* Public method providing core sanitation functionality
|
1082
|
+
*
|
1083
|
+
* @param {String|Node} dirty string or DOM node
|
1084
|
+
* @param {Object} configuration object
|
1085
|
+
*/
|
1086
|
+
// eslint-disable-next-line complexity
|
1087
|
+
DOMPurify.sanitize = function (dirty, cfg) {
|
1088
|
+
var body = void 0;
|
1089
|
+
var importedNode = void 0;
|
1090
|
+
var currentNode = void 0;
|
1091
|
+
var oldNode = void 0;
|
1092
|
+
var returnNode = void 0;
|
1093
|
+
/* Make sure we have a string to sanitize.
|
1094
|
+
DO NOT return early, as this will return the wrong type if
|
1095
|
+
the user has requested a DOM object rather than a string */
|
1096
|
+
if (!dirty) {
|
1097
|
+
dirty = '<!-->';
|
1098
|
+
}
|
1099
|
+
|
1100
|
+
/* Stringify, in case dirty is an object */
|
1101
|
+
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
1102
|
+
// eslint-disable-next-line no-negated-condition
|
1103
|
+
if (typeof dirty.toString !== 'function') {
|
1104
|
+
throw typeErrorCreate('toString is not a function');
|
1105
|
+
} else {
|
1106
|
+
dirty = dirty.toString();
|
1107
|
+
if (typeof dirty !== 'string') {
|
1108
|
+
throw typeErrorCreate('dirty is not a string, aborting');
|
1109
|
+
}
|
1110
|
+
}
|
1111
|
+
}
|
1112
|
+
|
1113
|
+
/* Check we can run. Otherwise fall back or ignore */
|
1114
|
+
if (!DOMPurify.isSupported) {
|
1115
|
+
if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
|
1116
|
+
if (typeof dirty === 'string') {
|
1117
|
+
return window.toStaticHTML(dirty);
|
1118
|
+
}
|
1119
|
+
|
1120
|
+
if (_isNode(dirty)) {
|
1121
|
+
return window.toStaticHTML(dirty.outerHTML);
|
1122
|
+
}
|
1123
|
+
}
|
1124
|
+
|
1125
|
+
return dirty;
|
1126
|
+
}
|
1127
|
+
|
1128
|
+
/* Assign config vars */
|
1129
|
+
if (!SET_CONFIG) {
|
1130
|
+
_parseConfig(cfg);
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
/* Clean up removed elements */
|
1134
|
+
DOMPurify.removed = [];
|
1135
|
+
|
1136
|
+
/* Check if dirty is correctly typed for IN_PLACE */
|
1137
|
+
if (typeof dirty === 'string') {
|
1138
|
+
IN_PLACE = false;
|
1139
|
+
}
|
1140
|
+
|
1141
|
+
if (IN_PLACE) ; else if (dirty instanceof Node) {
|
1142
|
+
/* If dirty is a DOM element, append to an empty document to avoid
|
1143
|
+
elements being stripped by the parser */
|
1144
|
+
body = _initDocument('<!---->');
|
1145
|
+
importedNode = body.ownerDocument.importNode(dirty, true);
|
1146
|
+
if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {
|
1147
|
+
/* Node is already a body, use as is */
|
1148
|
+
body = importedNode;
|
1149
|
+
} else if (importedNode.nodeName === 'HTML') {
|
1150
|
+
body = importedNode;
|
1151
|
+
} else {
|
1152
|
+
// eslint-disable-next-line unicorn/prefer-node-append
|
1153
|
+
body.appendChild(importedNode);
|
1154
|
+
}
|
1155
|
+
} else {
|
1156
|
+
/* Exit directly if we have nothing to do */
|
1157
|
+
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
1158
|
+
// eslint-disable-next-line unicorn/prefer-includes
|
1159
|
+
dirty.indexOf('<') === -1) {
|
1160
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
1161
|
+
}
|
1162
|
+
|
1163
|
+
/* Initialize the document to work on */
|
1164
|
+
body = _initDocument(dirty);
|
1165
|
+
|
1166
|
+
/* Check we have a DOM node from the data */
|
1167
|
+
if (!body) {
|
1168
|
+
return RETURN_DOM ? null : emptyHTML;
|
1169
|
+
}
|
1170
|
+
}
|
1171
|
+
|
1172
|
+
/* Remove first element node (ours) if FORCE_BODY is set */
|
1173
|
+
if (body && FORCE_BODY) {
|
1174
|
+
_forceRemove(body.firstChild);
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
/* Get node iterator */
|
1178
|
+
var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
|
1179
|
+
|
1180
|
+
/* Now start iterating over the created document */
|
1181
|
+
while (currentNode = nodeIterator.nextNode()) {
|
1182
|
+
/* Fix IE's strange behavior with manipulated textNodes #89 */
|
1183
|
+
if (currentNode.nodeType === 3 && currentNode === oldNode) {
|
1184
|
+
continue;
|
1185
|
+
}
|
1186
|
+
|
1187
|
+
/* Sanitize tags and elements */
|
1188
|
+
if (_sanitizeElements(currentNode)) {
|
1189
|
+
continue;
|
1190
|
+
}
|
1191
|
+
|
1192
|
+
/* Shadow DOM detected, sanitize it */
|
1193
|
+
if (currentNode.content instanceof DocumentFragment) {
|
1194
|
+
_sanitizeShadowDOM(currentNode.content);
|
1195
|
+
}
|
1196
|
+
|
1197
|
+
/* Check attributes, sanitize if necessary */
|
1198
|
+
_sanitizeAttributes(currentNode);
|
1199
|
+
|
1200
|
+
oldNode = currentNode;
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
oldNode = null;
|
1204
|
+
|
1205
|
+
/* If we sanitized `dirty` in-place, return it. */
|
1206
|
+
if (IN_PLACE) {
|
1207
|
+
return dirty;
|
1208
|
+
}
|
1209
|
+
|
1210
|
+
/* Return sanitized string or DOM */
|
1211
|
+
if (RETURN_DOM) {
|
1212
|
+
if (RETURN_DOM_FRAGMENT) {
|
1213
|
+
returnNode = createDocumentFragment.call(body.ownerDocument);
|
1214
|
+
|
1215
|
+
while (body.firstChild) {
|
1216
|
+
// eslint-disable-next-line unicorn/prefer-node-append
|
1217
|
+
returnNode.appendChild(body.firstChild);
|
1218
|
+
}
|
1219
|
+
} else {
|
1220
|
+
returnNode = body;
|
1221
|
+
}
|
1222
|
+
|
1223
|
+
if (RETURN_DOM_IMPORT) {
|
1224
|
+
/*
|
1225
|
+
AdoptNode() is not used because internal state is not reset
|
1226
|
+
(e.g. the past names map of a HTMLFormElement), this is safe
|
1227
|
+
in theory but we would rather not risk another attack vector.
|
1228
|
+
The state that is cloned by importNode() is explicitly defined
|
1229
|
+
by the specs.
|
1230
|
+
*/
|
1231
|
+
returnNode = importNode.call(originalDocument, returnNode, true);
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
return returnNode;
|
1235
|
+
}
|
1236
|
+
|
1237
|
+
var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
1238
|
+
|
1239
|
+
/* Sanitize final string template-safe */
|
1240
|
+
if (SAFE_FOR_TEMPLATES) {
|
1241
|
+
serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');
|
1242
|
+
serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');
|
1243
|
+
}
|
1244
|
+
|
1245
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
1246
|
+
};
|
1247
|
+
|
1248
|
+
/**
|
1249
|
+
* Public method to set the configuration once
|
1250
|
+
* setConfig
|
1251
|
+
*
|
1252
|
+
* @param {Object} cfg configuration object
|
1253
|
+
*/
|
1254
|
+
DOMPurify.setConfig = function (cfg) {
|
1255
|
+
_parseConfig(cfg);
|
1256
|
+
SET_CONFIG = true;
|
1257
|
+
};
|
1258
|
+
|
1259
|
+
/**
|
1260
|
+
* Public method to remove the configuration
|
1261
|
+
* clearConfig
|
1262
|
+
*
|
1263
|
+
*/
|
1264
|
+
DOMPurify.clearConfig = function () {
|
1265
|
+
CONFIG = null;
|
1266
|
+
SET_CONFIG = false;
|
1267
|
+
};
|
1268
|
+
|
1269
|
+
/**
|
1270
|
+
* Public method to check if an attribute value is valid.
|
1271
|
+
* Uses last set config, if any. Otherwise, uses config defaults.
|
1272
|
+
* isValidAttribute
|
1273
|
+
*
|
1274
|
+
* @param {string} tag Tag name of containing element.
|
1275
|
+
* @param {string} attr Attribute name.
|
1276
|
+
* @param {string} value Attribute value.
|
1277
|
+
* @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
|
1278
|
+
*/
|
1279
|
+
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
1280
|
+
/* Initialize shared config vars if necessary. */
|
1281
|
+
if (!CONFIG) {
|
1282
|
+
_parseConfig({});
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
var lcTag = stringToLowerCase(tag);
|
1286
|
+
var lcName = stringToLowerCase(attr);
|
1287
|
+
return _isValidAttribute(lcTag, lcName, value);
|
1288
|
+
};
|
1289
|
+
|
1290
|
+
/**
|
1291
|
+
* AddHook
|
1292
|
+
* Public method to add DOMPurify hooks
|
1293
|
+
*
|
1294
|
+
* @param {String} entryPoint entry point for the hook to add
|
1295
|
+
* @param {Function} hookFunction function to execute
|
1296
|
+
*/
|
1297
|
+
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
1298
|
+
if (typeof hookFunction !== 'function') {
|
1299
|
+
return;
|
1300
|
+
}
|
1301
|
+
|
1302
|
+
hooks[entryPoint] = hooks[entryPoint] || [];
|
1303
|
+
arrayPush(hooks[entryPoint], hookFunction);
|
1304
|
+
};
|
1305
|
+
|
1306
|
+
/**
|
1307
|
+
* RemoveHook
|
1308
|
+
* Public method to remove a DOMPurify hook at a given entryPoint
|
1309
|
+
* (pops it from the stack of hooks if more are present)
|
1310
|
+
*
|
1311
|
+
* @param {String} entryPoint entry point for the hook to remove
|
1312
|
+
*/
|
1313
|
+
DOMPurify.removeHook = function (entryPoint) {
|
1314
|
+
if (hooks[entryPoint]) {
|
1315
|
+
arrayPop(hooks[entryPoint]);
|
1316
|
+
}
|
1317
|
+
};
|
1318
|
+
|
1319
|
+
/**
|
1320
|
+
* RemoveHooks
|
1321
|
+
* Public method to remove all DOMPurify hooks at a given entryPoint
|
1322
|
+
*
|
1323
|
+
* @param {String} entryPoint entry point for the hooks to remove
|
1324
|
+
*/
|
1325
|
+
DOMPurify.removeHooks = function (entryPoint) {
|
1326
|
+
if (hooks[entryPoint]) {
|
1327
|
+
hooks[entryPoint] = [];
|
1328
|
+
}
|
1329
|
+
};
|
1330
|
+
|
1331
|
+
/**
|
1332
|
+
* RemoveAllHooks
|
1333
|
+
* Public method to remove all DOMPurify hooks
|
1334
|
+
*
|
1335
|
+
*/
|
1336
|
+
DOMPurify.removeAllHooks = function () {
|
1337
|
+
hooks = {};
|
1338
|
+
};
|
1339
|
+
|
1340
|
+
return DOMPurify;
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
var purify = createDOMPurify();
|
1344
|
+
|
1345
|
+
return purify;
|
1346
|
+
|
1347
|
+
}));
|
1348
|
+
|
1349
|
+
});
|
1350
|
+
|
1351
|
+
const purify$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), purify, {
|
1352
|
+
'default': purify
|
1353
|
+
}));
|
1354
|
+
|
1355
|
+
exports.purify = purify$1;
|