@maggioli-design-system/magma 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/cjs/{floating-controller-BxER7sig.js → floating-controller-BiwDIKXd.js} +1 -1
- package/dist/cjs/mds-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/mds-emoji.cjs.entry.js +35 -5
- package/dist/cjs/mds-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/mds-input-switch_2.cjs.entry.js +1 -1
- package/dist/cjs/mds-modal.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref-mode.cjs.entry.js +1 -1
- package/dist/cjs/mds-push-notification.cjs.entry.js +1 -1
- package/dist/cjs/mds-radial-menu.cjs.entry.js +2 -2
- package/dist/cjs/mds-tab_2.cjs.entry.js +1 -1
- package/dist/cjs/mds-toast.cjs.entry.js +1 -1
- package/dist/cjs/mds-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/mds-tree-item.cjs.entry.js +2 -2
- package/dist/cjs/{unit-Cm341q1R.js → unit-JdmHaLT3.js} +1 -1
- package/dist/collection/common/unit.js +1 -1
- package/dist/collection/components/mds-accordion/AGENTS.md +1 -1
- package/dist/collection/components/mds-accordion/documentation.json +1 -1
- package/dist/collection/components/mds-accordion-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-accordion-item/documentation.json +1 -1
- package/dist/collection/components/mds-accordion-timer/AGENTS.md +1 -1
- package/dist/collection/components/mds-accordion-timer/documentation.json +1 -1
- package/dist/collection/components/mds-accordion-timer-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-accordion-timer-item/documentation.json +1 -1
- package/dist/collection/components/mds-author/AGENTS.md +1 -1
- package/dist/collection/components/mds-author/documentation.json +1 -1
- package/dist/collection/components/mds-avatar/AGENTS.md +1 -1
- package/dist/collection/components/mds-avatar/documentation.json +1 -1
- package/dist/collection/components/mds-avatar-stack/AGENTS.md +1 -1
- package/dist/collection/components/mds-avatar-stack/documentation.json +1 -1
- package/dist/collection/components/mds-avatar-stack-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-avatar-stack-item/documentation.json +1 -1
- package/dist/collection/components/mds-badge/AGENTS.md +1 -1
- package/dist/collection/components/mds-badge/documentation.json +1 -1
- package/dist/collection/components/mds-banner/AGENTS.md +1 -1
- package/dist/collection/components/mds-banner/documentation.json +1 -1
- package/dist/collection/components/mds-benchmark-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-benchmark-bar/documentation.json +1 -1
- package/dist/collection/components/mds-bibliography/AGENTS.md +1 -1
- package/dist/collection/components/mds-bibliography/documentation.json +1 -1
- package/dist/collection/components/mds-breadcrumb/AGENTS.md +1 -1
- package/dist/collection/components/mds-breadcrumb/documentation.json +1 -1
- package/dist/collection/components/mds-breadcrumb-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-breadcrumb-item/documentation.json +1 -1
- package/dist/collection/components/mds-button/AGENTS.md +1 -1
- package/dist/collection/components/mds-button/documentation.json +1 -1
- package/dist/collection/components/mds-button-dropdown/AGENTS.md +1 -1
- package/dist/collection/components/mds-button-dropdown/documentation.json +1 -1
- package/dist/collection/components/mds-button-group/AGENTS.md +1 -1
- package/dist/collection/components/mds-button-group/documentation.json +1 -1
- package/dist/collection/components/mds-calendar/AGENTS.md +1 -1
- package/dist/collection/components/mds-calendar/documentation.json +1 -1
- package/dist/collection/components/mds-calendar-cell/AGENTS.md +1 -1
- package/dist/collection/components/mds-calendar-cell/documentation.json +1 -1
- package/dist/collection/components/mds-card/AGENTS.md +1 -1
- package/dist/collection/components/mds-card/documentation.json +1 -1
- package/dist/collection/components/mds-card-content/AGENTS.md +1 -1
- package/dist/collection/components/mds-card-content/documentation.json +1 -1
- package/dist/collection/components/mds-card-footer/AGENTS.md +1 -1
- package/dist/collection/components/mds-card-footer/documentation.json +1 -1
- package/dist/collection/components/mds-card-header/AGENTS.md +1 -1
- package/dist/collection/components/mds-card-header/documentation.json +1 -1
- package/dist/collection/components/mds-card-media/AGENTS.md +1 -1
- package/dist/collection/components/mds-card-media/documentation.json +1 -1
- package/dist/collection/components/mds-chip/AGENTS.md +1 -1
- package/dist/collection/components/mds-chip/documentation.json +1 -1
- package/dist/collection/components/mds-details/AGENTS.md +1 -1
- package/dist/collection/components/mds-details/documentation.json +1 -1
- package/dist/collection/components/mds-dropdown/AGENTS.md +1 -1
- package/dist/collection/components/mds-dropdown/documentation.json +1 -1
- package/dist/collection/components/mds-emoji/AGENTS.md +2 -2
- package/dist/collection/components/mds-emoji/documentation.json +2 -2
- package/dist/collection/components/mds-emoji/mds-emoji.js +34 -4
- package/dist/collection/components/mds-entity/AGENTS.md +1 -1
- package/dist/collection/components/mds-entity/documentation.json +1 -1
- package/dist/collection/components/mds-file/AGENTS.md +1 -1
- package/dist/collection/components/mds-file/documentation.json +1 -1
- package/dist/collection/components/mds-file-preview/AGENTS.md +1 -1
- package/dist/collection/components/mds-file-preview/documentation.json +1 -1
- package/dist/collection/components/mds-filter/AGENTS.md +1 -1
- package/dist/collection/components/mds-filter/documentation.json +1 -1
- package/dist/collection/components/mds-filter-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-filter-item/documentation.json +1 -1
- package/dist/collection/components/mds-header/AGENTS.md +1 -1
- package/dist/collection/components/mds-header/documentation.json +1 -1
- package/dist/collection/components/mds-header-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-header-bar/documentation.json +1 -1
- package/dist/collection/components/mds-help/AGENTS.md +1 -1
- package/dist/collection/components/mds-help/documentation.json +1 -1
- package/dist/collection/components/mds-horizontal-scroll/AGENTS.md +1 -1
- package/dist/collection/components/mds-horizontal-scroll/documentation.json +1 -1
- package/dist/collection/components/mds-hr/AGENTS.md +1 -1
- package/dist/collection/components/mds-hr/documentation.json +1 -1
- package/dist/collection/components/mds-icon/AGENTS.md +1 -1
- package/dist/collection/components/mds-icon/documentation.json +1 -1
- package/dist/collection/components/mds-img/AGENTS.md +1 -1
- package/dist/collection/components/mds-img/documentation.json +1 -1
- package/dist/collection/components/mds-input/AGENTS.md +1 -1
- package/dist/collection/components/mds-input/documentation.json +1 -1
- package/dist/collection/components/mds-input-date/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-date/documentation.json +1 -1
- package/dist/collection/components/mds-input-date-range/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-date-range/documentation.json +1 -1
- package/dist/collection/components/mds-input-date-range-preselection/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-date-range-preselection/documentation.json +1 -1
- package/dist/collection/components/mds-input-field/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-field/documentation.json +1 -1
- package/dist/collection/components/mds-input-otp/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-otp/documentation.json +1 -1
- package/dist/collection/components/mds-input-range/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-range/documentation.json +1 -1
- package/dist/collection/components/mds-input-select/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-select/documentation.json +1 -1
- package/dist/collection/components/mds-input-switch/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-switch/documentation.json +1 -1
- package/dist/collection/components/mds-input-switch/mds-input-switch.css +5 -3
- package/dist/collection/components/mds-input-tip/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-tip/documentation.json +1 -1
- package/dist/collection/components/mds-input-tip-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-tip-item/documentation.json +1 -1
- package/dist/collection/components/mds-input-upload/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-upload/documentation.json +1 -1
- package/dist/collection/components/mds-keyboard/AGENTS.md +1 -1
- package/dist/collection/components/mds-keyboard/documentation.json +1 -1
- package/dist/collection/components/mds-keyboard-key/AGENTS.md +1 -1
- package/dist/collection/components/mds-keyboard-key/documentation.json +1 -1
- package/dist/collection/components/mds-kpi/AGENTS.md +1 -1
- package/dist/collection/components/mds-kpi/documentation.json +1 -1
- package/dist/collection/components/mds-kpi-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-kpi-item/documentation.json +1 -1
- package/dist/collection/components/mds-label/AGENTS.md +1 -1
- package/dist/collection/components/mds-label/documentation.json +1 -1
- package/dist/collection/components/mds-list/AGENTS.md +1 -1
- package/dist/collection/components/mds-list/documentation.json +1 -1
- package/dist/collection/components/mds-list-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-list-item/documentation.json +1 -1
- package/dist/collection/components/mds-mention/AGENTS.md +1 -1
- package/dist/collection/components/mds-mention/documentation.json +1 -1
- package/dist/collection/components/mds-modal/AGENTS.md +1 -1
- package/dist/collection/components/mds-modal/documentation.json +1 -1
- package/dist/collection/components/mds-note/AGENTS.md +1 -1
- package/dist/collection/components/mds-note/documentation.json +1 -1
- package/dist/collection/components/mds-notification/AGENTS.md +1 -1
- package/dist/collection/components/mds-notification/documentation.json +1 -1
- package/dist/collection/components/mds-paginator/AGENTS.md +1 -1
- package/dist/collection/components/mds-paginator/documentation.json +1 -1
- package/dist/collection/components/mds-paginator-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-paginator-item/documentation.json +1 -1
- package/dist/collection/components/mds-policy-ai/AGENTS.md +1 -1
- package/dist/collection/components/mds-policy-ai/documentation.json +1 -1
- package/dist/collection/components/mds-pref/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref/documentation.json +1 -1
- package/dist/collection/components/mds-pref-animation/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-animation/documentation.json +1 -1
- package/dist/collection/components/mds-pref-consumption/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-consumption/documentation.json +1 -1
- package/dist/collection/components/mds-pref-contrast/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-contrast/documentation.json +1 -1
- package/dist/collection/components/mds-pref-language/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-language/documentation.json +1 -1
- package/dist/collection/components/mds-pref-language-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-language-item/documentation.json +1 -1
- package/dist/collection/components/mds-pref-mode/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-mode/documentation.json +1 -1
- package/dist/collection/components/mds-pref-theme/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-theme/documentation.json +1 -1
- package/dist/collection/components/mds-pref-theme-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-theme-item/documentation.json +1 -1
- package/dist/collection/components/mds-price-table/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-features/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-features/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-features-cell/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-features-cell/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-features-row/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-features-row/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-header/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-header/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-list/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-list/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-list-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-list-item/documentation.json +1 -1
- package/dist/collection/components/mds-progress/AGENTS.md +1 -1
- package/dist/collection/components/mds-progress/documentation.json +1 -1
- package/dist/collection/components/mds-push-notification/AGENTS.md +1 -1
- package/dist/collection/components/mds-push-notification/documentation.json +1 -1
- package/dist/collection/components/mds-push-notification-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-push-notification-item/documentation.json +1 -1
- package/dist/collection/components/mds-quote/AGENTS.md +1 -1
- package/dist/collection/components/mds-quote/documentation.json +1 -1
- package/dist/collection/components/mds-radial-menu/AGENTS.md +1 -1
- package/dist/collection/components/mds-radial-menu/documentation.json +1 -1
- package/dist/collection/components/mds-radial-menu-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-radial-menu-item/documentation.json +1 -1
- package/dist/collection/components/mds-radial-progress/AGENTS.md +1 -1
- package/dist/collection/components/mds-radial-progress/documentation.json +1 -1
- package/dist/collection/components/mds-separator/AGENTS.md +1 -1
- package/dist/collection/components/mds-separator/documentation.json +1 -1
- package/dist/collection/components/mds-spinner/AGENTS.md +1 -1
- package/dist/collection/components/mds-spinner/documentation.json +1 -1
- package/dist/collection/components/mds-status-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-status-bar/documentation.json +1 -1
- package/dist/collection/components/mds-stepper-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-stepper-bar/documentation.json +1 -1
- package/dist/collection/components/mds-stepper-bar-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-stepper-bar-item/documentation.json +1 -1
- package/dist/collection/components/mds-tab/AGENTS.md +1 -1
- package/dist/collection/components/mds-tab/documentation.json +1 -1
- package/dist/collection/components/mds-tab-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-tab-bar/documentation.json +1 -1
- package/dist/collection/components/mds-tab-bar-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-tab-bar-item/documentation.json +1 -1
- package/dist/collection/components/mds-tab-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-tab-item/documentation.json +1 -1
- package/dist/collection/components/mds-table/AGENTS.md +1 -1
- package/dist/collection/components/mds-table/documentation.json +1 -1
- package/dist/collection/components/mds-table-body/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-body/documentation.json +1 -1
- package/dist/collection/components/mds-table-cell/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-cell/documentation.json +1 -1
- package/dist/collection/components/mds-table-footer/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-footer/documentation.json +1 -1
- package/dist/collection/components/mds-table-header/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-header/documentation.json +1 -1
- package/dist/collection/components/mds-table-header-cell/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-header-cell/documentation.json +1 -1
- package/dist/collection/components/mds-table-row/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-row/documentation.json +1 -1
- package/dist/collection/components/mds-text/AGENTS.md +1 -1
- package/dist/collection/components/mds-text/documentation.json +1 -1
- package/dist/collection/components/mds-toast/AGENTS.md +1 -1
- package/dist/collection/components/mds-toast/documentation.json +1 -1
- package/dist/collection/components/mds-toast-region/AGENTS.md +1 -1
- package/dist/collection/components/mds-toast-region/documentation.json +1 -1
- package/dist/collection/components/mds-tooltip/AGENTS.md +1 -1
- package/dist/collection/components/mds-tooltip/documentation.json +1 -1
- package/dist/collection/components/mds-tree/AGENTS.md +1 -1
- package/dist/collection/components/mds-tree/documentation.json +1 -1
- package/dist/collection/components/mds-tree-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-tree-item/documentation.json +1 -1
- package/dist/collection/components/mds-tree-item/mds-tree-item.css +8 -5
- package/dist/collection/components/mds-url-view/AGENTS.md +1 -1
- package/dist/collection/components/mds-url-view/documentation.json +1 -1
- package/dist/collection/components/mds-usage/AGENTS.md +1 -1
- package/dist/collection/components/mds-usage/documentation.json +1 -1
- package/dist/collection/components/mds-video-wall/AGENTS.md +1 -1
- package/dist/collection/components/mds-video-wall/documentation.json +1 -1
- package/dist/collection/components/mds-zero/AGENTS.md +1 -1
- package/dist/collection/components/mds-zero/documentation.json +1 -1
- package/dist/components/mds-button-dropdown.js +1 -1
- package/dist/components/mds-dropdown.js +1 -1
- package/dist/components/mds-emoji.js +3 -3
- package/dist/components/mds-header.js +1 -1
- package/dist/components/mds-help.js +1 -1
- package/dist/components/mds-horizontal-scroll.js +1 -1
- package/dist/components/mds-input-date-range.js +1 -1
- package/dist/components/mds-input-date.js +1 -1
- package/dist/components/mds-input-switch.js +1 -1
- package/dist/components/mds-input-upload.js +1 -1
- package/dist/components/mds-keyboard.js +1 -1
- package/dist/components/mds-modal.js +1 -1
- package/dist/components/mds-policy-ai.js +1 -1
- package/dist/components/mds-pref-animation.js +1 -1
- package/dist/components/mds-pref-consumption.js +1 -1
- package/dist/components/mds-pref-contrast.js +1 -1
- package/dist/components/mds-pref-language.js +1 -1
- package/dist/components/mds-pref-mode.js +1 -1
- package/dist/components/mds-pref-theme.js +1 -1
- package/dist/components/mds-push-notification.js +1 -1
- package/dist/components/mds-radial-menu-item.js +1 -1
- package/dist/components/mds-radial-menu.js +1 -1
- package/dist/components/mds-status-bar.js +1 -1
- package/dist/components/mds-tab.js +1 -1
- package/dist/components/mds-table-header.js +1 -1
- package/dist/components/mds-table-row.js +1 -1
- package/dist/components/mds-toast.js +1 -1
- package/dist/components/mds-tooltip.js +1 -1
- package/dist/components/mds-tree-item.js +1 -1
- package/dist/components/{p-CylHulxe.js → p-BHy4k3pJ.js} +1 -1
- package/dist/components/{p-2gaGDQwL.js → p-BLXRGNya.js} +1 -1
- package/dist/components/p-C2fyy4Mv.js +1 -0
- package/dist/components/p-CWk1SCJg.js +1 -0
- package/dist/components/{p-BjFCjSw6.js → p-CWwWCzma.js} +1 -1
- package/dist/components/{p-DGGk8PS_.js → p-ChrRK8N9.js} +1 -1
- package/dist/components/{p-wHQGpA62.js → p-Ea5ilDf6.js} +1 -1
- package/dist/components/{p-Dleapw-k.js → p-Ebefwvkw.js} +1 -1
- package/dist/documentation.json +2 -2
- package/dist/esm/{floating-controller-BV0E_Juq.js → floating-controller-CVVcyKew.js} +1 -1
- package/dist/esm/mds-dropdown.entry.js +2 -2
- package/dist/esm/mds-emoji.entry.js +35 -5
- package/dist/esm/mds-horizontal-scroll.entry.js +1 -1
- package/dist/esm/mds-input-switch_2.entry.js +1 -1
- package/dist/esm/mds-modal.entry.js +1 -1
- package/dist/esm/mds-pref-mode.entry.js +1 -1
- package/dist/esm/mds-push-notification.entry.js +1 -1
- package/dist/esm/mds-radial-menu.entry.js +2 -2
- package/dist/esm/mds-tab_2.entry.js +1 -1
- package/dist/esm/mds-toast.entry.js +1 -1
- package/dist/esm/mds-tooltip.entry.js +2 -2
- package/dist/esm/mds-tree-item.entry.js +2 -2
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/{unit-D8eZRaSQ.js → unit-CWk1SCJg.js} +1 -1
- package/dist/esm-es5/{floating-controller-BV0E_Juq.js → floating-controller-CVVcyKew.js} +1 -1
- package/dist/esm-es5/mds-dropdown.entry.js +1 -1
- package/dist/esm-es5/mds-emoji.entry.js +271 -251
- package/dist/esm-es5/mds-horizontal-scroll.entry.js +1 -1
- package/dist/esm-es5/mds-input-switch_2.entry.js +1 -1
- package/dist/esm-es5/mds-modal.entry.js +1 -1
- package/dist/esm-es5/mds-pref-mode.entry.js +1 -1
- package/dist/esm-es5/mds-push-notification.entry.js +1 -1
- package/dist/esm-es5/mds-radial-menu.entry.js +1 -1
- package/dist/esm-es5/mds-tab_2.entry.js +1 -1
- package/dist/esm-es5/mds-toast.entry.js +1 -1
- package/dist/esm-es5/mds-tooltip.entry.js +1 -1
- package/dist/esm-es5/mds-tree-item.entry.js +1 -1
- package/dist/esm-es5/unit-CWk1SCJg.js +1 -0
- package/dist/hydrate/index.js +37 -7
- package/dist/hydrate/index.mjs +37 -7
- package/dist/magma-components/magma-components.esm.js +1 -1
- package/dist/magma-components/{p-b9e0b31d.entry.js → p-14ef1aec.entry.js} +1 -1
- package/dist/magma-components/{p-d0f257d9.system.entry.js → p-1d68fc4a.system.entry.js} +1 -1
- package/dist/magma-components/{p-1809e47d.system.entry.js → p-287d1253.system.entry.js} +51 -31
- package/dist/magma-components/{p-53bcfdbb.entry.js → p-2e8f703e.entry.js} +1 -1
- package/dist/magma-components/{p-dba5a6da.entry.js → p-357ec8c0.entry.js} +1 -1
- package/dist/magma-components/{p-3725c2c1.entry.js → p-4800a310.entry.js} +1 -1
- package/dist/magma-components/{p-b6b7dc40.entry.js → p-5cef4711.entry.js} +1 -1
- package/dist/magma-components/p-61f0ebf3.entry.js +1 -0
- package/dist/magma-components/{p-f28e048b.system.entry.js → p-677ef2a3.system.entry.js} +1 -1
- package/dist/magma-components/{p-b728638c.system.entry.js → p-7448435b.system.entry.js} +1 -1
- package/dist/magma-components/{p-2aab3752.entry.js → p-7502528c.entry.js} +1 -1
- package/dist/magma-components/{p-8f5f2dfe.system.entry.js → p-815801dd.system.entry.js} +2 -2
- package/dist/magma-components/{p-be741e35.entry.js → p-8c66c761.entry.js} +1 -1
- package/dist/magma-components/{p-9e4e1a86.system.entry.js → p-914d1b2a.system.entry.js} +1 -1
- package/dist/magma-components/{p-505fb7d4.entry.js → p-91ed604f.entry.js} +1 -1
- package/dist/magma-components/{p-dc3ef031.system.entry.js → p-938dbe67.system.entry.js} +3 -3
- package/dist/magma-components/p-B-nayZ3E.system.js +1 -0
- package/dist/magma-components/p-CWk1SCJg.js +1 -0
- package/dist/magma-components/{p-5vJawLPw.system.js → p-DVjUXVFl.system.js} +1 -1
- package/dist/magma-components/{p-ZaZnuNvg.js → p-DmFo8_MF.js} +1 -1
- package/dist/magma-components/p-QYez4sql.system.js +1 -1
- package/dist/magma-components/{p-2f3c6105.entry.js → p-b169ee9b.entry.js} +1 -1
- package/dist/magma-components/{p-3eaeb263.system.entry.js → p-bdd18c90.system.entry.js} +1 -1
- package/dist/magma-components/{p-db75bf05.system.entry.js → p-c6b16493.system.entry.js} +1 -1
- package/dist/magma-components/{p-ce2ef293.system.entry.js → p-c6b9a14e.system.entry.js} +1 -1
- package/dist/magma-components/{p-2a2b7c43.entry.js → p-c72651b2.entry.js} +1 -1
- package/dist/magma-components/{p-dbb82d72.system.entry.js → p-cfe080ab.system.entry.js} +1 -1
- package/dist/magma-components/{p-a61623f9.system.entry.js → p-e1ce306a.system.entry.js} +1 -1
- package/dist/magma-components/{p-972ff8a9.entry.js → p-e73cc6fc.entry.js} +3 -3
- package/dist/stats.json +220 -220
- package/dist/types/components/mds-emoji/mds-emoji.d.ts +2 -0
- package/package.json +8 -8
- package/dist/components/p-AFBkzOrP.js +0 -1
- package/dist/components/p-D8eZRaSQ.js +0 -1
- package/dist/esm-es5/unit-D8eZRaSQ.js +0 -1
- package/dist/magma-components/p-6b01ef3b.entry.js +0 -1
- package/dist/magma-components/p-D8eZRaSQ.js +0 -1
- package/dist/magma-components/p-_X0N_X__.system.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function o(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r["throw"](e))}catch(e){s(e)}}function u(e){e.done?i(e.value):n(e.value).then(o,a)}u((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(a){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,e as Host,g as getElement,B as Build}from"./index-CPRkNQdE.js";import{b as cssRotationToNumber,d as cssDurationToSeconds,a as cssSizeToNumber}from"./unit-CWk1SCJg.js";import{a as prefersReducedMotion}from"./preference-Ch1zJnqq.js";
|
|
2
2
|
/**
|
|
3
3
|
* Where the emoji looks, as the two signed fractions `rotate()` takes, in -1..1.
|
|
4
4
|
*
|
|
@@ -8,7 +8,7 @@ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e ins
|
|
|
8
8
|
* Dividing each axis by half the size of the emoji and clamping it on its own (#800) made
|
|
9
9
|
* a small emoji saturate at once, and turned every far point into one of eight poses: a
|
|
10
10
|
* point at 20 degrees and one at 70 degrees below and to the right looked the same.
|
|
11
|
-
*/var gazeToward=function(e,t,i){var
|
|
11
|
+
*/var gazeToward=function(e,t,i){var r=Math.hypot(e,t);if(r===0||!(i>0))return{x:0,y:0};var n=Math.min(r/i,1);return{x:e/r*n,y:t/r*n}};
|
|
12
12
|
/**
|
|
13
13
|
* How far the point has to be for the emoji to turn all the way: half the short side of the
|
|
14
14
|
* viewport, whatever the size of the emoji.
|
|
@@ -31,25 +31,25 @@ _numWithUnitExp=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,_complexStringNumExp=/[-+=.]*\d+\.
|
|
|
31
31
|
//duplicate so that while we're looping through matches from exec(), it doesn't contaminate the lastIndex of _numExp which we use to search for colors too.
|
|
32
32
|
_relExp=/[+-]=-?[.\d]+/,_delimitedValueExp=/[^,'"\[\]\s]+/gi,
|
|
33
33
|
// previously /[#\-+.]*\b[a-z\d\-=+%.]+/gi but didn't catch special characters.
|
|
34
|
-
_unitExp=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,_globalTimeline,_win$1,_coreInitted,_doc$1,_globals={},_installScope={},_coreReady,_install=function e(t){return(_installScope=_merge(t,_globals))&&gsap},_missingPlugin=function e(t,i){return console.warn("Invalid property",t,"set to",i,"Missing plugin? gsap.registerPlugin()")},_warn=function e(t,i){return!i&&console.warn(t)},_addGlobal=function e(t,i){return t&&(_globals[t]=i)&&_installScope&&(_installScope[t]=i)||_globals},_emptyFunc=function e(){return 0},_startAtRevertConfig={suppressEvents:true,isStart:true,kill:false},_revertConfigNoKill={suppressEvents:true,kill:false},_revertConfig={suppressEvents:true},_reservedProps={},_lazyTweens=[],_lazyLookup={},_lastRenderedFrame,_plugins={},_effects={},_nextGCFrame=30,_harnessPlugins=[],_callbackNames="",_harness=function e(t){var i=t[0],n
|
|
34
|
+
_unitExp=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,_globalTimeline,_win$1,_coreInitted,_doc$1,_globals={},_installScope={},_coreReady,_install=function e(t){return(_installScope=_merge(t,_globals))&&gsap},_missingPlugin=function e(t,i){return console.warn("Invalid property",t,"set to",i,"Missing plugin? gsap.registerPlugin()")},_warn=function e(t,i){return!i&&console.warn(t)},_addGlobal=function e(t,i){return t&&(_globals[t]=i)&&_installScope&&(_installScope[t]=i)||_globals},_emptyFunc=function e(){return 0},_startAtRevertConfig={suppressEvents:true,isStart:true,kill:false},_revertConfigNoKill={suppressEvents:true,kill:false},_revertConfig={suppressEvents:true},_reservedProps={},_lazyTweens=[],_lazyLookup={},_lastRenderedFrame,_plugins={},_effects={},_nextGCFrame=30,_harnessPlugins=[],_callbackNames="",_harness=function e(t){var i=t[0],r,n;_isObject(i)||_isFunction(i)||(t=[t]);if(!(r=(i._gsap||{}).harness)){
|
|
35
35
|
// find the first target with a harness. We assume targets passed into an animation will be of similar type, meaning the same kind of harness can be used for them all (performance optimization)
|
|
36
|
-
|
|
36
|
+
n=_harnessPlugins.length;while(n--&&!_harnessPlugins[n].targetTest(i)){}r=_harnessPlugins[n]}n=t.length;while(n--){t[n]&&(t[n]._gsap||(t[n]._gsap=new GSCache(t[n],r)))||t.splice(n,1)}return t},_getCache=function e(t){return t._gsap||_harness(toArray(t))[0]._gsap},_getProperty=function e(t,i,r){return(r=t[i])&&_isFunction(r)?t[i]():_isUndefined(r)&&t.getAttribute&&t.getAttribute(i)||r},_forEachName=function e(t,i){return(t=t.split(",")).forEach(i)||t},
|
|
37
37
|
//split a comma-delimited list of names into an array, then run a forEach() function and return the split array (this is just a way to consolidate/shorten some code).
|
|
38
38
|
_round=function e(t){return Math.round(t*1e5)/1e5||0},_roundPrecise=function e(t){return Math.round(t*1e7)/1e7||0},
|
|
39
39
|
// increased precision mostly for timing values.
|
|
40
|
-
_parseRelative=function e(t,i){var
|
|
40
|
+
_parseRelative=function e(t,i){var r=i.charAt(0),n=parseFloat(i.substr(2));t=parseFloat(t);return r==="+"?t+n:r==="-"?t-n:r==="*"?t*n:t/n},_arrayContainsAny=function e(t,i){
|
|
41
41
|
//searches one array to find matches for any of the items in the toFind array. As soon as one is found, it returns true. It does NOT return all the matches; it's simply a boolean search.
|
|
42
|
-
var
|
|
43
|
-
},_numericIfPossible=function e(t){var i=parseFloat(t);return(i||i===0)&&(t+"").match(_delimitedValueExp).length<2?i:_isString(t)?t.trim():t},_passThrough=function e(t){return t},_setDefaults=function e(t,i){for(var
|
|
42
|
+
var r=i.length,n=0;for(;t.indexOf(i[n])<0&&++n<r;){}return n<r},_lazyRender=function e(){var t=_lazyTweens.length,i=_lazyTweens.slice(0),r,n;_lazyLookup={};_lazyTweens.length=0;for(r=0;r<t;r++){n=i[r];n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],true)._lazy=0)}},_isRevertWorthy=function e(t){return!!(t._initted||t._startAt||t.add)},_lazySafeRender=function e(t,i,r,n){_lazyTweens.length&&!_reverting$1&&_lazyRender();t.render(i,r,!!(_reverting$1&&i<0&&_isRevertWorthy(t)));_lazyTweens.length&&!_reverting$1&&_lazyRender();//in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.
|
|
43
|
+
},_numericIfPossible=function e(t){var i=parseFloat(t);return(i||i===0)&&(t+"").match(_delimitedValueExp).length<2?i:_isString(t)?t.trim():t},_passThrough=function e(t){return t},_setDefaults=function e(t,i){for(var r in i){r in t||(t[r]=i[r])}return t},_setKeyframeDefaults=function e(t){return function(e,i){for(var r in i){r in e||r==="duration"&&t||r==="ease"||(e[r]=i[r])}}},_merge=function e(t,i){for(var r in i){t[r]=i[r]}return t},_mergeDeep=function e(t,i){for(var r in i){r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(t[r]=_isObject(i[r])?e(t[r]||(t[r]={}),i[r]):i[r])}return t},_copyExcluding=function e(t,i){var r={},n;for(n in t){n in i||(r[n]=t[n])}return r},_inheritDefaults=function e(t){var i=t.parent||_globalTimeline,r=t.keyframes?_setKeyframeDefaults(_isArray(t.keyframes)):_setDefaults;if(_isNotFalse(t.inherit)){while(i){r(t,i.vars.defaults);i=i.parent||i._dp}}return t},_arraysMatch=function e(t,i){var r=t.length,n=r===i.length;while(n&&r--&&t[r]===i[r]){}return r<0},_addLinkedListItem=function e(t,i,r,n,s){var o=t[n],a;if(s){a=i[s];while(o&&o[s]>a){o=o._prev}}if(o){i._next=o._next;o._next=i}else{i._next=t[r];t[r]=i}if(i._next){i._next._prev=i}else{t[n]=i}i._prev=o;i.parent=i._dp=t;return i},_removeLinkedListItem=function e(t,i,r,n){if(r===void 0){r="_first"}if(n===void 0){n="_last"}var s=i._prev,o=i._next;if(s){s._next=o}else if(t[r]===i){t[r]=o}if(o){o._prev=s}else if(t[n]===i){t[n]=s}i._next=i._prev=i.parent=null;// don't delete the _dp just so we can revert if necessary. But parent should be null to indicate the item isn't in a linked list.
|
|
44
44
|
},_removeFromParent=function e(t,i){t.parent&&(!i||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t);t._act=0},_uncache=function e(t,i){if(t&&(!i||i._end>t._dur||i._start<0)){
|
|
45
45
|
// performance optimization: if a child animation is passed in we should only uncache if that child EXTENDS the animation (its end time is beyond the end)
|
|
46
|
-
var
|
|
46
|
+
var r=t;while(r){r._dirty=1;r=r.parent}}return t},_recacheAncestors=function e(t){var i=t.parent;while(i&&i.parent){
|
|
47
47
|
//sometimes we must force a re-sort of all children and update the duration/totalDuration of all ancestor timelines immediately in case, for example, in the middle of a render loop, one tween alters another tween's timeScale which shoves its startTime before 0, forcing the parent timeline to shift around and shiftChildren() which could affect that next tween's render (startTime). Doesn't matter for the root timeline though.
|
|
48
|
-
i._dirty=1;i.totalDuration();i=i.parent}return t},_rewindStartAt=function e(t,i,n
|
|
48
|
+
i._dirty=1;i.totalDuration();i=i.parent}return t},_rewindStartAt=function e(t,i,r,n){return t._startAt&&(_reverting$1?t._startAt.revert(_revertConfigNoKill):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(i,true,n))},_hasNoPausedAncestors=function e(t){return!t||t._ts&&e(t.parent)},_elapsedCycleDuration=function e(t){return t._repeat?_animationCycle(t._tTime,t=t.duration()+t._rDelay)*t:0},
|
|
49
49
|
// feed in the totalTime and cycleDuration and it'll return the cycle (iteration minus 1) and if the playhead is exactly at the very END, it will NOT bump up to the next cycle.
|
|
50
|
-
_animationCycle=function e(t,i){var
|
|
50
|
+
_animationCycle=function e(t,i){var r=Math.floor(t=_roundPrecise(t/i));return t&&r===t?r-1:r},_parentToChildTotalTime=function e(t,i){return(t-i._start)*i._ts+(i._ts>=0?0:i._dirty?i.totalDuration():i._tDur)},_setEnd=function e(t){return t._end=_roundPrecise(t._start+(t._tDur/Math.abs(t._ts||t._rts||_tinyNum)||0))},_alignPlayhead=function e(t,i){
|
|
51
51
|
// adjusts the animation's _start and _end according to the provided totalTime (only if the parent's smoothChildTiming is true and the animation isn't paused). It doesn't do any rendering or forcing things back into parent timelines, etc. - that's what totalTime() is for.
|
|
52
|
-
var
|
|
52
|
+
var r=t._dp;if(r&&r.smoothChildTiming&&t._ts){t._start=_roundPrecise(r._time-(t._ts>0?i/t._ts:((t._dirty?t.totalDuration():t._tDur)-i)/-t._ts));_setEnd(t);r._dirty||_uncache(r,t);//for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.
|
|
53
53
|
}return t},
|
|
54
54
|
/*
|
|
55
55
|
_totalTimeToTime = (clampedTotalTime, duration, repeat, repeatDelay, yoyo) => {
|
|
@@ -61,66 +61,66 @@ _totalTimeToTime = (clampedTotalTime, duration, repeat, repeatDelay, yoyo) => {
|
|
|
61
61
|
return (yoyo && (~~(clampedTotalTime / cycleDuration) & 1)) ? duration - time : time;
|
|
62
62
|
},
|
|
63
63
|
*/
|
|
64
|
-
_postAddChecks=function e(t,i){var
|
|
64
|
+
_postAddChecks=function e(t,i){var r;if(i._time||!i._dur&&i._initted||i._start<t._time&&(i._dur||!i.add)){
|
|
65
65
|
// in case, for example, the _start is moved on a tween that has already rendered, or if it's being inserted into a timeline BEFORE where the playhead is currently. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. Special case: if it's a timeline (has .add() method) and no duration, we can skip rendering because the user may be populating it AFTER adding it to a parent timeline (unconventional, but possible, and we wouldn't want it to get removed if the parent's autoRemoveChildren is true).
|
|
66
|
-
|
|
66
|
+
r=_parentToChildTotalTime(t.rawTime(),i);if(!i._dur||_clamp(0,i.totalDuration(),r)-i._tTime>_tinyNum){i.render(r,true)}}//if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.
|
|
67
67
|
if(_uncache(t,i)._dp&&t._initted&&t._time>=t._dur&&t._ts){
|
|
68
68
|
//in case any of the ancestors had completed but should now be enabled...
|
|
69
|
-
if(t._dur<t.duration()){
|
|
70
|
-
|
|
71
|
-
}},_addToTimeline=function e(t,i,n
|
|
72
|
-
return t},_scrollTrigger=function e(t,i){return(_globals.ScrollTrigger||_missingPlugin("scrollTrigger",i))&&_globals.ScrollTrigger.create(i,t)},_attemptInitTween=function e(t,i,n,
|
|
69
|
+
if(t._dur<t.duration()){r=t;while(r._dp){r.rawTime()>=0&&r.totalTime(r._tTime);//moves the timeline (shifts its startTime) if necessary, and also enables it. If it's currently zero, though, it may not be scheduled to render until later so there's no need to force it to align with the current playhead position. Only move to catch up with the playhead.
|
|
70
|
+
r=r._dp}}t._zTime=-_tinyNum;// helps ensure that the next render() will be forced (crossingStart = true in render()), even if the duration hasn't changed (we're adding a child which would need to get rendered). Definitely an edge case. Note: we MUST do this AFTER the loop above where the totalTime() might trigger a render() because this _addToTimeline() method gets called from the Animation constructor, BEFORE tweens even record their targets, etc. so we wouldn't want things to get triggered in the wrong order.
|
|
71
|
+
}},_addToTimeline=function e(t,i,r,n){i.parent&&_removeFromParent(i);i._start=_roundPrecise((_isNumber(r)?r:r||t!==_globalTimeline?_parsePosition(t,r,i):t._time)+i._delay);i._end=_roundPrecise(i._start+(i.totalDuration()/Math.abs(i.timeScale())||0));_addLinkedListItem(t,i,"_first","_last",t._sort?"_start":0);_isFromOrFromStart(i)||(t._recent=i);n||_postAddChecks(t,i);t._ts<0&&_alignPlayhead(t,t._tTime);// if the timeline is reversed and the new child makes it longer, we may need to adjust the parent's _start (push it back)
|
|
72
|
+
return t},_scrollTrigger=function e(t,i){return(_globals.ScrollTrigger||_missingPlugin("scrollTrigger",i))&&_globals.ScrollTrigger.create(i,t)},_attemptInitTween=function e(t,i,r,n,s){_initTween(t,i,s);if(!t._initted){return 1}if(!r&&t._pt&&!_reverting$1&&(t._dur&&t.vars.lazy!==false||!t._dur&&t.vars.lazy)&&_lastRenderedFrame!==_ticker.frame){_lazyTweens.push(t);t._lazy=[s,n];return 1}},_parentPlayheadIsBeforeStart=function e(t){var i=t.parent;return i&&i._ts&&i._initted&&!i._lock&&(i.rawTime()<0||e(i))},
|
|
73
73
|
// check parent's _lock because when a timeline repeats/yoyos and does its artificial wrapping, we shouldn't force the ratio back to 0
|
|
74
|
-
_isFromOrFromStart=function e(t){var i=t.data;return i==="isFromStart"||i==="isStart"},_renderZeroDurationTween=function e(t,i,n
|
|
74
|
+
_isFromOrFromStart=function e(t){var i=t.data;return i==="isFromStart"||i==="isStart"},_renderZeroDurationTween=function e(t,i,r,n){var s=t.ratio,o=i<0||!i&&(!t._start&&_parentPlayheadIsBeforeStart(t)&&!(!t._initted&&_isFromOrFromStart(t))||(t._ts<0||t._dp._ts<0)&&!_isFromOrFromStart(t))?0:1,
|
|
75
75
|
// if the tween or its parent is reversed and the totalTime is 0, we should go to a ratio of 0. Edge case: if a from() or fromTo() stagger tween is placed later in a timeline, the "startAt" zero-duration tween could initially render at a time when the parent timeline's playhead is technically BEFORE where this tween is, so make sure that any "from" and "fromTo" startAt tweens are rendered the first time at a ratio of 1.
|
|
76
76
|
a=t._rDelay,u=0,f,l,h;if(a&&t._repeat){
|
|
77
77
|
// in case there's a zero-duration tween that has a repeat with a repeatDelay
|
|
78
78
|
u=_clamp(0,t._tDur,i);l=_animationCycle(u,a);t._yoyo&&l&1&&(o=1-o);if(l!==_animationCycle(t._tTime,a)){
|
|
79
79
|
// if iteration changed
|
|
80
|
-
s=1-o;t.vars.repeatRefresh&&t._initted&&t.invalidate()}}if(o!==s||_reverting$1||
|
|
80
|
+
s=1-o;t.vars.repeatRefresh&&t._initted&&t.invalidate()}}if(o!==s||_reverting$1||n||t._zTime===_tinyNum||!i&&t._zTime){if(!t._initted&&_attemptInitTween(t,i,n,r,u)){
|
|
81
81
|
// if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.
|
|
82
|
-
return}h=t._zTime;t._zTime=i||(
|
|
83
|
-
|
|
84
|
-
t.ratio=o;t._from&&(o=1-o);t._time=0;t._tTime=u;f=t._pt;while(f){f.r(o,f.d);f=f._next}i<0&&_rewindStartAt(t,i,
|
|
82
|
+
return}h=t._zTime;t._zTime=i||(r?_tinyNum:0);// when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.
|
|
83
|
+
r||(r=i&&!h);// if it was rendered previously at exactly 0 (_zTime) and now the playhead is moving away, DON'T fire callbacks otherwise they'll seem like duplicates.
|
|
84
|
+
t.ratio=o;t._from&&(o=1-o);t._time=0;t._tTime=u;f=t._pt;while(f){f.r(o,f.d);f=f._next}i<0&&_rewindStartAt(t,i,r,true);t._onUpdate&&!r&&_callback(t,"onUpdate");u&&t._repeat&&!r&&t.parent&&_callback(t,"onRepeat");if((i>=t._tDur||i<0)&&t.ratio===o){o&&_removeFromParent(t,1);if(!r&&!_reverting$1){_callback(t,o?"onComplete":"onReverseComplete",true);t._prom&&t._prom()}}}else if(!t._zTime){t._zTime=i}},_findNextPauseTween=function e(t,i,r){var n;if(r>i){n=t._first;while(n&&n._start<=r){if(n.data==="isPause"&&n._start>i){return n}n=n._next}}else{n=t._last;while(n&&n._start>=r){if(n.data==="isPause"&&n._start<i){return n}n=n._prev}}},_setDuration=function e(t,i,r,n){var s=t._repeat,o=_roundPrecise(i)||0,a=t._tTime/t._tDur;a&&!n&&(t._time*=o/t._dur);t._dur=o;t._tDur=!s?o:s<0?1e10:_roundPrecise(o*(s+1)+t._rDelay*s);a>0&&!n&&_alignPlayhead(t,t._tTime=t._tDur*a);t.parent&&_setEnd(t);r||_uncache(t.parent,t);return t},_onUpdateTotalDuration=function e(t){return t instanceof Timeline?_uncache(t):_setDuration(t,t._dur)},_zeroPosition={_start:0,endTime:_emptyFunc,totalDuration:_emptyFunc},_parsePosition=function e(t,i,r){var n=t.labels,s=t._recent||_zeroPosition,o=t.duration()>=_bigNum$1?s.endTime(false):t._dur,
|
|
85
85
|
//in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead.
|
|
86
|
-
a,u,f;if(_isString(i)&&(isNaN(i)||i in
|
|
86
|
+
a,u,f;if(_isString(i)&&(isNaN(i)||i in n)){
|
|
87
87
|
//if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).
|
|
88
|
-
u=i.charAt(0);f=i.substr(-1)==="%";a=i.indexOf("=");if(u==="<"||u===">"){a>=0&&(i=i.replace(/=/,""));return(u==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(i.substr(1))||0)*(f?(a<0?s:
|
|
88
|
+
u=i.charAt(0);f=i.substr(-1)==="%";a=i.indexOf("=");if(u==="<"||u===">"){a>=0&&(i=i.replace(/=/,""));return(u==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(i.substr(1))||0)*(f?(a<0?s:r).totalDuration()/100:1)}if(a<0){i in n||(n[i]=o);return n[i]}u=parseFloat(i.charAt(a-1)+i.substr(a+1));if(f&&r){u=u/100*(_isArray(r)?r[0]:r).totalDuration()}return a>1?e(t,i.substr(0,a-1),r)+u:o+u}return i==null?o:+i},_createTweenType=function e(t,i,r){var n=_isNumber(i[1]),s=(n?2:1)+(t<2?0:1),o=i[s],a,u;n&&(o.duration=i[1]);o.parent=r;if(t){a=o;u=r;while(u&&!("immediateRender"in a)){
|
|
89
89
|
// inheritance hasn't happened yet, but someone may have set a default in an ancestor timeline. We could do vars.immediateRender = _isNotFalse(_inheritDefaults(vars).immediateRender) but that'd exact a slight performance penalty because _inheritDefaults() also runs in the Tween constructor. We're paying a small kb price here to gain speed.
|
|
90
90
|
a=u.vars.defaults||{};u=_isNotFalse(u.vars.inherit)&&u.parent}o.immediateRender=_isNotFalse(a.immediateRender);t<2?o.runBackwards=1:o.startAt=i[s-1];// "from" vars
|
|
91
|
-
}return new Tween(i[0],o,i[s+1])},_conditionalReturn=function e(t,i){return t||t===0?i(t):i},_clamp=function e(t,i,
|
|
91
|
+
}return new Tween(i[0],o,i[s+1])},_conditionalReturn=function e(t,i){return t||t===0?i(t):i},_clamp=function e(t,i,r){return r<t?t:r>i?i:r},getUnit=function e(t,i){return!_isString(t)||!(i=_unitExp.exec(t))?"":i[1]},
|
|
92
92
|
// note: protect against padded numbers as strings, like "100.100". That shouldn't return "00" as the unit. If it's numeric, return no unit.
|
|
93
|
-
clamp=function e(t,i,
|
|
93
|
+
clamp=function e(t,i,r){return _conditionalReturn(r,(function(e){return _clamp(t,i,e)}))},_slice=[].slice,_isArrayLike=function e(t,i){return t&&_isObject(t)&&"length"in t&&(!i&&!t.length||t.length-1 in t&&_isObject(t[0]))&&!t.nodeType&&t!==_win$1},_flatten=function e(t,i,r){if(r===void 0){r=[]}return t.forEach((function(e){var t;return _isString(e)&&!i||_isArrayLike(e,1)?(t=r).push.apply(t,toArray(e)):r.push(e)}))||r},
|
|
94
94
|
// takes any value and returns an Array. If it's a string (and leaveStrings isn't true), it'll use document.querySelectorAll() and convert that to an array. It'll also accept iterables like jQuery objects.
|
|
95
|
-
toArray=function e(t,i,
|
|
95
|
+
toArray=function e(t,i,r){return _context&&!i&&_context.selector?_context.selector(t):_isString(t)&&!r&&(_coreInitted||!_wake())?_slice.call((i||_doc$1).querySelectorAll(t),0):_isArray(t)?_flatten(t,r):_isArrayLike(t)?_slice.call(t,0):t?[t]:[]},selector=function e(t){t=toArray(t)[0]||_warn("Invalid scope")||{};return function(e){var i=t.current||t.nativeElement||t;return toArray(e,i.querySelectorAll?i:i===t?_warn("Invalid scope")||_doc$1.createElement("div"):t)}},shuffle=function e(t){return t.sort((function(){return.5-Math.random()}))},
|
|
96
96
|
// alternative that's a bit faster and more reliably diverse but bigger: for (let j, v, i = a.length; i; j = (Math.random() * i) | 0, v = a[--i], a[i] = a[j], a[j] = v); return a;
|
|
97
97
|
// for distributing values across an Array. Can accept a number, a function or (most commonly) an object which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array.
|
|
98
98
|
distribute=function e(t){if(_isFunction(t)){return t}var i=_isObject(t)?t:{each:t},
|
|
99
99
|
//n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total "amount" that's chunked out among them all.
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
r=_parseEase(i.ease),n=i.from||0,s=parseFloat(i.base)||0,o={},a=n>0&&n<1,u=isNaN(n)||a,f=i.axis,l=n,h=n;if(_isString(n)){l=h={center:.5,edges:.5,end:1}[n]||0}else if(!a&&u){l=n[0];h=n[1]}return function(e,t,a){var _=(a||i).length,c=o[_],d,m,p,g,v,C,y,w,P;if(!c){P=i.grid==="auto"?0:(i.grid||[1,_bigNum$1])[1];if(!P){y=-_bigNum$1;while(y<(y=a[P++].getBoundingClientRect().left)&&P<_){}P<_&&P--}c=o[_]=[];d=u?Math.min(P,_)*l-.5:n%P;m=P===_bigNum$1?0:u?_*h/P-.5:n/P|0;y=0;w=_bigNum$1;for(C=0;C<_;C++){p=C%P-d;g=m-(C/P|0);c[C]=v=!f?_sqrt(p*p+g*g):Math.abs(f==="y"?g:p);v>y&&(y=v);v<w&&(w=v)}n==="random"&&shuffle(c);c.max=y-w;c.min=w;c.v=_=(parseFloat(i.amount)||parseFloat(i.each)*(P>_?_-1:!f?Math.max(P,_/P):f==="y"?_/P:P)||0)*(n==="edges"?-1:1);c.b=_<0?s-_:s;c.u=getUnit(i.amount||i.each)||0;//unit
|
|
101
|
+
r=r&&_<0?_invertEase(r):r}_=(c[e]-c.min)/c.max||0;return _roundPrecise(c.b+(r?r(_):_)*c.v)+c.u;//round in order to work around floating point errors
|
|
102
102
|
}},_roundModifier=function e(t){
|
|
103
103
|
//pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc.
|
|
104
104
|
var i=Math.pow(10,((t+"").split(".")[1]||"").length);//to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed())
|
|
105
|
-
return function(e){var
|
|
106
|
-
}},snap=function e(t,i){var
|
|
107
|
-
}}else{t=_roundModifier(t.increment)}}return _conditionalReturn(i,!
|
|
105
|
+
return function(e){var r=_roundPrecise(Math.round(parseFloat(e)/t)*t*i);return(r-r%1)/i+(_isNumber(e)?0:getUnit(e));// n - n % 1 replaces Math.floor() in order to handle negative values properly. For example, Math.floor(-150.00000000000003) is 151!
|
|
106
|
+
}},snap=function e(t,i){var r=_isArray(t),n,s;if(!r&&_isObject(t)){n=r=t.radius||_bigNum$1;if(t.values){t=toArray(t.values);if(s=!_isNumber(t[0])){n*=n;//performance optimization so we don't have to Math.sqrt() in the loop.
|
|
107
|
+
}}else{t=_roundModifier(t.increment)}}return _conditionalReturn(i,!r?_roundModifier(t):_isFunction(t)?function(e){s=t(e);return Math.abs(s-e)<=n?s:e}:function(e){var i=parseFloat(s?e.x:e),r=parseFloat(s?e.y:0),o=_bigNum$1,a=0,u=t.length,f,l;while(u--){if(s){f=t[u].x-i;l=t[u].y-r;f=f*f+l*l}else{f=Math.abs(t[u]-i)}if(f<o){o=f;a=u}}a=!n||o<=n?t[a]:e;return s||a===e||_isNumber(e)?a:a+getUnit(e)})},random=function e(t,i,r,n){return _conditionalReturn(_isArray(t)?!i:r===true?!!(r=0):!n,(function(){return _isArray(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(n=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(i-t+r*.99))/r)*r*n)/n}))},pipe=function e(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++){i[r]=arguments[r]}return function(e){return i.reduce((function(e,t){return t(e)}),e)}},unitize=function e(t,i){return function(e){return t(parseFloat(e))+(i||getUnit(e))}},normalize=function e(t,i,r){return mapRange(t,i,0,1,r)},_wrapArray=function e(t,i,r){return _conditionalReturn(r,(function(e){return t[~~i(e)]}))},wrap=function e(t,i,r){
|
|
108
108
|
// NOTE: wrap() CANNOT be an arrow function! A very odd compiling bug causes problems (unrelated to GSAP).
|
|
109
|
-
var
|
|
109
|
+
var n=i-t;return _isArray(t)?_wrapArray(t,e(0,t.length),i):_conditionalReturn(r,(function(e){return(n+(e-t)%n)%n+t}))},wrapYoyo=function e(t,i,r){var n=i-t,s=n*2;return _isArray(t)?_wrapArray(t,e(0,t.length-1),i):_conditionalReturn(r,(function(e){e=(s+(e-t)%s)%s||0;return t+(e>n?s-e:e)}))},_replaceRandom=function e(t){return t.replace(_randomExp,(function(e){
|
|
110
110
|
//replaces all occurrences of random(...) in a string with the calculated random value. can be a range like random(-100, 100, 5) or an array like random([0, 100, 500])
|
|
111
|
-
var t=e.indexOf("[")+1,i=e.substring(t||7,t?e.indexOf("]"):e.length-1).split(_commaDelimExp);return random(t?i:+i[0],t?0:+i[1],+i[2]||1e-5)}))},mapRange=function e(t,i,n,
|
|
112
|
-
}h--;s=function e(t){t*=h;var i=Math.min(_,~~t);return l[i](t-i)};
|
|
111
|
+
var t=e.indexOf("[")+1,i=e.substring(t||7,t?e.indexOf("]"):e.length-1).split(_commaDelimExp);return random(t?i:+i[0],t?0:+i[1],+i[2]||1e-5)}))},mapRange=function e(t,i,r,n,s){var o=i-t,a=n-r;return _conditionalReturn(s,(function(e){return r+((e-t)/o*a||0)}))},interpolate=function e(t,i,r,n){var s=isNaN(t+i)?0:function(e){return(1-e)*t+e*i};if(!s){var o=_isString(t),a={},u,f,l,h,_;r===true&&(n=1)&&(r=null);if(o){t={p:t};i={p:i}}else if(_isArray(t)&&!_isArray(i)){l=[];h=t.length;_=h-2;for(f=1;f<h;f++){l.push(e(t[f-1],t[f]));//build the interpolators up front as a performance optimization so that when the function is called many times, it can just reuse them.
|
|
112
|
+
}h--;s=function e(t){t*=h;var i=Math.min(_,~~t);return l[i](t-i)};r=i}else if(!n){t=_merge(_isArray(t)?[]:{},t)}if(!l){for(u in i){_addPropTween.call(a,t,u,"get",i[u])}s=function e(i){return _renderPropTweens(i,a)||(o?t.p:t)}}}return _conditionalReturn(r,s)},_getLabelInDirection=function e(t,i,r){
|
|
113
113
|
//used for nextLabel() and previousLabel()
|
|
114
|
-
var
|
|
114
|
+
var n=t.labels,s=_bigNum$1,o,a,u;for(o in n){a=n[o]-i;if(a<0===!!r&&a&&s>(a=Math.abs(a))){u=o;s=a}}return u},_callback=function e(t,i,r){var n=t.vars,s=n[i],o=_context,a=t._ctx,u,f,l;if(!s){return}u=n[i+"Params"];f=n.callbackScope||t;r&&_lazyTweens.length&&_lazyRender();//in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values.
|
|
115
115
|
a&&(_context=a);l=u?s.apply(f,u):s.call(f);_context=o;return l},_interrupt=function e(t){_removeFromParent(t);t.scrollTrigger&&t.scrollTrigger.kill(!!_reverting$1);t.progress()<1&&_callback(t,"onInterrupt");return t},_quickTween,_registerPluginQueue=[],_createPlugin=function e(t){if(!t)return;t=!t.name&&t["default"]||t;// UMD packaging wraps things oddly, so for example MotionPathHelper becomes {MotionPathHelper:MotionPathHelper, default:MotionPathHelper}.
|
|
116
116
|
if(_windowExists$1()||t.headless){
|
|
117
117
|
// edge case: some build tools may pass in a null/undefined value
|
|
118
|
-
var i=t.name,
|
|
118
|
+
var i=t.name,r=_isFunction(t),n=i&&!r&&t.init?function(){this._props=[]}:t,
|
|
119
119
|
//in case someone passes in an object that's not a plugin, like CustomEase
|
|
120
|
-
s={init:_emptyFunc,render:_renderPropTweens,add:_addPropTween,kill:_killPropTweensOf,modifier:_addPluginModifier,rawVars:0},o={targetTest:0,get:0,getSetter:_getSetter,aliases:{},register:0};_wake();if(t!==
|
|
121
|
-
_merge(
|
|
122
|
-
_plugins[
|
|
123
|
-
}_addGlobal(i,
|
|
120
|
+
s={init:_emptyFunc,render:_renderPropTweens,add:_addPropTween,kill:_killPropTweensOf,modifier:_addPluginModifier,rawVars:0},o={targetTest:0,get:0,getSetter:_getSetter,aliases:{},register:0};_wake();if(t!==n){if(_plugins[i]){return}_setDefaults(n,_setDefaults(_copyExcluding(t,s),o));//static methods
|
|
121
|
+
_merge(n.prototype,_merge(s,_copyExcluding(t,o)));//instance methods
|
|
122
|
+
_plugins[n.prop=i]=n;if(t.targetTest){_harnessPlugins.push(n);_reservedProps[i]=1}i=(i==="css"?"CSS":i.charAt(0).toUpperCase()+i.substr(1))+"Plugin";//for the global name. "motionPath" should become MotionPathPlugin
|
|
123
|
+
}_addGlobal(i,n);t.register&&t.register(gsap,n,PropTween)}else{_registerPluginQueue.push(t)}},
|
|
124
124
|
/*
|
|
125
125
|
* --------------------------------------------------------------------------------------
|
|
126
126
|
* COLORS
|
|
@@ -130,31 +130,31 @@ _255=255,_colorLookup={aqua:[0,_255,_255],lime:[0,_255,0],silver:[192,192,192],b
|
|
|
130
130
|
// possible future idea to replace the hard-coded color name values - put this in the ticker.wake() where we set the _doc:
|
|
131
131
|
// let ctx = _doc.createElement("canvas").getContext("2d");
|
|
132
132
|
// _forEachName("aqua,lime,silver,black,maroon,teal,blue,navy,white,olive,yellow,orange,gray,purple,green,red,pink,cyan", color => {ctx.fillStyle = color; _colorLookup[color] = splitColor(ctx.fillStyle)});
|
|
133
|
-
_hue=function e(t,i,
|
|
133
|
+
_hue=function e(t,i,r){t+=t<0?1:t>1?-1:0;return(t*6<1?i+(r-i)*t*6:t<.5?r:t*3<2?i+(r-i)*(2/3-t)*6:i)*_255+.5|0},splitColor=function e(t,i,r){var n=!t?_colorLookup.black:_isNumber(t)?[t>>16,t>>8&_255,t&_255]:0,s,o,a,u,f,l,h,_,c,d;if(!n){if(t.substr(-1)===","){
|
|
134
134
|
//sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value.
|
|
135
|
-
t=t.substr(0,t.length-1)}if(_colorLookup[t]){
|
|
135
|
+
t=t.substr(0,t.length-1)}if(_colorLookup[t]){n=_colorLookup[t]}else if(t.charAt(0)==="#"){if(t.length<6){
|
|
136
136
|
//for shorthand like #9F0 or #9F0F (could have alpha)
|
|
137
137
|
s=t.charAt(1);o=t.charAt(2);a=t.charAt(3);t="#"+s+s+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")}if(t.length===9){
|
|
138
138
|
// hex with alpha, like #fd5e53ff
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
n=parseInt(t.substr(1,6),16);return[n>>16,n>>8&_255,n&_255,parseInt(t.substr(7),16)/255]}t=parseInt(t.substr(1),16);n=[t>>16,t>>8&_255,t&_255]}else if(t.substr(0,3)==="hsl"){n=d=t.match(_strictNumExp);if(!i){u=+n[0]%360/360;f=+n[1]/100;l=+n[2]/100;o=l<=.5?l*(f+1):l+f-l*f;s=l*2-o;n.length>3&&(n[3]*=1);//cast as number
|
|
140
|
+
n[0]=_hue(u+1/3,s,o);n[1]=_hue(u,s,o);n[2]=_hue(u-1/3,s,o)}else if(~t.indexOf("=")){
|
|
141
141
|
//if relative values are found, just return the raw strings with the relative prefixes in place.
|
|
142
|
-
|
|
142
|
+
n=t.match(_numExp);r&&n.length<4&&(n[3]=1);return n}}else{n=t.match(_strictNumExp)||_colorLookup.transparent}n=n.map(Number)}if(i&&!d){s=n[0]/_255;o=n[1]/_255;a=n[2]/_255;h=Math.max(s,o,a);_=Math.min(s,o,a);l=(h+_)/2;if(h===_){u=f=0}else{c=h-_;f=l>.5?c/(2-h-_):c/(h+_);u=h===s?(o-a)/c+(o<a?6:0):h===o?(a-s)/c+2:(s-o)/c+4;u*=60}n[0]=~~(u+.5);n[1]=~~(f*100+.5);n[2]=~~(l*100+.5)}r&&n.length<4&&(n[3]=1);return n},_colorOrderData=function e(t){
|
|
143
143
|
// strips out the colors from the string, finds all the numeric slots (with units) and returns an array of those. The Array also has a "c" property which is an Array of the index values where the colors belong. This is to help work around issues where there's a mis-matched order of color/numeric data like drop-shadow(#f00 0px 1px 2px) and drop-shadow(0x 1px 2px #f00). This is basically a helper function used in _formatColors()
|
|
144
|
-
var i=[],
|
|
144
|
+
var i=[],r=[],n=-1;t.split(_colorExp).forEach((function(e){var t=e.match(_numWithUnitExp)||[];i.push.apply(i,t);r.push(n+=t.length+1)}));i.c=r;return i},_formatColors=function e(t,i,r){var n="",s=(t+n).match(_colorExp),o=i?"hsla(":"rgba(",a=0,u,f,l,h;if(!s){return t}s=s.map((function(e){return(e=splitColor(e,i,1))&&o+(i?e[0]+","+e[1]+"%,"+e[2]+"%,"+e[3]:e.join(","))+")"}));if(r){l=_colorOrderData(t);u=r.c;if(u.join(n)!==l.c.join(n)){f=t.replace(_colorExp,"1").split(_numWithUnitExp);h=f.length-1;for(;a<h;a++){n+=f[a]+(~u.indexOf(a)?s.shift()||o+"0,0,0,0)":(l.length?l:s.length?s:r).shift())}}}if(!f){f=t.split(_colorExp);h=f.length-1;for(;a<h;a++){n+=f[a]+s[a]}}return n+f[h]},_colorExp=function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",
|
|
145
145
|
//we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.,
|
|
146
|
-
t;for(t in _colorLookup){e+="|"+t+"\\b"}return new RegExp(e+")","gi")}(),_hslExp=/hsl[a]?\(/,_colorStringFilter=function e(t){var i=t.join(" "),
|
|
146
|
+
t;for(t in _colorLookup){e+="|"+t+"\\b"}return new RegExp(e+")","gi")}(),_hslExp=/hsl[a]?\(/,_colorStringFilter=function e(t){var i=t.join(" "),r;_colorExp.lastIndex=0;if(_colorExp.test(i)){r=_hslExp.test(i);t[1]=_formatColors(t[1],r);t[0]=_formatColors(t[0],r,_colorOrderData(t[1]));// make sure the order of numbers/colors match with the END value.
|
|
147
147
|
return true}},
|
|
148
148
|
/*
|
|
149
149
|
* --------------------------------------------------------------------------------------
|
|
150
150
|
* TICKER
|
|
151
151
|
* --------------------------------------------------------------------------------------
|
|
152
152
|
*/
|
|
153
|
-
_tickerActive,_ticker=function(){var e=Date.now,t=500,i=33,
|
|
153
|
+
_tickerActive,_ticker=function(){var e=Date.now,t=500,i=33,r=e(),n=r,s=1e3/240,o=s,a=[],u,f,l,h,_,c,d=function l(d){var m=e()-n,p=d===true,g,v,C,y;(m>t||m<0)&&(r+=m-i);n+=m;C=n-r;g=C-o;if(g>0||p){y=++h.frame;_=C-h.time*1e3;h.time=C=C/1e3;o+=g+(g>=s?4:s-g);v=1}p||(u=f(l));//make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.
|
|
154
154
|
if(v){for(c=0;c<a.length;c++){
|
|
155
155
|
// use _i and check _listeners.length instead of a variable because a listener could get removed during the loop, and if that happens to an element less than the current index, it'd throw things off in the loop.
|
|
156
|
-
a[c](C,_,y,d)}}};h={time:0,frame:0,tick:function e(){d(true)},deltaRatio:function e(t){return _/(1e3/(t||60))},wake:function e(){if(_coreReady){if(!_coreInitted&&_windowExists$1()){_win$1=_coreInitted=window;_doc$1=_win$1.document||{};_globals.gsap=gsap;(_win$1.gsapVersions||(_win$1.gsapVersions=[])).push(gsap.version);_install(_installScope||_win$1.GreenSockGlobals||!_win$1.gsap&&_win$1||{});_registerPluginQueue.forEach(_createPlugin)}l=typeof requestAnimationFrame!=="undefined"&&requestAnimationFrame;u&&h.sleep();f=l||function(e){return setTimeout(e,o-h.time*1e3+1|0)};_tickerActive=1;d(2)}},sleep:function e(){(l?cancelAnimationFrame:clearTimeout)(u);_tickerActive=0;f=_emptyFunc},lagSmoothing:function e(n
|
|
157
|
-
i=Math.min(
|
|
156
|
+
a[c](C,_,y,d)}}};h={time:0,frame:0,tick:function e(){d(true)},deltaRatio:function e(t){return _/(1e3/(t||60))},wake:function e(){if(_coreReady){if(!_coreInitted&&_windowExists$1()){_win$1=_coreInitted=window;_doc$1=_win$1.document||{};_globals.gsap=gsap;(_win$1.gsapVersions||(_win$1.gsapVersions=[])).push(gsap.version);_install(_installScope||_win$1.GreenSockGlobals||!_win$1.gsap&&_win$1||{});_registerPluginQueue.forEach(_createPlugin)}l=typeof requestAnimationFrame!=="undefined"&&requestAnimationFrame;u&&h.sleep();f=l||function(e){return setTimeout(e,o-h.time*1e3+1|0)};_tickerActive=1;d(2)}},sleep:function e(){(l?cancelAnimationFrame:clearTimeout)(u);_tickerActive=0;f=_emptyFunc},lagSmoothing:function e(r,n){t=r||Infinity;// zero should be interpreted as basically unlimited
|
|
157
|
+
i=Math.min(n||33,t)},fps:function e(t){s=1e3/(t||240);o=h.time*1e3+s},add:function e(t,i,r){var n=i?function(e,i,r,s){t(e,i,r,s);h.remove(n)}:t;h.remove(t);a[r?"unshift":"push"](n);_wake();return n},remove:function e(t,i){~(i=a.indexOf(t))&&a.splice(i,1)&&c>=i&&c--},_listeners:a};return h}(),_wake=function e(){return!_tickerActive&&_ticker.wake()},
|
|
158
158
|
//also ensures the core classes are initialized.
|
|
159
159
|
/*
|
|
160
160
|
* -------------------------------------------------
|
|
@@ -163,12 +163,12 @@ i=Math.min(r||33,t)},fps:function e(t){s=1e3/(t||240);o=h.time*1e3+s},add:functi
|
|
|
163
163
|
*/
|
|
164
164
|
_easeMap={},_customEaseExp=/^[\d.\-M][\d.\-,\s]/,_quotesExp=/["']/g,_parseObjectInString=function e(t){
|
|
165
165
|
//takes a string like "{wiggles:10, type:anticipate})" and turns it into a real object. Notice it ends in ")" and includes the {} wrappers. This is because we only use this function for parsing ease configs and prioritized optimization rather than reusability.
|
|
166
|
-
var i={},
|
|
166
|
+
var i={},r=t.substr(1,t.length-3).split(":"),n=r[0],s=1,o=r.length,a,u,f;for(;s<o;s++){u=r[s];a=s!==o-1?u.lastIndexOf(","):u.length;f=u.substr(0,a);i[n]=isNaN(f)?f.replace(_quotesExp,"").trim():+f;n=u.substr(a+1).trim()}return i},_valueInParentheses=function e(t){var i=t.indexOf("(")+1,r=t.indexOf(")"),n=t.indexOf("(",i);return t.substring(i,~n&&n<r?t.indexOf(")",r+1):r)},_configEaseFromString=function e(t){
|
|
167
167
|
//name can be a string like "elastic.out(1,0.5)", and pass in _easeMap as obj and it'll parse it out and call the actual function like _easeMap.Elastic.easeOut.config(1,0.5). It will also parse custom ease strings as long as CustomEase is loaded and registered (internally as _easeMap._CE).
|
|
168
|
-
var i=(t+"").split("("),
|
|
168
|
+
var i=(t+"").split("("),r=_easeMap[i[0]];return r&&i.length>1&&r.config?r.config.apply(null,~t.indexOf("{")?[_parseObjectInString(i[1])]:_valueInParentheses(t).split(",").map(_numericIfPossible)):_easeMap._CE&&_customEaseExp.test(t)?_easeMap._CE("",t):r},_invertEase=function e(t){return function(e){return 1-t(1-e)}},_parseEase=function e(t,i){return!t?i:(_isFunction(t)?t:_easeMap[t]||_configEaseFromString(t))||i},_insertEase=function e(t,i,r,n){if(r===void 0){r=function e(t){return 1-i(1-t)}}if(n===void 0){n=function e(t){return t<.5?i(t*2)/2:1-i((1-t)*2)/2}}var s={easeIn:i,easeOut:r,easeInOut:n},o;_forEachName(t,(function(e){_easeMap[e]=_globals[e]=s;_easeMap[o=e.toLowerCase()]=r;for(var t in s){_easeMap[o+(t==="easeIn"?".in":t==="easeOut"?".out":".inOut")]=_easeMap[e+"."+t]=s[t]}}));return s},_easeInOutFromOut=function e(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},_configElastic=function e(t,i,r){var n=i>=1?i:1,
|
|
169
169
|
//note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1.
|
|
170
|
-
s=(
|
|
171
|
-
u.config=function(i,
|
|
170
|
+
s=(r||(t?.3:.45))/(i<1?i:1),o=s/_2PI*(Math.asin(1/n)||0),a=function e(t){return t===1?1:n*Math.pow(2,-10*t)*_sin((t-o)*s)+1},u=t==="out"?a:t==="in"?function(e){return 1-a(1-e)}:_easeInOutFromOut(a);s=_2PI/s;//precalculate to optimize
|
|
171
|
+
u.config=function(i,r){return e(t,i,r)};return u},_configBack=function e(t,i){if(i===void 0){i=1.70158}var r=function e(t){return t?--t*t*((i+1)*t+i)+1:0},n=t==="out"?r:t==="in"?function(e){return 1-r(1-e)}:_easeInOutFromOut(r);n.config=function(i){return e(t,i)};return n};// a cheaper (kb and cpu) but more mild way to get a parameterized weighted ease by feeding in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.
|
|
172
172
|
// _weightedEase = ratio => {
|
|
173
173
|
// let y = 0.5 + ratio / 2;
|
|
174
174
|
// return p => (2 * (1 - p) * p * y + p * p);
|
|
@@ -181,8 +181,8 @@ u.config=function(i,n){return e(t,i,n)};return u},_configBack=function e(t,i){if
|
|
|
181
181
|
// c = ratio + o;
|
|
182
182
|
// return p => p === 1 ? p : 3 * b * (1 - p) * (1 - p) * p + 3 * c * (1 - p) * p * p + p * p * p;
|
|
183
183
|
// };
|
|
184
|
-
_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var i=t<5?t+1:t;_insertEase(e+",Power"+(i-1),t?function(e){return Math.pow(e,i)}:function(e){return e},(function(e){return 1-Math.pow(1-e,i)}),(function(e){return e<.5?Math.pow(e*2,i)/2:1-Math.pow((1-e)*2,i)/2}))}));_easeMap.Linear.easeNone=_easeMap.none=_easeMap.Linear.easeIn;_insertEase("Elastic",_configElastic("in"),_configElastic("out"),_configElastic());(function(e,t){var i=1/t,
|
|
185
|
-
_insertEase("Circ",(function(e){return-(_sqrt(1-e*e)-1)}));_insertEase("Sine",(function(e){return e===1?1:-_cos(e*_HALF_PI)+1}));_insertEase("Back",_configBack("in"),_configBack("out"),_configBack());_easeMap.SteppedEase=_easeMap.steps=_globals.SteppedEase={config:function e(t,i){if(t===void 0){t=1}var
|
|
184
|
+
_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var i=t<5?t+1:t;_insertEase(e+",Power"+(i-1),t?function(e){return Math.pow(e,i)}:function(e){return e},(function(e){return 1-Math.pow(1-e,i)}),(function(e){return e<.5?Math.pow(e*2,i)/2:1-Math.pow((1-e)*2,i)/2}))}));_easeMap.Linear.easeNone=_easeMap.none=_easeMap.Linear.easeIn;_insertEase("Elastic",_configElastic("in"),_configElastic("out"),_configElastic());(function(e,t){var i=1/t,r=2*i,n=2.5*i,s=function s(o){return o<i?e*o*o:o<r?e*Math.pow(o-1.5/t,2)+.75:o<n?e*(o-=2.25/t)*o+.9375:e*Math.pow(o-2.625/t,2)+.984375};_insertEase("Bounce",(function(e){return 1-s(1-e)}),s)})(7.5625,2.75);_insertEase("Expo",(function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)}));// previously 2 ** (10 * (p - 1)) but that doesn't end up with the value quite at the right spot so we do a blended ease to ensure it lands where it should perfectly.
|
|
185
|
+
_insertEase("Circ",(function(e){return-(_sqrt(1-e*e)-1)}));_insertEase("Sine",(function(e){return e===1?1:-_cos(e*_HALF_PI)+1}));_insertEase("Back",_configBack("in"),_configBack("out"),_configBack());_easeMap.SteppedEase=_easeMap.steps=_globals.SteppedEase={config:function e(t,i){if(t===void 0){t=1}var r=1/t,n=t+(i?0:1),s=i?1:0,o=1-_tinyNum;return function(e){return((n*_clamp(0,o,e)|0)+s)*r}}};_defaults.ease=_easeMap["quad.out"];_forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(e){return _callbackNames+=e+","+e+"Params,"}));
|
|
186
186
|
/*
|
|
187
187
|
* --------------------------------------------------------------------------------------
|
|
188
188
|
* CACHE
|
|
@@ -194,9 +194,9 @@ _insertEase("Circ",(function(e){return-(_sqrt(1-e*e)-1)}));_insertEase("Sine",(f
|
|
|
194
194
|
* --------------------------------------------------------------------------------------
|
|
195
195
|
*/var Animation=function(){function e(e){this.vars=e;this._delay=+e.delay||0;if(this._repeat=e.repeat===Infinity?-2:e.repeat||0){
|
|
196
196
|
// TODO: repeat: Infinity on a timeline's children must flag that timeline internally and affect its totalDuration, otherwise it'll stop in the negative direction when reaching the start.
|
|
197
|
-
this._rDelay=e.repeatDelay||0;this._yoyo=!!e.yoyo||!!e.yoyoEase}this._ts=1;_setDuration(this,+e.duration,1,1);this.data=e.data;if(_context){this._ctx=_context;_context.data.push(this)}_tickerActive||_ticker.wake()}var t=e.prototype;t.delay=function e(t){if(t||t===0){this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay);this._delay=t;return this}return this._delay};t.duration=function e(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur};t.totalDuration=function e(t){if(!arguments.length){return this._tDur}this._dirty=0;return _setDuration(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))};t.totalTime=function e(t,i){_wake();if(!arguments.length){return this._tTime}var
|
|
197
|
+
this._rDelay=e.repeatDelay||0;this._yoyo=!!e.yoyo||!!e.yoyoEase}this._ts=1;_setDuration(this,+e.duration,1,1);this.data=e.data;if(_context){this._ctx=_context;_context.data.push(this)}_tickerActive||_ticker.wake()}var t=e.prototype;t.delay=function e(t){if(t||t===0){this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay);this._delay=t;return this}return this._delay};t.duration=function e(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur};t.totalDuration=function e(t){if(!arguments.length){return this._tDur}this._dirty=0;return _setDuration(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))};t.totalTime=function e(t,i){_wake();if(!arguments.length){return this._tTime}var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){_alignPlayhead(this,t);!r._dp||r.parent||_postAddChecks(r,this);// edge case: if this is a child of a timeline that already completed, for example, we must re-activate the parent.
|
|
198
198
|
//in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The start of that child would get pushed out, but one of the ancestors may have completed.
|
|
199
|
-
while(
|
|
199
|
+
while(r&&r.parent){if(r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)){r.totalTime(r._tTime,true)}r=r.parent}if(!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)){
|
|
200
200
|
//if the animation doesn't have a parent, put it back into its last parent (recorded as _dp for exactly cases like this). Limit to parents with autoRemoveChildren (like globalTimeline) so that if the user manually removes an animation from a timeline and then alters its playhead, it doesn't get added back in.
|
|
201
201
|
_addToTimeline(this._dp,this,this._start-this._delay)}}if(this._tTime!==t||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===_tinyNum||!this._initted&&this._dur&&t||!t&&!this._initted&&(this.add||this._ptLookup)){
|
|
202
202
|
// check for _ptLookup on a Tween instance to ensure it has actually finished being instantiated, otherwise if this.reverse() gets called in the Animation constructor, it could trigger a render() here even though the _targets weren't populated, thus when _init() is called there won't be any PropTweens (it'll act like the tween is non-functional)
|
|
@@ -206,14 +206,14 @@ this._ts||(this._pTime=t);// otherwise, if an animation is paused, then the play
|
|
|
206
206
|
_lazySafeRender(this,t,i);// this._lock = 0;
|
|
207
207
|
//}
|
|
208
208
|
}return this};t.time=function e(t,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+_elapsedCycleDuration(this))%(this._dur+this._rDelay)||(t?this._dur:0),i):this._time;// note: if the modulus results in 0, the playhead could be exactly at the end or the beginning, and we always defer to the END with a non-zero value, otherwise if you set the time() to the very end (duration()), it would render at the START!
|
|
209
|
-
};t.totalProgress=function e(t,i){return arguments.length?this.totalTime(this.totalDuration()*t,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0};t.progress=function e(t,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+_elapsedCycleDuration(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0};t.iteration=function e(t,i){var
|
|
209
|
+
};t.totalProgress=function e(t,i){return arguments.length?this.totalTime(this.totalDuration()*t,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0};t.progress=function e(t,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+_elapsedCycleDuration(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0};t.iteration=function e(t,i){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,i):this._repeat?_animationCycle(this._tTime,r)+1:1}// potential future addition:;
|
|
210
210
|
t.timeScale=function e(t,i){if(!arguments.length){return this._rts===-_tinyNum?0:this._rts;// recorded timeScale. Special case: if someone calls reverse() on an animation with timeScale of 0, we assign it -_tinyNum to remember it's reversed.
|
|
211
|
-
}if(this._rts===t){return this}var
|
|
211
|
+
}if(this._rts===t){return this}var r=this.parent&&this._ts?_parentToChildTotalTime(this.parent._time,this):this._tTime;// make sure to do the parentToChildTotalTime() BEFORE setting the new _ts because the old one must be used in that calculation.
|
|
212
212
|
// future addition? Up side: fast and minimal file size. Down side: only works on this animation; if a timeline is reversed, for example, its childrens' onReverse wouldn't get called.
|
|
213
213
|
//(+value < 0 && this._rts >= 0) && _callback(this, "onReverse", true);
|
|
214
214
|
// prioritize rendering where the parent's playhead lines up instead of this._tTime because there could be a tween that's animating another tween's timeScale in the same rendering loop (same parent), thus if the timeScale tween renders first, it would alter _start BEFORE _tTime was set on that tick (in the rendering loop), effectively freezing it until the timeScale tween finishes.
|
|
215
215
|
this._rts=+t||0;this._ts=this._ps||t===-_tinyNum?0:this._rts;// _ts is the functional timeScale which would be 0 if the animation is paused.
|
|
216
|
-
this.totalTime(_clamp(-Math.abs(this._delay),this.totalDuration(),
|
|
216
|
+
this.totalTime(_clamp(-Math.abs(this._delay),this.totalDuration(),r),i!==false);_setEnd(this);// if parent.smoothChildTiming was false, the end time didn't get updated in the _alignPlayhead() method, so do it here.
|
|
217
217
|
return _recacheAncestors(this)};t.paused=function e(t){if(!arguments.length){return this._ps}// possible future addition - if an animation is removed from its parent and then .restart() or .play() or .resume() is called, perhaps we should force it back into the globalTimeline but be careful because what if it's already at its end? We don't want it to just persist forever and not get released for GC.
|
|
218
218
|
// !this.parent && !value && this._tTime < this._tDur && this !== _globalTimeline && _globalTimeline.add(this);
|
|
219
219
|
if(this._ps!==t){this._ps=t;if(t){this._pTime=this._tTime||Math.max(-this._delay,this.rawTime());// if the pause occurs during the delay phase, make sure that's factored in when resuming.
|
|
@@ -221,28 +221,28 @@ this._ts=this._act=0;// _ts is the functional timeScale, so a paused tween would
|
|
|
221
221
|
}else{_wake();this._ts=this._rts;//only defer to _pTime (pauseTime) if tTime is zero. Remember, someone could pause() an animation, then scrub the playhead and resume(). If the parent doesn't have smoothChildTiming, we render at the rawTime() because the startTime won't get updated.
|
|
222
222
|
this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==_tinyNum&&(this._tTime-=_tinyNum));// edge case: animation.progress(1).pause().play() wouldn't render again because the playhead is already at the end, but the call to totalTime() below will add it back to its parent...and not remove it again (since removing only happens upon rendering at a new time). Offsetting the _tTime slightly is done simply to cause the final render in totalTime() that'll pop it off its timeline (if autoRemoveChildren is true, of course). Check to make sure _zTime isn't -_tinyNum to avoid an edge case where the playhead is pushed to the end but INSIDE a tween/callback, the timeline itself is paused thus halting rendering and leaving a few unrendered. When resuming, it wouldn't render those otherwise.
|
|
223
223
|
}}return this};t.startTime=function e(t){if(arguments.length){this._start=_roundPrecise(t);var i=this.parent||this._dp;i&&(i._sort||!this.parent)&&_addToTimeline(i,this,this._start-this._delay);return this}return this._start};t.endTime=function e(t){return this._start+(_isNotFalse(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)};t.rawTime=function e(t){var i=this.parent||this._dp;// _dp = detached parent
|
|
224
|
-
return!i?this._tTime:t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):!this._ts?this._tTime:_parentToChildTotalTime(i.rawTime(t),this)};t.revert=function e(t){if(t===void 0){t=_revertConfig}var i=_reverting$1;_reverting$1=t;if(_isRevertWorthy(this)){this.timeline&&this.timeline.revert(t);this.totalTime(-.01,t.suppressEvents)}this.data!=="nested"&&t.kill!==false&&this.kill();_reverting$1=i;return this};t.globalTime=function e(t){var i=this,
|
|
224
|
+
return!i?this._tTime:t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):!this._ts?this._tTime:_parentToChildTotalTime(i.rawTime(t),this)};t.revert=function e(t){if(t===void 0){t=_revertConfig}var i=_reverting$1;_reverting$1=t;if(_isRevertWorthy(this)){this.timeline&&this.timeline.revert(t);this.totalTime(-.01,t.suppressEvents)}this.data!=="nested"&&t.kill!==false&&this.kill();_reverting$1=i;return this};t.globalTime=function e(t){var i=this,r=arguments.length?t:i.rawTime();while(i){r=i._start+r/(Math.abs(i._ts)||1);i=i._dp}return!this.parent&&this._sat?this._sat.globalTime(t):r;// the _startAt tweens for .fromTo() and .from() that have immediateRender should always be FIRST in the timeline (important for context.revert()). "_sat" stands for _startAtTween, referring to the parent tween that created the _startAt. We must discern if that tween had immediateRender so that we can know whether or not to prioritize it in revert().
|
|
225
225
|
};t.repeat=function e(t){if(arguments.length){this._repeat=t===Infinity?-2:t;return _onUpdateTotalDuration(this)}return this._repeat===-2?Infinity:this._repeat};t.repeatDelay=function e(t){if(arguments.length){var i=this._time;this._rDelay=t;_onUpdateTotalDuration(this);return i?this.time(i):this}return this._rDelay};t.yoyo=function e(t){if(arguments.length){this._yoyo=t;return this}return this._yoyo};t.seek=function e(t,i){return this.totalTime(_parsePosition(this,t),_isNotFalse(i))};t.restart=function e(t,i){this.play().totalTime(t?-this._delay:0,_isNotFalse(i));this._dur||(this._zTime=-_tinyNum);// ensures onComplete fires on a zero-duration animation that gets restarted.
|
|
226
226
|
return this};t.play=function e(t,i){t!=null&&this.seek(t,i);return this.reversed(false).paused(false)};t.reverse=function e(t,i){t!=null&&this.seek(t||this.totalDuration(),i);return this.reversed(true).paused(false)};t.pause=function e(t,i){t!=null&&this.seek(t,i);return this.paused(true)};t.resume=function e(){return this.paused(false)};t.reversed=function e(t){if(arguments.length){!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-_tinyNum:0));// in case timeScale is zero, reversing would have no effect so we use _tinyNum.
|
|
227
|
-
return this}return this._rts<0};t.invalidate=function e(){this._initted=this._act=0;this._zTime=-_tinyNum;return this};t.isActive=function e(){var t=this.parent||this._dp,i=this._start,
|
|
228
|
-
|
|
227
|
+
return this}return this._rts<0};t.invalidate=function e(){this._initted=this._act=0;this._zTime=-_tinyNum;return this};t.isActive=function e(){var t=this.parent||this._dp,i=this._start,r;return!!(!t||this._ts&&this._initted&&t.isActive()&&(r=t.rawTime(true))>=i&&r<this.endTime(true)-_tinyNum)};t.eventCallback=function e(t,i,r){var n=this.vars;if(arguments.length>1){if(!i){delete n[t]}else{n[t]=i;r&&(n[t+"Params"]=r);t==="onUpdate"&&(this._onUpdate=i)}return this}return n[t]};t.then=function e(t){var i=this,r=i._prom;return new Promise((function(e){var n=_isFunction(t)?t:_passThrough,s=function t(){var s=i.then;i.then=null;// temporarily null the then() method to avoid an infinite loop (see https://github.com/greensock/GSAP/issues/322)
|
|
228
|
+
r&&r();_isFunction(n)&&(n=n(i))&&(n.then||n===i)&&(i.then=s);e(n);i.then=s};if(i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0){s()}else{i._prom=s}}))};t.kill=function e(){_interrupt(this)};return e}();_setDefaults(Animation.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:false,parent:null,_initted:false,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-_tinyNum,_prom:0,_ps:false,_rts:1});
|
|
229
229
|
/*
|
|
230
230
|
* -------------------------------------------------
|
|
231
231
|
* TIMELINE
|
|
232
232
|
* -------------------------------------------------
|
|
233
|
-
*/var Timeline=function(e){_inheritsLoose(t,e);function t(t,i){var
|
|
234
|
-
i.staggerTo=function e(t,i,n,
|
|
233
|
+
*/var Timeline=function(e){_inheritsLoose(t,e);function t(t,i){var r;if(t===void 0){t={}}r=e.call(this,t)||this;r.labels={};r.smoothChildTiming=!!t.smoothChildTiming;r.autoRemoveChildren=!!t.autoRemoveChildren;r._sort=_isNotFalse(t.sortChildren);_globalTimeline&&_addToTimeline(t.parent||_globalTimeline,_assertThisInitialized(r),i);t.reversed&&r.reverse();t.paused&&r.paused(true);t.scrollTrigger&&_scrollTrigger(_assertThisInitialized(r),t.scrollTrigger);return r}var i=t.prototype;i.to=function e(t,i,r){_createTweenType(0,arguments,this);return this};i.from=function e(t,i,r){_createTweenType(1,arguments,this);return this};i.fromTo=function e(t,i,r,n){_createTweenType(2,arguments,this);return this};i.set=function e(t,i,r){i.duration=0;i.parent=this;_inheritDefaults(i).repeatDelay||(i.repeat=0);i.immediateRender=!!i.immediateRender;new Tween(t,i,_parsePosition(this,r),1);return this};i.call=function e(t,i,r){return _addToTimeline(this,Tween.delayedCall(0,t,i),r)}//ONLY for backward compatibility! Maybe delete?;
|
|
234
|
+
i.staggerTo=function e(t,i,r,n,s,o,a){r.duration=i;r.stagger=r.stagger||n;r.onComplete=o;r.onCompleteParams=a;r.parent=this;new Tween(t,r,_parsePosition(this,s));return this};i.staggerFrom=function e(t,i,r,n,s,o,a){r.runBackwards=1;_inheritDefaults(r).immediateRender=_isNotFalse(r.immediateRender);return this.staggerTo(t,i,r,n,s,o,a)};i.staggerFromTo=function e(t,i,r,n,s,o,a,u){n.startAt=r;_inheritDefaults(n).immediateRender=_isNotFalse(n.immediateRender);return this.staggerTo(t,i,n,s,o,a,u)};i.render=function e(t,i,r){var n=this._time,s=this._dirty?this.totalDuration():this._tDur,o=this._dur,a=t<=0?0:_roundPrecise(t),
|
|
235
235
|
// if a paused timeline is resumed (or its _start is updated for another reason...which rounds it), that could result in the playhead shifting a **tiny** amount and a zero-duration child at that spot may get rendered at a different ratio, like its totalTime in render() may be 1e-17 instead of 0, for example.
|
|
236
|
-
u=this._zTime<0!==t<0&&(this._initted||!o),f,l,h,_,c,d,m,p,g,v,C,y;this!==_globalTimeline&&a>s&&t>=0&&(a=s);if(a!==this._tTime||
|
|
236
|
+
u=this._zTime<0!==t<0&&(this._initted||!o),f,l,h,_,c,d,m,p,g,v,C,y;this!==_globalTimeline&&a>s&&t>=0&&(a=s);if(a!==this._tTime||r||u){if(n!==this._time&&o){
|
|
237
237
|
//if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump).
|
|
238
|
-
a+=this._time-
|
|
238
|
+
a+=this._time-n;t+=this._time-n}f=a;g=this._start;p=this._ts;d=!p;if(u){o||(n=this._zTime);//when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.
|
|
239
239
|
(t||!i)&&(this._zTime=t)}if(this._repeat){
|
|
240
240
|
//adjust the time for repeats and yoyos
|
|
241
|
-
C=this._yoyo;c=o+this._rDelay;if(this._repeat<-1&&t<0){return this.totalTime(c*100+t,i,
|
|
241
|
+
C=this._yoyo;c=o+this._rDelay;if(this._repeat<-1&&t<0){return this.totalTime(c*100+t,i,r)}f=_roundPrecise(a%c);//round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)
|
|
242
242
|
if(a===s){
|
|
243
243
|
// the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)
|
|
244
244
|
_=this._repeat;f=o}else{v=_roundPrecise(a/c);// full decimal version of iterations, not the previous iteration (we're reusing prevIteration variable for efficiency)
|
|
245
|
-
_=~~v;if(_&&_===v){f=o;_--}f>o&&(f=o)}v=_animationCycle(this._tTime,c);!
|
|
245
|
+
_=~~v;if(_&&_===v){f=o;_--}f>o&&(f=o)}v=_animationCycle(this._tTime,c);!n&&this._tTime&&v!==_&&this._tTime-v*c-this._dur<=0&&(v=_);// edge case - if someone does addPause() at the very beginning of a repeating timeline, that pause is technically at the same spot as the end which causes this._time to get set to 0 when the totalTime would normally place the playhead at the end. See https://gsap.com/forums/topic/23823-closing-nav-animation-not-working-on-ie-and-iphone-6-maybe-other-older-browser/?tab=comments#comment-113005 also, this._tTime - prevIteration * cycleDuration - this._dur <= 0 just checks to make sure it wasn't previously in the "repeatDelay" portion
|
|
246
246
|
if(C&&_&1){f=o-f;y=1}
|
|
247
247
|
/*
|
|
248
248
|
make sure children at the end/beginning of the timeline are rendered properly. If, for example,
|
|
@@ -251,81 +251,81 @@ if(C&&_&1){f=o-f;y=1}
|
|
|
251
251
|
could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So
|
|
252
252
|
we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must
|
|
253
253
|
ensure that zero-duration tweens at the very beginning or end of the Timeline work.
|
|
254
|
-
*/if(_!==v&&!this._lock){var w=C&&v&1,P=w===(C&&_&1);_<v&&(w=!w);
|
|
255
|
-
this._lock=1;this.render(
|
|
254
|
+
*/if(_!==v&&!this._lock){var w=C&&v&1,P=w===(C&&_&1);_<v&&(w=!w);n=w?0:a%o?o:a;// if the playhead is landing exactly at the end of an iteration, use that totalTime rather than only the duration, otherwise it'll skip the 2nd render since it's effectively at the same time.
|
|
255
|
+
this._lock=1;this.render(n||(y?0:_roundPrecise(_*c)),i,!o)._lock=0;this._tTime=a;// if a user gets the iteration() inside the onRepeat, for example, it should be accurate.
|
|
256
256
|
!i&&this.parent&&_callback(this,"onRepeat");if(this.vars.repeatRefresh&&!y){this.invalidate()._lock=1;v=_;// otherwise, the onStart() may fire on the 2nd iteration.
|
|
257
|
-
}if(
|
|
257
|
+
}if(n&&n!==this._time||d!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act){
|
|
258
258
|
// if prevTime is 0 and we render at the very end, _time will be the end, thus won't match. So in this edge case, prevTime won't match _time but that's okay. If it gets killed in the onRepeat, eject as well.
|
|
259
259
|
return this}o=this._dur;// in case the duration changed in the onRepeat
|
|
260
|
-
s=this._tDur;if(P){this._lock=2;
|
|
261
|
-
if(!this._initted){this._onUpdate=this.vars.onUpdate;this._initted=1;this._zTime=t;
|
|
262
|
-
}if(!
|
|
260
|
+
s=this._tDur;if(P){this._lock=2;n=w?o:-1e-4;this.render(n,true);this.vars.repeatRefresh&&!y&&this.invalidate()}this._lock=0;if(!this._ts&&!d){return this}}}if(this._hasPause&&!this._forcing&&this._lock<2){m=_findNextPauseTween(this,_roundPrecise(n),_roundPrecise(f));if(m){a-=f-(f=m._start)}}this._tTime=a;this._time=f;this._act=!!p;// as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.
|
|
261
|
+
if(!this._initted){this._onUpdate=this.vars.onUpdate;this._initted=1;this._zTime=t;n=0;// upon init, the playhead should always go forward; someone could invalidate() a completed timeline and then if they restart(), that would make child tweens render in reverse order which could lock in the wrong starting values if they build on each other, like tl.to(obj, {x: 100}).to(obj, {x: 0}).
|
|
262
|
+
}if(!n&&a&&o&&!i&&!v){_callback(this,"onStart");if(this._tTime!==a){
|
|
263
263
|
// in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.
|
|
264
|
-
return this}}if(f>=
|
|
264
|
+
return this}}if(f>=n&&t>=0){l=this._first;while(l){h=l._next;if((l._act||f>=l._start)&&l._ts&&m!==l){if(l.parent!==this){
|
|
265
265
|
// an extreme edge case - the child's render could do something like kill() the "next" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.
|
|
266
|
-
return this.render(t,i,
|
|
266
|
+
return this.render(t,i,r)}l.render(l._ts>0?(f-l._start)*l._ts:(l._dirty?l.totalDuration():l._tDur)+(f-l._start)*l._ts,i,r);if(f!==this._time||!this._ts&&!d){
|
|
267
267
|
//in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete
|
|
268
268
|
m=0;h&&(a+=this._zTime=-_tinyNum);// it didn't finish rendering, so flag zTime as negative so that the next time render() is called it'll be forced (to render any remaining children)
|
|
269
269
|
break}}l=h}}else{l=this._last;var T=t<0?t:f;//when the playhead goes backward beyond the start of this timeline, we must pass that information down to the child animations so that zero-duration tweens know whether to render their starting or ending values.
|
|
270
270
|
while(l){h=l._prev;if((l._act||T<=l._end)&&l._ts&&m!==l){if(l.parent!==this){
|
|
271
271
|
// an extreme edge case - the child's render could do something like kill() the "next" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.
|
|
272
|
-
return this.render(t,i,
|
|
272
|
+
return this.render(t,i,r)}l.render(l._ts>0?(T-l._start)*l._ts:(l._dirty?l.totalDuration():l._tDur)+(T-l._start)*l._ts,i,r||_reverting$1&&_isRevertWorthy(l));// if reverting, we should always force renders of initted tweens (but remember that .fromTo() or .from() may have a _startAt but not _initted yet). If, for example, a .fromTo() tween with a stagger (which creates an internal timeline) gets reverted BEFORE some of its child tweens render for the first time, it may not properly trigger them to revert.
|
|
273
273
|
if(f!==this._time||!this._ts&&!d){
|
|
274
274
|
//in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete
|
|
275
275
|
m=0;h&&(a+=this._zTime=T?-_tinyNum:_tinyNum);// it didn't finish rendering, so adjust zTime so that so that the next time render() is called it'll be forced (to render any remaining children)
|
|
276
|
-
break}}l=h}}if(m&&!i){this.pause();m.render(f>=
|
|
276
|
+
break}}l=h}}if(m&&!i){this.pause();m.render(f>=n?0:-_tinyNum)._zTime=f>=n?1:-1;if(this._ts){
|
|
277
277
|
//the callback resumed playback! So since we may have held back the playhead due to where the pause is positioned, go ahead and jump to where it's SUPPOSED to be (if no pause happened).
|
|
278
278
|
this._start=g;//if the pause was at an earlier time and the user resumed in the callback, it could reposition the timeline (changing its startTime), throwing things off slightly, so we make sure the _start doesn't shift.
|
|
279
|
-
_setEnd(this);return this.render(t,i,
|
|
279
|
+
_setEnd(this);return this.render(t,i,r)}}this._onUpdate&&!i&&_callback(this,"onUpdate",true);if(a===s&&this._tTime>=this.totalDuration()||!a&&n)if(g===this._start||Math.abs(p)!==Math.abs(this._ts))if(!this._lock){
|
|
280
280
|
// remember, a child's callback may alter this timeline's playhead or timeScale which is why we need to add some of these checks.
|
|
281
281
|
(t||!o)&&(a===s&&this._ts>0||!a&&this._ts<0)&&_removeFromParent(this,1);// don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.
|
|
282
|
-
if(!i&&!(t<0&&!
|
|
283
|
-
};i.getChildren=function e(t,i,n
|
|
282
|
+
if(!i&&!(t<0&&!n)&&(a||n||!s)){_callback(this,a===s&&t>=0?"onComplete":"onReverseComplete",true);this._prom&&!(a<s&&this.timeScale()>0)&&this._prom()}}}return this};i.add=function e(t,i){var r=this;_isNumber(i)||(i=_parsePosition(this,i,t));if(!(t instanceof Animation)){if(_isArray(t)){t.forEach((function(e){return r.add(e,i)}));return this}if(_isString(t)){return this.addLabel(t,i)}if(_isFunction(t)){t=Tween.delayedCall(0,t)}else{return this}}return this!==t?_addToTimeline(this,t,i):this;//don't allow a timeline to be added to itself as a child!
|
|
283
|
+
};i.getChildren=function e(t,i,r,n){if(t===void 0){t=true}if(i===void 0){i=true}if(r===void 0){r=true}if(n===void 0){n=-_bigNum$1}var s=[],o=this._first;while(o){if(o._start>=n){if(o instanceof Tween){i&&s.push(o)}else{r&&s.push(o);t&&s.push.apply(s,o.getChildren(true,i,r))}}o=o._next}return s};i.getById=function e(t){var i=this.getChildren(1,1,1),r=i.length;while(r--){if(i[r].vars.id===t){return i[r]}}};i.remove=function e(t){if(_isString(t)){return this.removeLabel(t)}if(_isFunction(t)){return this.killTweensOf(t)}t.parent===this&&_removeLinkedListItem(this,t);if(t===this._recent){this._recent=this._last}return _uncache(this)};i.totalTime=function t(i,r){if(!arguments.length){return this._tTime}this._forcing=1;if(!this._dp&&this._ts){
|
|
284
284
|
//special case for the global timeline (or any other that has no parent or detached parent).
|
|
285
|
-
this._start=_roundPrecise(_ticker.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))}e.prototype.totalTime.call(this,i,
|
|
285
|
+
this._start=_roundPrecise(_ticker.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))}e.prototype.totalTime.call(this,i,r);this._forcing=0;return this};i.addLabel=function e(t,i){this.labels[t]=_parsePosition(this,i);return this};i.removeLabel=function e(t){delete this.labels[t];return this};i.addPause=function e(t,i,r){var n=Tween.delayedCall(0,i||_emptyFunc,r);n.data="isPause";this._hasPause=1;return _addToTimeline(this,n,_parsePosition(this,t))};i.removePause=function e(t){var i=this._first;t=_parsePosition(this,t);while(i){if(i._start===t&&i.data==="isPause"){_removeFromParent(i)}i=i._next}};i.killTweensOf=function e(t,i,r){var n=this.getTweensOf(t,r),s=n.length;while(s--){_overwritingTween!==n[s]&&n[s].kill(t,i)}return this};i.getTweensOf=function e(t,i){var r=[],n=toArray(t),s=this._first,o=_isNumber(i),
|
|
286
286
|
// a number is interpreted as a global time. If the animation spans
|
|
287
|
-
a;while(s){if(s instanceof Tween){if(_arrayContainsAny(s._targets,
|
|
287
|
+
a;while(s){if(s instanceof Tween){if(_arrayContainsAny(s._targets,n)&&(o?(!_overwritingTween||s._initted&&s._ts)&&s.globalTime(0)<=i&&s.globalTime(s.totalDuration())>i:!i||s.isActive())){
|
|
288
288
|
// note: if this is for overwriting, it should only be for tweens that aren't paused and are initted.
|
|
289
|
-
|
|
290
|
-
i.tweenTo=function e(t,i){i=i||{};var
|
|
291
|
-
}},i));return f?h.render(0):h};i.tweenFromTo=function e(t,i,
|
|
292
|
-
|
|
293
|
-
a=
|
|
289
|
+
r.push(s)}}else if((a=s.getTweensOf(n,i)).length){r.push.apply(r,a)}s=s._next}return r}// potential future feature - targets() on timelines;
|
|
290
|
+
i.tweenTo=function e(t,i){i=i||{};var r=this,n=_parsePosition(r,t),s=i,o=s.startAt,a=s.onStart,u=s.onStartParams,f=s.immediateRender,l,h=Tween.to(r,_setDefaults({ease:i.ease||"none",lazy:false,immediateRender:false,time:n,overwrite:"auto",duration:i.duration||Math.abs((n-(o&&"time"in o?o.time:r._time))/r.timeScale())||_tinyNum,onStart:function e(){r.pause();if(!l){var t=i.duration||Math.abs((n-(o&&"time"in o?o.time:r._time))/r.timeScale());h._dur!==t&&_setDuration(h,t,0,1).render(h._time,true,true);l=1}a&&a.apply(h,u||[]);//in case the user had an onStart in the vars - we don't want to overwrite it.
|
|
291
|
+
}},i));return f?h.render(0):h};i.tweenFromTo=function e(t,i,r){return this.tweenTo(i,_setDefaults({startAt:{time:_parsePosition(this,t)}},r))};i.recent=function e(){return this._recent};i.nextLabel=function e(t){if(t===void 0){t=this._time}return _getLabelInDirection(this,_parsePosition(this,t))};i.previousLabel=function e(t){if(t===void 0){t=this._time}return _getLabelInDirection(this,_parsePosition(this,t),1)};i.currentLabel=function e(t){return arguments.length?this.seek(t,true):this.previousLabel(this._time+_tinyNum)};i.shiftChildren=function e(t,i,r){if(r===void 0){r=0}var n=this._first,s=this.labels,o;t=_roundPrecise(t);while(n){if(n._start>=r){n._start+=t;n._end+=t}n=n._next}if(i){for(o in s){if(s[o]>=r){s[o]+=t}}}return _uncache(this)};i.invalidate=function t(i){var r=this._first;this._lock=0;while(r){r.invalidate(i);r=r._next}return e.prototype.invalidate.call(this,i)};i.clear=function e(t){if(t===void 0){t=true}var i=this._first,r;while(i){r=i._next;this.remove(i);i=r}this._dp&&(this._time=this._tTime=this._pTime=0);t&&(this.labels={});return _uncache(this)};i.totalDuration=function e(t){var i=0,r=this,n=r._last,s=_bigNum$1,o,a,u;if(arguments.length){return r.timeScale((r._repeat<0?r.duration():r.totalDuration())/(r.reversed()?-t:t))}if(r._dirty){u=r.parent;while(n){o=n._prev;//record it here in case the tween changes position in the sequence...
|
|
292
|
+
n._dirty&&n.totalDuration();//could change the tween._startTime, so make sure the animation's cache is clean before analyzing it.
|
|
293
|
+
a=n._start;if(a>s&&r._sort&&n._ts&&!r._lock){
|
|
294
294
|
//in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence
|
|
295
|
-
|
|
296
|
-
_addToTimeline(n,
|
|
295
|
+
r._lock=1;//prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add().
|
|
296
|
+
_addToTimeline(r,n,a-n._delay,1)._lock=0}else{s=a}if(a<0&&n._ts){
|
|
297
297
|
//children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found.
|
|
298
|
-
i-=a;if(!u&&!
|
|
298
|
+
i-=a;if(!u&&!r._dp||u&&u.smoothChildTiming){r._start+=_roundPrecise(a/r._ts);r._time-=a;r._tTime-=a}r.shiftChildren(-a,false,-Infinity);s=0}n._end>i&&n._ts&&(i=n._end);n=o}_setDuration(r,r===_globalTimeline&&r._time>i?r._time:i,1,1);r._dirty=0}return r._tDur};t.updateRoot=function e(t){if(_globalTimeline._ts){_lazySafeRender(_globalTimeline,_parentToChildTotalTime(t,_globalTimeline));_lastRenderedFrame=_ticker.frame}if(_ticker.frame>=_nextGCFrame){_nextGCFrame+=_config.autoSleep||120;var i=_globalTimeline._first;if(!i||!i._ts)if(_config.autoSleep&&_ticker._listeners.length<2){while(i&&!i._ts){i=i._next}i||_ticker.sleep()}}};return t}(Animation);_setDefaults(Timeline.prototype,{_lock:0,_hasPause:0,_forcing:0});var _addComplexStringPropTween=function e(t,i,r,n,s,o,a){
|
|
299
299
|
//note: we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus "this" would refer to the plugin.
|
|
300
|
-
var u=new PropTween(this._pt,t,i,0,1,_renderComplexString,null,s),f=0,l=0,h,_,c,d,m,p,g,v;u.b=
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
var u=new PropTween(this._pt,t,i,0,1,_renderComplexString,null,s),f=0,l=0,h,_,c,d,m,p,g,v;u.b=r;u.e=n;r+="";//ensure values are strings
|
|
301
|
+
n+="";if(g=~n.indexOf("random(")){n=_replaceRandom(n)}if(o){v=[r,n];o(v,t,i);//pass an array with the starting and ending values and let the filter do whatever it needs to the values.
|
|
302
|
+
r=v[0];n=v[1]}_=r.match(_complexStringNumExp)||[];while(h=_complexStringNumExp.exec(n)){d=h[0];m=n.substring(f,h.index);if(c){c=(c+1)%5}else if(m.substr(-5)==="rgba("){c=1}if(d!==_[l++]){p=parseFloat(_[l-1])||0;//these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.
|
|
303
303
|
u._pt={_next:u._pt,p:m||l===1?m:",",
|
|
304
304
|
//note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
|
|
305
|
-
s:p,c:d.charAt(1)==="="?_parseRelative(p,d)-p:parseFloat(d)-p,m:c&&c<4?Math.round:0};f=_complexStringNumExp.lastIndex}}u.c=f<
|
|
306
|
-
u.fp=a;if(_relExp.test(
|
|
305
|
+
s:p,c:d.charAt(1)==="="?_parseRelative(p,d)-p:parseFloat(d)-p,m:c&&c<4?Math.round:0};f=_complexStringNumExp.lastIndex}}u.c=f<n.length?n.substring(f,n.length):"";//we use the "c" of the PropTween to store the final part of the string (after the last number)
|
|
306
|
+
u.fp=a;if(_relExp.test(n)||g){u.e=0;//if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).
|
|
307
307
|
}this._pt=u;//start the linked list with this new PropTween. Remember, we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus "this" would refer to the plugin.
|
|
308
|
-
return u},_addPropTween=function e(t,i,n,
|
|
308
|
+
return u},_addPropTween=function e(t,i,r,n,s,o,a,u,f,l){_isFunction(n)&&(n=n(s||0,t,o));var h=t[i],_=r!=="get"?r:!_isFunction(h)?h:f?t[i.indexOf("set")||!_isFunction(t["get"+i.substr(3)])?i:"get"+i.substr(3)](f):t[i](),c=!_isFunction(h)?_setterPlain:f?_setterFuncWithParam:_setterFunc,d;if(_isString(n)){if(~n.indexOf("random(")){n=_replaceRandom(n)}if(n.charAt(1)==="="){d=_parseRelative(_,n)+(getUnit(_)||0);if(d||d===0){
|
|
309
309
|
// to avoid isNaN, like if someone passes in a value like "!= whatever"
|
|
310
|
-
|
|
310
|
+
n=d}}}if(!l||_!==n||_forceAllPropTweens){if(!isNaN(_*n)&&n!==""){
|
|
311
311
|
// fun fact: any number multiplied by "" is evaluated as the number 0!
|
|
312
|
-
d=new PropTween(this._pt,t,i,+_||0,
|
|
312
|
+
d=new PropTween(this._pt,t,i,+_||0,n-(_||0),typeof h==="boolean"?_renderBoolean:_renderPlain,0,c);f&&(d.fp=f);a&&d.modifier(a,this,t);return this._pt=d}!h&&!(i in t)&&_missingPlugin(i,n);return _addComplexStringPropTween.call(this,t,i,_,n,c,u||_config.stringFilter,f)}},
|
|
313
313
|
//creates a copy of the vars object and processes any function-based values (putting the resulting values directly into the copy) as well as strings with "random()" in them. It does NOT process relative values.
|
|
314
|
-
_processVars=function e(t,i,n,
|
|
314
|
+
_processVars=function e(t,i,r,n,s){_isFunction(t)&&(t=_parseFuncOrString(t,s,i,r,n));if(!_isObject(t)||t.style&&t.nodeType||_isArray(t)||_isTypedArray(t)){return _isString(t)?_parseFuncOrString(t,s,i,r,n):t}var o={},a;for(a in t){o[a]=_parseFuncOrString(t[a],s,i,r,n)}return o},_checkPlugin=function e(t,i,r,n,s,o){var a,u,f,l;if(_plugins[t]&&(a=new _plugins[t]).init(s,a.rawVars?i[t]:_processVars(i[t],n,s,o,r),r,n,o)!==false){r._pt=u=new PropTween(r._pt,s,t,0,1,a.render,a,0,a.priority);if(r!==_quickTween){f=r._ptLookup[r._targets.indexOf(s)];//note: we can't use tween._ptLookup[index] because for staggered tweens, the index from the fullTargets array won't match what it is in each individual tween that spawns from the stagger.
|
|
315
315
|
l=a._props.length;while(l--){f[a._props[l]]=u}}}return a},_overwritingTween,
|
|
316
316
|
//store a reference temporarily so we can avoid overwriting itself.
|
|
317
|
-
_forceAllPropTweens,_initTween=function e(t,i,
|
|
318
|
-
if(t._from)t.ratio=1;if(!y||_&&!
|
|
317
|
+
_forceAllPropTweens,_initTween=function e(t,i,r){var n=t.vars,s=n.ease,o=n.startAt,a=n.immediateRender,u=n.lazy,f=n.onUpdate,l=n.runBackwards,h=n.yoyoEase,_=n.keyframes,c=n.autoRevert,d=t._dur,m=t._startAt,p=t._targets,g=t.parent,v=g&&g.data==="nested"?g.vars.targets:p,C=t._overwrite==="auto"&&!_suppressOverwrites,y=t.timeline,w=n.easeReverse||h,P,T,S,x,b,M,k,F,E,j,N,A,D;y&&(!_||!s)&&(s="none");t._ease=_parseEase(s,_defaults.ease);t._rEase=w&&(_parseEase(w)||t._ease);t._from=!y&&!!n.runBackwards;//nested timelines should never run backwards - the backwards-ness is in the child tweens.
|
|
318
|
+
if(t._from)t.ratio=1;if(!y||_&&!n.stagger){
|
|
319
319
|
//if there's an internal timeline, skip all the parsing because we passed that task down the chain.
|
|
320
|
-
F=p[0]?_getCache(p[0]).harness:0;A=F&&
|
|
321
|
-
P=_copyExcluding(
|
|
320
|
+
F=p[0]?_getCache(p[0]).harness:0;A=F&&n[F.prop];//someone may need to specify CSS-specific values AND non-CSS values, like if the element has an "x" property plus it's a standard DOM element. We allow people to distinguish by wrapping plugin-specific stuff in a css:{} object for example.
|
|
321
|
+
P=_copyExcluding(n,_reservedProps);if(m){m._zTime<0&&m.progress(1);// in case it's a lazy startAt that hasn't rendered yet.
|
|
322
322
|
i<0&&l&&a&&!c?m.render(-1,true):m.revert(l&&d?_revertConfigNoKill:_startAtRevertConfig);// if it's a "startAt" (not "from()" or runBackwards: true), we only need to do a shallow revert (keep transforms cached in CSSPlugin)
|
|
323
323
|
// don't just _removeFromParent(prevStartAt.render(-1, true)) because that'll leave inline styles. We're creating a new _startAt for "startAt" tweens that re-capture things to ensure that if the pre-tween values changed since the tween was created, they're recorded.
|
|
324
324
|
m._lazy=0}if(o){_removeFromParent(t._startAt=Tween.set(p,_setDefaults({data:"isStart",overwrite:false,parent:g,immediateRender:true,lazy:!m&&_isNotFalse(u),startAt:null,delay:0,onUpdate:f&&function(){return _callback(t,"onUpdate")},stagger:0},o)));//copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, from, to).fromTo(e, to, from);
|
|
325
325
|
t._startAt._dp=0;// don't allow it to get put back into root timeline! Like when revert() is called and totalTime() gets set.
|
|
326
326
|
t._startAt._sat=t;// used in globalTime(). _sat stands for _startAtTween
|
|
327
327
|
i<0&&(_reverting$1||!a&&!c)&&t._startAt.revert(_revertConfigNoKill);// rare edge case, like if a render is forced in the negative direction of a non-initted tween.
|
|
328
|
-
if(a){if(d&&i<=0&&
|
|
328
|
+
if(a){if(d&&i<=0&&r<=0){
|
|
329
329
|
// check tTime here because in the case of a yoyo tween whose playhead gets pushed to the end like tween.progress(1), we should allow it through so that the onComplete gets fired properly.
|
|
330
330
|
i&&(t._zTime=i);return;//we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a Timeline, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting.
|
|
331
331
|
}}}else if(l&&d){
|
|
@@ -340,11 +340,11 @@ _removeFromParent(t._startAt=Tween.set(p,S));t._startAt._dp=0;// don't allow it
|
|
|
340
340
|
t._startAt._sat=t;// used in globalTime()
|
|
341
341
|
i<0&&(_reverting$1?t._startAt.revert(_revertConfigNoKill):t._startAt.render(-1,true));t._zTime=i;if(!a){e(t._startAt,_tinyNum,_tinyNum);//ensures that the initial values are recorded
|
|
342
342
|
}else if(!i){return}}}t._pt=t._ptCache=0;u=d&&_isNotFalse(u)||u&&!d;for(T=0;T<p.length;T++){b=p[T];k=b._gsap||_harness(p)[T]._gsap;t._ptLookup[T]=j={};_lazyLookup[k.id]&&_lazyTweens.length&&_lazyRender();//if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end)
|
|
343
|
-
N=v===p?T:v.indexOf(b);if(F&&(E=new F).init(b,A||P,t,N,v)!==false){t._pt=x=new PropTween(t._pt,b,E.name,0,1,E.render,E,0,E.priority);E._props.forEach((function(e){j[e]=x}));E.priority&&(M=1)}if(!F||A){for(S in P){if(_plugins[S]&&(E=_checkPlugin(S,P,t,N,b,v))){E.priority&&(M=1)}else{j[S]=x=_addPropTween.call(t,b,S,"get",P[S],N,v,0,
|
|
343
|
+
N=v===p?T:v.indexOf(b);if(F&&(E=new F).init(b,A||P,t,N,v)!==false){t._pt=x=new PropTween(t._pt,b,E.name,0,1,E.render,E,0,E.priority);E._props.forEach((function(e){j[e]=x}));E.priority&&(M=1)}if(!F||A){for(S in P){if(_plugins[S]&&(E=_checkPlugin(S,P,t,N,b,v))){E.priority&&(M=1)}else{j[S]=x=_addPropTween.call(t,b,S,"get",P[S],N,v,0,n.stringFilter)}}}t._op&&t._op[T]&&t.kill(b,t._op[T]);if(C&&t._pt){_overwritingTween=t;_globalTimeline.killTweensOf(b,j,t.globalTime(i));// make sure the overwriting doesn't overwrite THIS tween!!!
|
|
344
344
|
D=!t.parent;_overwritingTween=0}t._pt&&u&&(_lazyLookup[k.id]=1)}M&&_sortPropTweensByPriority(t);t._onInit&&t._onInit(t);//plugins like RoundProps must wait until ALL of the PropTweens are instantiated. In the plugin's init() function, it sets the _onInit on the tween instance. May not be pretty/intuitive, but it's fast and keeps file size down.
|
|
345
345
|
}t._onUpdate=f;t._initted=(!t._op||t._pt)&&!D;// if overwrittenProps resulted in the entire tween being killed, do NOT flag it as initted or else it may render for one tick.
|
|
346
346
|
_&&i<=0&&y.render(_bigNum$1,true,true);// if there's a 0% keyframe, it'll render in the "before" state for any staggered/delayed animations thus when the following tween initializes, it'll use the "before" state instead of the "after" state as the initial values.
|
|
347
|
-
},_updatePropTweens=function e(t,i,n,
|
|
347
|
+
},_updatePropTweens=function e(t,i,r,n,s,o,a,u){var f=(t._pt&&t._ptCache||(t._ptCache={}))[i],l,h,_,c;if(!f){f=t._ptCache[i]=[];_=t._ptLookup;c=t._targets.length;while(c--){l=_[c][i];if(l&&l.d&&l.d._pt){
|
|
348
348
|
// it's a plugin, so find the nested PropTween
|
|
349
349
|
l=l.d._pt;while(l&&l.p!==i&&l.fp!==i){
|
|
350
350
|
// "fp" is functionParam for things like setting CSS variables which require .setProperty("--var-name", value)
|
|
@@ -354,17 +354,17 @@ l=l._next}}if(!l){
|
|
|
354
354
|
_forceAllPropTweens=1;// otherwise, when we _addPropTween() and it finds no change between the start and end values, it skips creating a PropTween (for efficiency...why tween when there's no difference?) but in this case we NEED that PropTween created so we can edit it.
|
|
355
355
|
t.vars[i]="+=0";_initTween(t,a);_forceAllPropTweens=0;return u?_warn(i+" not eligible for reset. Try splitting into individual properties"):1;// if someone tries to do a quickTo() on a special property like borderRadius which must get split into 4 different properties, that's not eligible for .resetTo().
|
|
356
356
|
}f.push(l)}}c=f.length;while(c--){h=f[c];l=h._pt||h;// complex values may have nested PropTweens. We only accommodate the FIRST value.
|
|
357
|
-
l.s=(
|
|
357
|
+
l.s=(n||n===0)&&!s?n:l.s+(n||0)+o*l.c;l.c=r-l.s;h.e&&(h.e=_round(r)+getUnit(h.e));// mainly for CSSPlugin (end value)
|
|
358
358
|
h.b&&(h.b=l.s+getUnit(h.b));// (beginning value)
|
|
359
|
-
}},_addAliasesToVars=function e(t,i){var
|
|
359
|
+
}},_addAliasesToVars=function e(t,i){var r=t[0]?_getCache(t[0]).harness:0,n=r&&r.aliases,s,o,a,u;if(!n){return i}s=_merge({},i);for(o in n){if(o in s){u=n[o].split(",");a=u.length;while(a--){s[u[a]]=s[o]}}}return s},
|
|
360
360
|
// parses multiple formats, like {"0%": {x: 100}, {"50%": {x: -20}} and { x: {"0%": 100, "50%": -20} }, and an "ease" can be set on any object. We populate an "allProps" object with an Array for each property, like {x: [{}, {}], y:[{}, {}]} with data for each property tween. The objects have a "t" (time), "v", (value), and "e" (ease) property. This allows us to piece together a timeline later.
|
|
361
|
-
_parseKeyframe=function e(t,i,n
|
|
362
|
-
i.forEach((function(e,t){return a.push({t:t/(i.length-1)*100,v:e,e:s})}))}else{for(o in i){a=
|
|
361
|
+
_parseKeyframe=function e(t,i,r,n){var s=i.ease||n||"power1.inOut",o,a;if(_isArray(i)){a=r[t]||(r[t]=[]);// t = time (out of 100), v = value, e = ease
|
|
362
|
+
i.forEach((function(e,t){return a.push({t:t/(i.length-1)*100,v:e,e:s})}))}else{for(o in i){a=r[o]||(r[o]=[]);o==="ease"||a.push({t:parseFloat(t),v:i[o],e:s})}}},_parseFuncOrString=function e(t,i,r,n,s){return _isFunction(t)?t.call(i,r,n,s):_isString(t)&&~t.indexOf("random(")?_replaceRandom(t):t},_staggerTweenProps=_callbackNames+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",_staggerPropsToSkip={};_forEachName(_staggerTweenProps+",id,stagger,delay,duration,paused,scrollTrigger",(function(e){return _staggerPropsToSkip[e]=1}));
|
|
363
363
|
/*
|
|
364
364
|
* --------------------------------------------------------------------------------------
|
|
365
365
|
* TWEEN
|
|
366
366
|
* --------------------------------------------------------------------------------------
|
|
367
|
-
*/var Tween=function(e){_inheritsLoose(t,e);function t(t,i,n
|
|
367
|
+
*/var Tween=function(e){_inheritsLoose(t,e);function t(t,i,r,n){var s;if(typeof i==="number"){r.duration=i;i=r;r=null}s=e.call(this,n?i:_inheritDefaults(i))||this;var o=s.vars,a=o.duration,u=o.delay,f=o.immediateRender,l=o.stagger,h=o.overwrite,_=o.keyframes,c=o.defaults,d=o.scrollTrigger,m=i.parent||_globalTimeline,p=(_isArray(t)||_isTypedArray(t)?_isNumber(t[0]):"length"in i)?[t]:toArray(t),g,v,C,y,w,P,T,S;s._targets=p.length?_harness(p):_warn("GSAP target "+t+" not found. https://gsap.com",!_config.nullTargetWarn)||[];s._ptLookup=[];//PropTween lookup. An array containing an object for each target, having keys for each tweening property
|
|
368
368
|
s._overwrite=h;if(_||l||_isFuncOrString(a)||_isFuncOrString(u)){i=s.vars;var x=i.easeReverse||i.yoyoEase;g=s.timeline=new Timeline({data:"nested",defaults:c||{},targets:m&&m.data==="nested"?m.vars.targets:p});// we need to store the targets because for staggers and keyframes, we end up creating an individual tween for each but function-based values need to know the index and the whole Array of targets.
|
|
369
369
|
g.kill();g.parent=g._dp=_assertThisInitialized(s);g._start=0;if(l||_isFuncOrString(a)||_isFuncOrString(u)){y=p.length;T=l&&distribute(l);if(_isObject(l)){
|
|
370
370
|
//users can pass in callbacks like onStart/onComplete in the stagger object. These should fire with each individual tween.
|
|
@@ -375,38 +375,38 @@ s._delay=u=C.delay;s._start+=u;C.delay=0}g.to(P,C,T?T(v,P,p):0);g._ease=_easeMap
|
|
|
375
375
|
}else if(_){_inheritDefaults(_setDefaults(g.vars.defaults,{ease:"none"}));g._ease=_parseEase(_.ease||i.ease||"none");var b=0,M,k,F;if(_isArray(_)){_.forEach((function(e){return g.to(p,e,">")}));g.duration();// to ensure tl._dur is cached because we tap into it for performance purposes in the render() method.
|
|
376
376
|
}else{C={};for(w in _){w==="ease"||w==="easeEach"||_parseKeyframe(w,_[w],C,_.easeEach)}for(w in C){M=C[w].sort((function(e,t){return e.t-t.t}));b=0;for(v=0;v<M.length;v++){k=M[v];F={ease:k.e,duration:(k.t-(v?M[v-1].t:0))/100*a};F[w]=k.v;g.to(p,F,b);b+=F.duration}}g.duration()<a&&g.to({},{duration:a-g.duration()});// in case keyframes didn't go to 100%
|
|
377
377
|
}}a||s.duration(a=g.duration())}else{s.timeline=0;//speed optimization, faster lookups (no going up the prototype chain)
|
|
378
|
-
}if(h===true&&!_suppressOverwrites){_overwritingTween=_assertThisInitialized(s);_globalTimeline.killTweensOf(p);_overwritingTween=0}_addToTimeline(m,_assertThisInitialized(s),
|
|
378
|
+
}if(h===true&&!_suppressOverwrites){_overwritingTween=_assertThisInitialized(s);_globalTimeline.killTweensOf(p);_overwritingTween=0}_addToTimeline(m,_assertThisInitialized(s),r);i.reversed&&s.reverse();i.paused&&s.paused(true);if(f||!a&&!_&&s._start===_roundPrecise(m._time)&&_isNotFalse(f)&&_hasNoPausedAncestors(_assertThisInitialized(s))&&m.data!=="nested"){s._tTime=-_tinyNum;//forces a render without having to set the render() "force" parameter to true because we want to allow lazying by default (using the "force" parameter always forces an immediate full render)
|
|
379
379
|
s.render(Math.max(0,-u)||0);//in case delay is negative
|
|
380
|
-
}d&&_scrollTrigger(_assertThisInitialized(s),d);return s}var i=t.prototype;i.render=function e(t,i,
|
|
380
|
+
}d&&_scrollTrigger(_assertThisInitialized(s),d);return s}var i=t.prototype;i.render=function e(t,i,r){var n=this._time,s=this._tDur,o=this._dur,a=t<0,u=t>s-_tinyNum&&!a?s:t<_tinyNum?0:t,f,l,h,_,c,d,m,p;if(!o){_renderZeroDurationTween(this,t,i,r)}else if(u!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==a||this._lazy){
|
|
381
381
|
// this senses if we're crossing over the start time, in which case we must record _zTime and force the render, but we do it in this lengthy conditional way for performance reasons (usually we can skip the calculations): this._initted && (this._zTime < 0) !== (totalTime < 0)
|
|
382
382
|
f=u;p=this.timeline;if(this._repeat){
|
|
383
383
|
//adjust the time for repeats and yoyos
|
|
384
|
-
_=o+this._rDelay;if(this._repeat<-1&&a){return this.totalTime(_*100+t,i,
|
|
384
|
+
_=o+this._rDelay;if(this._repeat<-1&&a){return this.totalTime(_*100+t,i,r)}f=_roundPrecise(u%_);//round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)
|
|
385
385
|
if(u===s){
|
|
386
386
|
// the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)
|
|
387
387
|
h=this._repeat;f=o}else{c=_roundPrecise(u/_);// full decimal version of iterations, not the previous iteration (we're reusing prevIteration variable for efficiency)
|
|
388
|
-
h=~~c;if(h&&h===c){f=o;h--}else if(f>o){f=o}}d=this._yoyo&&h&1;if(d)f=o-f;c=_animationCycle(this._tTime,_);if(f===r
|
|
388
|
+
h=~~c;if(h&&h===c){f=o;h--}else if(f>o){f=o}}d=this._yoyo&&h&1;if(d)f=o-f;c=_animationCycle(this._tTime,_);if(f===n&&!r&&this._initted&&h===c){
|
|
389
389
|
//could be during the repeatDelay part. No need to render and fire callbacks.
|
|
390
390
|
this._tTime=u;return this}if(h!==c){
|
|
391
391
|
//repeatRefresh functionality
|
|
392
392
|
if(this.vars.repeatRefresh&&!d&&!this._lock&&f!==_&&this._initted){
|
|
393
393
|
// this._time will === cycleDuration when we render at EXACTLY the end of an iteration. Without this condition, it'd often do the repeatRefresh render TWICE (again on the very next tick).
|
|
394
|
-
this._lock=
|
|
395
|
-
this.render(_roundPrecise(_*h),true).invalidate()._lock=0}}}if(!this._initted){if(_attemptInitTween(this,a?t:f,
|
|
396
|
-
return this}if(
|
|
394
|
+
this._lock=r=1;//force, otherwise if lazy is true, the _attemptInitTween() will return and we'll jump out and get caught bouncing on each tick.
|
|
395
|
+
this.render(_roundPrecise(_*h),true).invalidate()._lock=0}}}if(!this._initted){if(_attemptInitTween(this,a?t:f,r,i,u)){this._tTime=0;// in constructor if immediateRender is true, we set _tTime to -_tinyNum to have the playhead cross the starting point but we can't leave _tTime as a negative number.
|
|
396
|
+
return this}if(n!==this._time&&!(r&&this.vars.repeatRefresh&&h!==c)){
|
|
397
397
|
// rare edge case - during initialization, an onUpdate in the _startAt (.fromTo()) might force this tween to render at a different spot in which case we should ditch this render() call so that it doesn't revert the values. But we also don't want to dump if we're doing a repeatRefresh render!
|
|
398
398
|
return this}if(o!==this._dur){
|
|
399
399
|
// while initting, a plugin like InertiaPlugin might alter the duration, so rerun from the start to ensure everything renders as it should.
|
|
400
|
-
return this.render(t,i,
|
|
401
|
-
this._lazy=0}if(!
|
|
400
|
+
return this.render(t,i,r)}}if(this._rEase){var g=f<n;if(g!==this._inv){var v=g?n:o-n;this._inv=g;if(this._from)this.ratio=1-this.ratio;this._invRatio=this.ratio;this._invTime=n;this._invRecip=v?(g?-1:1)/v:0;this._invScale=g?-this.ratio:1-this.ratio;this._invEase=g?this._rEase:this._ease}this.ratio=m=this._invRatio+this._invScale*this._invEase((f-this._invTime)*this._invRecip)}else{this.ratio=m=this._ease(f/o)}if(this._from)this.ratio=m=1-m;this._tTime=u;this._time=f;if(!this._act&&this._ts){this._act=1;//as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.
|
|
401
|
+
this._lazy=0}if(!n&&u&&!i&&!c){_callback(this,"onStart");if(this._tTime!==u){
|
|
402
402
|
// in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.
|
|
403
|
-
return this}}l=this._pt;while(l){l.r(m,l.d);l=l._next}p&&p.render(t<0?t:p._dur*p._ease(f/this._dur),i,
|
|
403
|
+
return this}}l=this._pt;while(l){l.r(m,l.d);l=l._next}p&&p.render(t<0?t:p._dur*p._ease(f/this._dur),i,r)||this._startAt&&(this._zTime=t);if(this._onUpdate&&!i){a&&_rewindStartAt(this,t,i,r);//note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.
|
|
404
404
|
_callback(this,"onUpdate")}this._repeat&&h!==c&&this.vars.onRepeat&&!i&&this.parent&&_callback(this,"onRepeat");if((u===this._tDur||!u)&&this._tTime===u){a&&!this._onUpdate&&_rewindStartAt(this,t,true,true);(t||!o)&&(u===this._tDur&&this._ts>0||!u&&this._ts<0)&&_removeFromParent(this,1);// don't remove if we're rendering at exactly a time of 0, as there could be autoRevert values that should get set on the next tick (if the playhead goes backward beyond the startTime, negative totalTime). Don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.
|
|
405
|
-
if(!i&&!(a&&!
|
|
405
|
+
if(!i&&!(a&&!n)&&(u||n||d)){
|
|
406
406
|
// if prevTime and tTime are zero, we shouldn't fire the onReverseComplete. This could happen if you gsap.to(... {paused:true}).play();
|
|
407
407
|
_callback(this,u===s?"onComplete":"onReverseComplete",true);this._prom&&!(u<s&&this.timeScale()>0)&&this._prom()}}}return this};i.targets=function e(){return this._targets};i.invalidate=function t(i){
|
|
408
408
|
// "soft" gives us a way to clear out everything EXCEPT the recorded pre-"from" portion of from() tweens. Otherwise, for example, if you tween.progress(1).render(0, true true).invalidate(), the "from" values would persist and then on the next render, the from() tweens would initialize and the current value would match the "from" values, thus animate from the same value to the same value (no animation). We tap into this in ScrollTrigger's refresh() where we must push a tween to completion and then back again but honor its init state in case the tween is dependent on another tween further up on the page.
|
|
409
|
-
(!i||!this.vars.runBackwards)&&(this._startAt=0);this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0;this._ptLookup=[];this.timeline&&this.timeline.invalidate(i);return e.prototype.invalidate.call(this,i)};i.resetTo=function e(t,i,n,
|
|
409
|
+
(!i||!this.vars.runBackwards)&&(this._startAt=0);this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0;this._ptLookup=[];this.timeline&&this.timeline.invalidate(i);return e.prototype.invalidate.call(this,i)};i.resetTo=function e(t,i,r,n,s){_tickerActive||_ticker.wake();this._ts||this.play();var o=Math.min(this._dur,(this._dp._time-this._start)*this._ts),a;this._initted||_initTween(this,o);a=this._ease(o/this._dur);// don't just get tween.ratio because it may not have rendered yet.
|
|
410
410
|
// possible future addition to allow an object with multiple values to update, like tween.resetTo({x: 100, y: 200}); At this point, it doesn't seem worth the added kb given the fact that most users will likely opt for the convenient gsap.quickTo() way of interacting with this method.
|
|
411
411
|
// if (_isObject(property)) { // performance optimization
|
|
412
412
|
// for (p in property) {
|
|
@@ -415,15 +415,15 @@ _callback(this,u===s?"onComplete":"onReverseComplete",true);this._prom&&!(u<s&&t
|
|
|
415
415
|
// }
|
|
416
416
|
// }
|
|
417
417
|
// } else {
|
|
418
|
-
if(_updatePropTweens(this,t,i,n,
|
|
418
|
+
if(_updatePropTweens(this,t,i,r,n,a,o,s)){return this.resetTo(t,i,r,n,1);// if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.
|
|
419
419
|
}//}
|
|
420
|
-
_alignPlayhead(this,0);this.parent||_addLinkedListItem(this._dp,this,"_first","_last",this._dp._sort?"_start":0);return this.render(0)};i.kill=function e(t,i){if(i===void 0){i="all"}if(!t&&(!i||i==="all")){this._lazy=this._pt=0;this.parent?_interrupt(this):this.scrollTrigger&&this.scrollTrigger.kill(!!_reverting$1);return this}if(this.timeline){var
|
|
421
|
-
this.parent&&
|
|
422
|
-
return this}var
|
|
420
|
+
_alignPlayhead(this,0);this.parent||_addLinkedListItem(this._dp,this,"_first","_last",this._dp._sort?"_start":0);return this.render(0)};i.kill=function e(t,i){if(i===void 0){i="all"}if(!t&&(!i||i==="all")){this._lazy=this._pt=0;this.parent?_interrupt(this):this.scrollTrigger&&this.scrollTrigger.kill(!!_reverting$1);return this}if(this.timeline){var r=this.timeline.totalDuration();this.timeline.killTweensOf(t,i,_overwritingTween&&_overwritingTween.vars.overwrite!==true)._first||_interrupt(this);// if nothing is left tweening, interrupt.
|
|
421
|
+
this.parent&&r!==this.timeline.totalDuration()&&_setDuration(this,this._dur*this.timeline._tDur/r,0,1);// if a nested tween is killed that changes the duration, it should affect this tween's duration. We must use the ratio, though, because sometimes the internal timeline is stretched like for keyframes where they don't all add up to whatever the parent tween's duration was set to.
|
|
422
|
+
return this}var n=this._targets,s=t?toArray(t):n,o=this._ptLookup,a=this._pt,u,f,l,h,_,c,d;if((!i||i==="all")&&_arraysMatch(n,s)){i==="all"&&(this._pt=0);return _interrupt(this)}u=this._op=this._op||[];if(i!=="all"){
|
|
423
423
|
//so people can pass in a comma-delimited list of property names
|
|
424
|
-
if(_isString(i)){_={};_forEachName(i,(function(e){return _[e]=1}));i=_}i=_addAliasesToVars(
|
|
425
|
-
return this};t.to=function e(i,
|
|
426
|
-
};t.fromTo=function e(t,i,
|
|
424
|
+
if(_isString(i)){_={};_forEachName(i,(function(e){return _[e]=1}));i=_}i=_addAliasesToVars(n,i)}d=n.length;while(d--){if(~s.indexOf(n[d])){f=o[d];if(i==="all"){u[d]=i;h=f;l={}}else{l=u[d]=u[d]||{};h=i}for(_ in h){c=f&&f[_];if(c){if(!("kill"in c.d)||c.d.kill(_)===true){_removeLinkedListItem(this,c,"_pt")}delete f[_]}if(l!=="all"){l[_]=1}}}}this._initted&&!this._pt&&a&&_interrupt(this);//if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening.
|
|
425
|
+
return this};t.to=function e(i,r){return new t(i,r,arguments[2])};t.from=function e(t,i){return _createTweenType(1,arguments)};t.delayedCall=function e(i,r,n,s){return new t(r,0,{immediateRender:false,lazy:false,overwrite:false,delay:i,onComplete:r,onReverseComplete:r,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:s});// we must use onReverseComplete too for things like timeline.add(() => {...}) which should be triggered in BOTH directions (forward and reverse)
|
|
426
|
+
};t.fromTo=function e(t,i,r){return _createTweenType(2,arguments)};t.set=function e(i,r){r.duration=0;r.repeatDelay||(r.repeat=0);return new t(i,r)};t.killTweensOf=function e(t,i,r){return _globalTimeline.killTweensOf(t,i,r)};return t}(Animation);_setDefaults(Tween.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});//add the pertinent timeline methods to Tween instances so that users can chain conveniently and create a timeline automatically. (removed due to concerns that it'd ultimately add to more confusion especially for beginners)
|
|
427
427
|
// _forEachName("to,from,fromTo,set,call,add,addLabel,addPause", name => {
|
|
428
428
|
// Tween.prototype[name] = function() {
|
|
429
429
|
// let tl = new Timeline();
|
|
@@ -436,57 +436,57 @@ _forEachName("staggerTo,staggerFrom,staggerFromTo",(function(e){Tween[e]=functio
|
|
|
436
436
|
* --------------------------------------------------------------------------------------
|
|
437
437
|
* PROPTWEEN
|
|
438
438
|
* --------------------------------------------------------------------------------------
|
|
439
|
-
*/var _setterPlain=function e(t,i,
|
|
439
|
+
*/var _setterPlain=function e(t,i,r){return t[i]=r},_setterFunc=function e(t,i,r){return t[i](r)},_setterFuncWithParam=function e(t,i,r,n){return t[i](n.fp,r)},_setterAttribute=function e(t,i,r){return t.setAttribute(i,r)},_getSetter=function e(t,i){return _isFunction(t[i])?_setterFunc:_isUndefined(t[i])&&t.setAttribute?_setterAttribute:_setterPlain},_renderPlain=function e(t,i){return i.set(i.t,i.p,Math.round((i.s+i.c*t)*1e6)/1e6,i)},_renderBoolean=function e(t,i){return i.set(i.t,i.p,!!(i.s+i.c*t),i)},_renderComplexString=function e(t,i){var r=i._pt,n="";if(!t&&i.b){
|
|
440
440
|
//b = beginning string
|
|
441
|
-
|
|
441
|
+
n=i.b}else if(t===1&&i.e){
|
|
442
442
|
//e = ending string
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}i.set(i.t,i.p,
|
|
446
|
-
while(i){
|
|
447
|
-
var PropTween=function(){function e(e,t,i,n,
|
|
448
|
-
this.set=_setterWithModifier;this.m=t;this.mt=
|
|
443
|
+
n=i.e}else{while(r){n=r.p+(r.m?r.m(r.s+r.c*t):Math.round((r.s+r.c*t)*1e4)/1e4)+n;//we use the "p" property for the text inbetween (like a suffix). And in the context of a complex string, the modifier (m) is typically just Math.round(), like for RGB colors.
|
|
444
|
+
r=r._next}n+=i.c;//we use the "c" of the PropTween to store the final chunk of non-numeric text.
|
|
445
|
+
}i.set(i.t,i.p,n,i)},_renderPropTweens=function e(t,i){var r=i._pt;while(r){r.r(t,r.d);r=r._next}},_addPluginModifier=function e(t,i,r,n){var s=this._pt,o;while(s){o=s._next;s.p===n&&s.modifier(t,i,r);s=o}},_killPropTweensOf=function e(t){var i=this._pt,r,n;while(i){n=i._next;if(i.p===t&&!i.op||i.op===t){_removeLinkedListItem(this,i,"_pt")}else if(!i.dep){r=1}i=n}return!r},_setterWithModifier=function e(t,i,r,n){n.mSet(t,i,n.m.call(n.tween,r,n.mt),n)},_sortPropTweensByPriority=function e(t){var i=t._pt,r,n,s,o;//sorts the PropTween linked list in order of priority because some plugins need to do their work after ALL of the PropTweens were created (like RoundPropsPlugin and ModifiersPlugin)
|
|
446
|
+
while(i){r=i._next;n=s;while(n&&n.pr>i.pr){n=n._next}if(i._prev=n?n._prev:o){i._prev._next=i}else{s=i}if(i._next=n){n._prev=i}else{o=i}i=r}t._pt=s};//PropTween key: t = target, p = prop, r = renderer, d = data, s = start, c = change, op = overwriteProperty (ONLY populated when it's different than p), pr = priority, _next/_prev for the linked list siblings, set = setter, m = modifier, mSet = modifierSetter (the original setter, before a modifier was added)
|
|
447
|
+
var PropTween=function(){function e(e,t,i,r,n,s,o,a,u){this.t=t;this.s=r;this.c=n;this.p=i;this.r=s||_renderPlain;this.d=o||this;this.set=a||_setterPlain;this.pr=u||0;this._next=e;if(e){e._prev=this}}var t=e.prototype;t.modifier=function e(t,i,r){this.mSet=this.mSet||this.set;//in case it was already set (a PropTween can only have one modifier)
|
|
448
|
+
this.set=_setterWithModifier;this.m=t;this.mt=r;//modifier target
|
|
449
449
|
this.tween=i};return e}();//Initialization tasks
|
|
450
|
-
_forEachName(_callbackNames+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",(function(e){return _reservedProps[e]=1}));_globals.TweenMax=_globals.TweenLite=Tween;_globals.TimelineLite=_globals.TimelineMax=Timeline;_globalTimeline=new Timeline({sortChildren:false,defaults:_defaults,autoRemoveChildren:true,id:"root",smoothChildTiming:true});_config.stringFilter=_colorStringFilter;var _media=[],_listeners={},_emptyArray=[],_lastMediaTime=0,_contextID=0,_dispatch=function e(t){return(_listeners[t]||_emptyArray).map((function(e){return e()}))},_onMediaChange=function e(){var t=Date.now(),i=[];if(t-_lastMediaTime>2){_dispatch("matchMediaInit");_media.forEach((function(e){var t=e.queries,
|
|
451
|
-
|
|
450
|
+
_forEachName(_callbackNames+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",(function(e){return _reservedProps[e]=1}));_globals.TweenMax=_globals.TweenLite=Tween;_globals.TimelineLite=_globals.TimelineMax=Timeline;_globalTimeline=new Timeline({sortChildren:false,defaults:_defaults,autoRemoveChildren:true,id:"root",smoothChildTiming:true});_config.stringFilter=_colorStringFilter;var _media=[],_listeners={},_emptyArray=[],_lastMediaTime=0,_contextID=0,_dispatch=function e(t){return(_listeners[t]||_emptyArray).map((function(e){return e()}))},_onMediaChange=function e(){var t=Date.now(),i=[];if(t-_lastMediaTime>2){_dispatch("matchMediaInit");_media.forEach((function(e){var t=e.queries,r=e.conditions,n,s,o,a;for(s in t){n=_win$1.matchMedia(t[s]).matches;// Firefox doesn't update the "matches" property of the MediaQueryList object correctly - it only does so as it calls its change handler - so we must re-create a media query here to ensure it's accurate.
|
|
451
|
+
n&&(o=1);if(n!==r[s]){r[s]=n;a=1}}if(a){e.revert();o&&i.push(e)}}));_dispatch("matchMediaRevert");i.forEach((function(e){return e.onMatch(e,(function(t){return e.add(null,t)}))}));_lastMediaTime=t;_dispatch("matchMedia")}};var Context=function(){function e(e,t){this.selector=t&&selector(t);this.data=[];this._r=[];// returned/cleanup functions
|
|
452
452
|
this.isReverted=false;this.id=_contextID++;// to work around issues that frameworks like Vue cause by making things into Proxies which make it impossible to do something like _media.indexOf(this) because "this" would no longer refer to the Context instance itself - it'd refer to a Proxy! We needed a way to identify the context uniquely
|
|
453
|
-
e&&this.add(e)}var t=e.prototype;t.add=function e(t,i,
|
|
453
|
+
e&&this.add(e)}var t=e.prototype;t.add=function e(t,i,r){
|
|
454
454
|
// possible future addition if we need the ability to add() an animation to a context and for whatever reason cannot create that animation inside of a context.add(() => {...}) function.
|
|
455
455
|
// if (name && _isFunction(name.revert)) {
|
|
456
456
|
// this.data.push(name);
|
|
457
457
|
// return (name._ctx = this);
|
|
458
458
|
// }
|
|
459
|
-
if(_isFunction(t)){
|
|
459
|
+
if(_isFunction(t)){r=i;i=t;t=_isFunction}var n=this,s=function e(){var t=_context,s=n.selector,o;t&&t!==n&&t.data.push(n);r&&(n.selector=selector(r));_context=n;o=i.apply(n,arguments);_isFunction(o)&&n._r.push(o);_context=t;n.selector=s;n.isReverted=false;return o};n.last=s;return t===_isFunction?s(n,(function(e){return n.add(null,e)})):t?n[t]=s:s};t.ignore=function e(t){var i=_context;_context=null;t(this);_context=i};t.getTweens=function t(){var i=[];this.data.forEach((function(t){return t instanceof e?i.push.apply(i,t.getTweens()):t instanceof Tween&&!(t.parent&&t.parent.data==="nested")&&i.push(t)}));return i};t.clear=function e(){this._r.length=this.data.length=0};t.kill=function e(t,i){var r=this;if(t){(function(){var e=r.getTweens(),i=r.data.length,n;while(i--){
|
|
460
460
|
// Flip plugin tweens are very different in that they should actually be pushed to their end. The plugin replaces the timeline's .revert() method to do exactly that. But we also need to remove any of those nested tweens inside the flip timeline so that they don't get individually reverted.
|
|
461
|
-
r
|
|
461
|
+
n=r.data[i];if(n.data==="isFlip"){n.revert();n.getChildren(true,true,false).forEach((function(t){return e.splice(e.indexOf(t),1)}))}}// save as an object so that we can cache the globalTime for each tween to optimize performance during the sort
|
|
462
462
|
e.map((function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-Infinity,t:e}})).sort((function(e,t){return t.g-e.g||-Infinity})).forEach((function(e){return e.t.revert(t)}));// note: all of the _startAt tweens should be reverted in reverse order that they were created, and they'll all have the same globalTime (-1) so the " || -1" in the sort keeps the order properly.
|
|
463
|
-
i=
|
|
463
|
+
i=r.data.length;while(i--){
|
|
464
464
|
// make sure we loop backwards so that, for example, SplitTexts that were created later on the same element get reverted first
|
|
465
|
-
r
|
|
466
|
-
}}else{!(
|
|
465
|
+
n=r.data[i];if(n instanceof Timeline){if(n.data!=="nested"){n.scrollTrigger&&n.scrollTrigger.revert();n.kill();// don't revert() the timeline because that's duplicating efforts since we already reverted all the tweens
|
|
466
|
+
}}else{!(n instanceof Tween)&&n.revert&&n.revert(t)}}r._r.forEach((function(e){return e(t,r)}));r.isReverted=true})()}else{this.data.forEach((function(e){return e.kill&&e.kill()}))}this.clear();if(i){var n=_media.length;while(n--){
|
|
467
467
|
// previously, we checked _media.indexOf(this), but some frameworks like Vue enforce Proxy objects that make it impossible to get the proper result that way, so we must use a unique ID number instead.
|
|
468
|
-
_media[
|
|
469
|
-
t.revert=function e(t){this.kill(t||{})};return e}();var MatchMedia=function(){function e(e){this.contexts=[];this.scope=e;_context&&_context.data.push(this)}var t=e.prototype;t.add=function e(t,i,
|
|
470
|
-
this.contexts.push(
|
|
468
|
+
_media[n].id===this.id&&_media.splice(n,1)}}}// killWithCleanup() {;
|
|
469
|
+
t.revert=function e(t){this.kill(t||{})};return e}();var MatchMedia=function(){function e(e){this.contexts=[];this.scope=e;_context&&_context.data.push(this)}var t=e.prototype;t.add=function e(t,i,r){_isObject(t)||(t={matches:t});var n=new Context(0,r||this.scope),s=n.conditions={},o,a,u;_context&&!n.selector&&(n.selector=_context.selector);// in case a context is created inside a context. Like a gsap.matchMedia() that's inside a scoped gsap.context()
|
|
470
|
+
this.contexts.push(n);i=n.add("onMatch",i);n.queries=t;for(a in t){if(a==="all"){u=1}else{o=_win$1.matchMedia(t[a]);if(o){_media.indexOf(n)<0&&_media.push(n);(s[a]=o.matches)&&(u=1);o.addListener?o.addListener(_onMediaChange):o.addEventListener("change",_onMediaChange)}}}u&&i(n,(function(e){return n.add(null,e)}));return this}// refresh() {;
|
|
471
471
|
t.revert=function e(t){this.kill(t||{})};t.kill=function e(t){this.contexts.forEach((function(e){return e.kill(t,true)}))};return e}();
|
|
472
472
|
/*
|
|
473
473
|
* --------------------------------------------------------------------------------------
|
|
474
474
|
* GSAP
|
|
475
475
|
* --------------------------------------------------------------------------------------
|
|
476
|
-
*/var _gsap={registerPlugin:function e(){for(var t=arguments.length,i=new Array(t),
|
|
477
|
-
var s=_getCache(t||{}).get,o=
|
|
476
|
+
*/var _gsap={registerPlugin:function e(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++){i[r]=arguments[r]}i.forEach((function(e){return _createPlugin(e)}))},timeline:function e(t){return new Timeline(t)},getTweensOf:function e(t,i){return _globalTimeline.getTweensOf(t,i)},getProperty:function e(t,i,r,n){_isString(t)&&(t=toArray(t)[0]);//in case selector text or an array is passed in
|
|
477
|
+
var s=_getCache(t||{}).get,o=r?_passThrough:_numericIfPossible;r==="native"&&(r="");return!t?t:!i?function(e,i,r){return o((_plugins[e]&&_plugins[e].get||s)(t,e,i,r))}:o((_plugins[i]&&_plugins[i].get||s)(t,i,r,n))},quickSetter:function e(t,i,r){t=toArray(t);if(t.length>1){var n=t.map((function(e){return gsap.quickSetter(e,i,r)})),s=n.length;return function(e){var t=s;while(t--){n[t](e)}}}t=t[0]||{};var o=_plugins[i],a=_getCache(t),u=a.harness&&(a.harness.aliases||{})[i]||i,
|
|
478
478
|
// in case it's an alias, like "rotate" for "rotation".
|
|
479
|
-
f=o?function(e){var i=new o;_quickTween._pt=0;i.init(t,
|
|
480
|
-
|
|
481
|
-
var _getPluginPropTween=function e(t,i){var
|
|
479
|
+
f=o?function(e){var i=new o;_quickTween._pt=0;i.init(t,r?e+r:e,_quickTween,0,[t]);i.render(1,i);_quickTween._pt&&_renderPropTweens(1,_quickTween)}:a.set(t,u);return o?f:function(e){return f(t,u,r?e+r:e,a,1)}},quickTo:function e(t,i,r){var n;var s=gsap.to(t,_setDefaults((n={},n[i]="+=0.1",n.paused=true,n.stagger=0,n),r||{})),o=function e(t,r,n){return s.resetTo(i,t,r,n)};o.tween=s;return o},isTweening:function e(t){return _globalTimeline.getTweensOf(t,true).length>0},defaults:function e(t){t&&t.ease&&(t.ease=_parseEase(t.ease,_defaults.ease));return _mergeDeep(_defaults,t||{})},config:function e(t){return _mergeDeep(_config,t||{})},registerEffect:function e(t){var i=t.name,r=t.effect,n=t.plugins,s=t.defaults,o=t.extendTimeline;(n||"").split(",").forEach((function(e){return e&&!_plugins[e]&&!_globals[e]&&_warn(i+" effect requires "+e+" plugin.")}));_effects[i]=function(e,t,i){return r(toArray(e),_setDefaults(t||{},s),i)};if(o){Timeline.prototype[i]=function(e,t,r){return this.add(_effects[i](e,_isObject(t)?t:(r=t)&&{},this),r)}}},registerEase:function e(t,i){_easeMap[t]=_parseEase(i)},parseEase:function e(t,i){return arguments.length?_parseEase(t,i):_easeMap},getById:function e(t){return _globalTimeline.getById(t)},exportRoot:function e(t,i){if(t===void 0){t={}}var r=new Timeline(t),n,s;r.smoothChildTiming=_isNotFalse(t.smoothChildTiming);_globalTimeline.remove(r);r._dp=0;//otherwise it'll get re-activated when adding children and be re-introduced into _globalTimeline's linked list (then added to itself).
|
|
480
|
+
r._time=r._tTime=_globalTimeline._time;n=_globalTimeline._first;while(n){s=n._next;if(i||!(!n._dur&&n instanceof Tween&&n.vars.onComplete===n._targets[0])){_addToTimeline(r,n,n._start-n._delay)}n=s}_addToTimeline(_globalTimeline,r,0);return r},context:function e(t,i){return t?new Context(t,i):_context},matchMedia:function e(t){return new MatchMedia(t)},matchMediaRefresh:function e(){return _media.forEach((function(e){var t=e.conditions,i,r;for(r in t){if(t[r]){t[r]=false;i=1}}i&&e.revert()}))||_onMediaChange()},addEventListener:function e(t,i){var r=_listeners[t]||(_listeners[t]=[]);~r.indexOf(i)||r.push(i)},removeEventListener:function e(t,i){var r=_listeners[t],n=r&&r.indexOf(i);n>=0&&r.splice(n,1)},utils:{wrap:wrap,wrapYoyo:wrapYoyo,distribute:distribute,random:random,snap:snap,normalize:normalize,getUnit:getUnit,clamp:clamp,splitColor:splitColor,toArray:toArray,selector:selector,mapRange:mapRange,pipe:pipe,unitize:unitize,interpolate:interpolate,shuffle:shuffle},install:_install,effects:_effects,ticker:_ticker,updateRoot:Timeline.updateRoot,plugins:_plugins,globalTimeline:_globalTimeline,core:{PropTween:PropTween,globals:_addGlobal,Tween:Tween,Timeline:Timeline,Animation:Animation,getCache:_getCache,_removeLinkedListItem:_removeLinkedListItem,reverting:function e(){return _reverting$1},context:function e(t){if(t&&_context){_context.data.push(t);t._ctx=_context}return _context},suppressOverwrites:function e(t){return _suppressOverwrites=t}}};_forEachName("to,from,fromTo,delayedCall,set,killTweensOf",(function(e){return _gsap[e]=Tween[e]}));_ticker.add(Timeline.updateRoot);_quickTween=_gsap.to({},{duration:0});// ---- EXTRA PLUGINS --------------------------------------------------------
|
|
481
|
+
var _getPluginPropTween=function e(t,i){var r=t._pt;while(r&&r.p!==i&&r.op!==i&&r.fp!==i){r=r._next}return r},_addModifiers=function e(t,i){var r=t._targets,n,s,o;for(n in i){s=r.length;while(s--){o=t._ptLookup[s][n];if(o&&(o=o.d)){if(o._pt){
|
|
482
482
|
// is a plugin
|
|
483
|
-
o=_getPluginPropTween(o,
|
|
483
|
+
o=_getPluginPropTween(o,n)}o&&o.modifier&&o.modifier(i[n],t,r[s],n)}}}},_buildModifierPlugin=function e(t,i){return{name:t,headless:1,rawVars:1,
|
|
484
484
|
//don't pre-process function-based values or "random()" strings.
|
|
485
|
-
init:function e(t,n
|
|
486
|
-
|
|
487
|
-
var gsap=_gsap.registerPlugin({name:"attr",init:function e(t,i,n,
|
|
488
|
-
this._props.push(o)}},render:function e(t,i){var
|
|
489
|
-
|
|
485
|
+
init:function e(t,r,n){n._onInit=function(e){var t,n;if(_isString(r)){t={};_forEachName(r,(function(e){return t[e]=1}));//if the user passes in a comma-delimited list of property names to roundProps, like "x,y", we round to whole numbers.
|
|
486
|
+
r=t}if(i){t={};for(n in r){t[n]=i(r[n])}r=t}_addModifiers(e,r)}}}};//register core plugins
|
|
487
|
+
var gsap=_gsap.registerPlugin({name:"attr",init:function e(t,i,r,n,s){var o,a,u;this.tween=r;for(o in i){u=t.getAttribute(o)||"";a=this.add(t,"setAttribute",(u||0)+"",i[o],n,s,0,0,o);a.op=o;a.b=u;// record the beginning value so we can revert()
|
|
488
|
+
this._props.push(o)}},render:function e(t,i){var r=i._pt;while(r){_reverting$1?r.set(r.t,r.p,r.b,r):r.r(t,r.d);// if reverting, go back to the original (pt.b)
|
|
489
|
+
r=r._next}}},{name:"endArray",headless:1,init:function e(t,i){var r=i.length;while(r--){this.add(t,r,t[r]||0,i[r],0,0,0,0,0,1)}}},_buildModifierPlugin("roundProps",_roundModifier),_buildModifierPlugin("modifiers"),_buildModifierPlugin("snap",snap))||_gsap;//to prevent the core plugins from being dropped via aggressive tree shaking, we must include them in the variable declaration in this way.
|
|
490
490
|
Tween.version=Timeline.version=gsap.version="3.15.0";_coreReady=1;_windowExists$1()&&_wake();
|
|
491
491
|
/*!
|
|
492
492
|
* CSSPlugin 3.15.0
|
|
@@ -499,60 +499,60 @@ Tween.version=Timeline.version=gsap.version="3.15.0";_coreReady=1;_windowExists$
|
|
|
499
499
|
//if units change, we need a way to render the original unit/value when the tween goes all the way back to the beginning (ratio:0)
|
|
500
500
|
_renderCSSPropWithBeginningAndEnd=function e(t,i){return i.set(i.t,i.p,t===1?i.e:t?Math.round((i.s+i.c*t)*1e4)/1e4+i.u:i.b,i)},
|
|
501
501
|
//if units change, we need a way to render the original unit/value when the tween goes all the way back to the beginning (ratio:0)
|
|
502
|
-
_renderRoundedCSSProp=function e(t,i){var
|
|
503
|
-
t===_transformOriginProp&&(this.tfm.zOrigin=o.zOrigin)}else{return _propertyAliases.transform.split(",").forEach((function(t){return e.call(
|
|
502
|
+
_renderRoundedCSSProp=function e(t,i){var r=i.s+i.c*t;i.set(i.t,i.p,~~(r+(r<0?-.5:.5))+i.u,i)},_renderNonTweeningValue=function e(t,i){return i.set(i.t,i.p,t?i.e:i.b,i)},_renderNonTweeningValueOnlyAtEnd=function e(t,i){return i.set(i.t,i.p,t!==1?i.b:i.e,i)},_setterCSSStyle=function e(t,i,r){return t.style[i]=r},_setterCSSProp=function e(t,i,r){return t.style.setProperty(i,r)},_setterTransform=function e(t,i,r){return t._gsap[i]=r},_setterScale=function e(t,i,r){return t._gsap.scaleX=t._gsap.scaleY=r},_setterScaleWithRender=function e(t,i,r,n,s){var o=t._gsap;o.scaleX=o.scaleY=r;o.renderTransform(s,o)},_setterTransformWithRender=function e(t,i,r,n,s){var o=t._gsap;o[i]=r;o.renderTransform(s,o)},_transformProp="transform",_transformOriginProp=_transformProp+"Origin",_saveStyle=function e(t,i){var r=this;var n=this.target,s=n.style,o=n._gsap;if(t in _transformProps&&s){this.tfm=this.tfm||{};if(t!=="transform"){t=_propertyAliases[t]||t;~t.indexOf(",")?t.split(",").forEach((function(e){return r.tfm[e]=_get(n,e)})):this.tfm[t]=o.x?o[t]:_get(n,t);// note: scale would map to "scaleX,scaleY", thus we loop and apply them both.
|
|
503
|
+
t===_transformOriginProp&&(this.tfm.zOrigin=o.zOrigin)}else{return _propertyAliases.transform.split(",").forEach((function(t){return e.call(r,t,i)}))}if(this.props.indexOf(_transformProp)>=0){return}if(o.svg){this.svgo=n.getAttribute("data-svg-origin");this.props.push(_transformOriginProp,i,"")}t=_transformProp}(s||i)&&this.props.push(t,i,s[t])},_removeIndependentTransforms=function e(t){if(t.translate){t.removeProperty("translate");t.removeProperty("scale");t.removeProperty("rotate")}},_revertStyle=function e(){var t=this.props,i=this.target,r=i.style,n=i._gsap,s,o;for(s=0;s<t.length;s+=3){
|
|
504
504
|
// stored like this: property, isNotCSS, value
|
|
505
|
-
if(!t[s+1]){t[s+2]?
|
|
505
|
+
if(!t[s+1]){t[s+2]?r[t[s]]=t[s+2]:r.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(_capsExp,"-$1").toLowerCase())}else if(t[s+1]===2){
|
|
506
506
|
// non-CSS value (function-based)
|
|
507
507
|
i[t[s]](t[s+2])}else{
|
|
508
508
|
// non-CSS value (not function-based)
|
|
509
|
-
i[t[s]]=t[s+2]}}if(this.tfm){for(o in this.tfm){
|
|
510
|
-
|
|
511
|
-
}}},_getStyleSaver=function e(t,i){var
|
|
512
|
-
i&&t.style&&t.nodeType&&i.split(",").forEach((function(e){return
|
|
513
|
-
return
|
|
514
|
-
return
|
|
515
|
-
},_getComputedProperty=function e(t,i,
|
|
516
|
-
},_prefixes="O,Moz,ms,Ms,Webkit".split(","),_checkPropPrefix=function e(t,i,
|
|
509
|
+
i[t[s]]=t[s+2]}}if(this.tfm){for(o in this.tfm){n[o]=this.tfm[o]}if(n.svg){n.renderTransform();i.setAttribute("data-svg-origin",this.svgo||"")}s=_reverting();if((!s||!s.isStart)&&!r[_transformProp]){_removeIndependentTransforms(r);if(n.zOrigin&&r[_transformOriginProp]){r[_transformOriginProp]+=" "+n.zOrigin+"px";// since we're uncaching, we must put the zOrigin back into the transformOrigin so that we can pull it out accurately when we parse again. Otherwise, we'd lose the z portion of the origin since we extract it to protect from Safari bugs.
|
|
510
|
+
n.zOrigin=0;n.renderTransform()}n.uncache=1;// if it's a startAt that's being reverted in the _initTween() of the core, we don't need to uncache transforms. This is purely a performance optimization.
|
|
511
|
+
}}},_getStyleSaver=function e(t,i){var r={target:t,props:[],revert:_revertStyle,save:_saveStyle};t._gsap||gsap.core.getCache(t);// just make sure there's a _gsap cache defined because we read from it in _saveStyle() and it's more efficient to just check it here once.
|
|
512
|
+
i&&t.style&&t.nodeType&&i.split(",").forEach((function(e){return r.save(e)}));// make sure it's a DOM node too.
|
|
513
|
+
return r},_supports3D,_createElement=function e(t,i){var r=_doc.createElementNS?_doc.createElementNS((i||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):_doc.createElement(t);//some servers swap in https for http in the namespace which can break things, making "style" inaccessible.
|
|
514
|
+
return r&&r.style?r:_doc.createElement(t);//some environments won't allow access to the element's style when created with a namespace in which case we default to the standard createElement() to work around the issue. Also note that when GSAP is embedded directly inside an SVG file, createElement() won't allow access to the style object in Firefox (see https://gsap.com/forums/topic/20215-problem-using-tweenmax-in-standalone-self-containing-svg-file-err-cannot-set-property-csstext-of-undefined/).
|
|
515
|
+
},_getComputedProperty=function e(t,i,r){var n=getComputedStyle(t);return n[i]||n.getPropertyValue(i.replace(_capsExp,"-$1").toLowerCase())||n.getPropertyValue(i)||!r&&e(t,_checkPropPrefix(i)||i,1)||"";//css variables may not need caps swapped out for dashes and lowercase.
|
|
516
|
+
},_prefixes="O,Moz,ms,Ms,Webkit".split(","),_checkPropPrefix=function e(t,i,r){var n=i||_tempDiv,s=n.style,o=5;if(t in s&&!r){return t}t=t.charAt(0).toUpperCase()+t.substr(1);while(o--&&!(_prefixes[o]+t in s)){}return o<0?null:(o===3?"ms":o>=0?_prefixes[o]:"")+t},_initCore=function e(){if(_windowExists()&&window.document){_win=window;_doc=_win.document;_docElement=_doc.documentElement;_tempDiv=_createElement("div")||{style:{}};_createElement("div");_transformProp=_checkPropPrefix(_transformProp);_transformOriginProp=_transformProp+"Origin";_tempDiv.style.cssText="border-width:0;line-height:0;position:absolute;padding:0";//make sure to override certain properties that may contaminate measurements, in case the user has overreaching style sheets.
|
|
517
517
|
_supports3D=!!_checkPropPrefix("perspective");_reverting=gsap.core.reverting;_pluginInitted=1}},_getReparentedCloneBBox=function e(t){
|
|
518
518
|
//works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a <defs> element and/or <mask>. We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it).
|
|
519
|
-
var i=t.ownerSVGElement,
|
|
520
|
-
}catch(e){i=_getReparentedCloneBBox(t);
|
|
519
|
+
var i=t.ownerSVGElement,r=_createElement("svg",i&&i.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(true),s;n.style.display="block";r.appendChild(n);_docElement.appendChild(r);try{s=n.getBBox()}catch(e){}r.removeChild(n);_docElement.removeChild(r);return s},_getAttributeFallbacks=function e(t,i){var r=i.length;while(r--){if(t.hasAttribute(i[r])){return t.getAttribute(i[r])}}},_getBBox=function e(t){var i,r;try{i=t.getBBox();//Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a <symbol> or <defs>). https://bugzilla.mozilla.org/show_bug.cgi?id=612118
|
|
520
|
+
}catch(e){i=_getReparentedCloneBBox(t);r=1}i&&(i.width||i.height)||r||(i=_getReparentedCloneBBox(t));//some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case.
|
|
521
521
|
return i&&!i.width&&!i.x&&!i.y?{x:+_getAttributeFallbacks(t,["x","cx","x1"])||0,y:+_getAttributeFallbacks(t,["y","cy","y1"])||0,width:0,height:0}:i},_isSVG=function e(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&_getBBox(t))},
|
|
522
522
|
//reports if the element is an SVG on which getBBox() actually works
|
|
523
|
-
_removeProperty=function e(t,i){if(i){var
|
|
523
|
+
_removeProperty=function e(t,i){if(i){var r=t.style,n;if(i in _transformProps&&i!==_transformOriginProp){i=_transformProp}if(r.removeProperty){n=i.substr(0,2);if(n==="ms"||i.substr(0,6)==="webkit"){
|
|
524
524
|
//Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be "ms-transform" instead of "-ms-transform" for IE9, for example)
|
|
525
|
-
i="-"+i}
|
|
525
|
+
i="-"+i}r.removeProperty(n==="--"?i:i.replace(_capsExp,"-$1").toLowerCase())}else{
|
|
526
526
|
//note: old versions of IE use "removeAttribute()" instead of "removeProperty()"
|
|
527
|
-
|
|
527
|
+
r.removeAttribute(i)}}},_addNonTweeningPT=function e(t,i,r,n,s,o){var a=new PropTween(t._pt,i,r,0,1,o?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue);t._pt=a;a.b=n;a.e=s;t._props.push(r);return a},_nonConvertibleUnits={deg:1,rad:1,turn:1},_nonStandardLayouts={grid:1,flex:1},
|
|
528
528
|
//takes a single value like 20px and converts it to the unit specified, like "%", returning only the numeric amount.
|
|
529
|
-
_convertToUnit=function e(t,i,n
|
|
529
|
+
_convertToUnit=function e(t,i,r,n){var s=parseFloat(r)||0,o=(r+"").trim().substr((s+"").length)||"px",
|
|
530
530
|
// some browsers leave extra whitespace at the beginning of CSS variables, hence the need to trim()
|
|
531
|
-
a=_tempDiv.style,u=_horizontalExp.test(i),f=t.tagName.toLowerCase()==="svg",l=(f?"client":"offset")+(u?"Width":"Height"),h=100,_=
|
|
531
|
+
a=_tempDiv.style,u=_horizontalExp.test(i),f=t.tagName.toLowerCase()==="svg",l=(f?"client":"offset")+(u?"Width":"Height"),h=100,_=n==="px",c=n==="%",d,m,p,g;if(n===o||!s||_nonConvertibleUnits[n]||_nonConvertibleUnits[o]){return s}o!=="px"&&!_&&(s=e(t,i,r,"px"));g=t.getCTM&&_isSVG(t);if((c||o==="%")&&(_transformProps[i]||~i.indexOf("adius"))){d=g?t.getBBox()[u?"width":"height"]:t[l];return _round(c?s/d*h:s/100*d)}a[u?"width":"height"]=h+(_?o:n);m=n!=="rem"&&~i.indexOf("adius")||n==="em"&&t.appendChild&&!f?t:t.parentNode;if(g){m=(t.ownerSVGElement||{}).parentNode}if(!m||m===_doc||!m.appendChild){m=_doc.body}p=m._gsap;if(p&&c&&p.width&&u&&p.time===_ticker.time&&!p.uncache){return _round(s/p.width*h)}else{if(c&&(i==="height"||i==="width")){
|
|
532
532
|
// if we're dealing with width/height that's inside a container with padding and/or it's a flexbox/grid container, we must apply it to the target itself rather than the _tempDiv in order to ensure complete accuracy, factoring in the parent's padding.
|
|
533
|
-
var v=t.style[i];t.style[i]=h+
|
|
534
|
-
m.appendChild(_tempDiv);d=_tempDiv[l];m.removeChild(_tempDiv);a.position="absolute"}if(u&&c){p=_getCache(m);p.time=_ticker.time;p.width=m[l]}}return _round(_?d*s/h:d&&s?h/d*s:0)},_get=function e(t,i,n
|
|
535
|
-
}}return
|
|
533
|
+
var v=t.style[i];t.style[i]=h+n;d=t[l];v?t.style[i]=v:_removeProperty(t,i)}else{(c||o==="%")&&!_nonStandardLayouts[_getComputedProperty(m,"display")]&&(a.position=_getComputedProperty(t,"position"));m===t&&(a.position="static");// like for borderRadius, if it's a % we must have it relative to the target itself but that may not have position: relative or position: absolute in which case it'd go up the chain until it finds its offsetParent (bad). position: static protects against that.
|
|
534
|
+
m.appendChild(_tempDiv);d=_tempDiv[l];m.removeChild(_tempDiv);a.position="absolute"}if(u&&c){p=_getCache(m);p.time=_ticker.time;p.width=m[l]}}return _round(_?d*s/h:d&&s?h/d*s:0)},_get=function e(t,i,r,n){var s;_pluginInitted||_initCore();if(i in _propertyAliases&&i!=="transform"){i=_propertyAliases[i];if(~i.indexOf(",")){i=i.split(",")[0]}}if(_transformProps[i]&&i!=="transform"){s=_parseTransform(t,n);s=i!=="transformOrigin"?s[i]:s.svg?s.origin:_firstTwoOnly(_getComputedProperty(t,_transformOriginProp))+" "+s.zOrigin+"px"}else{s=t.style[i];if(!s||s==="auto"||n||~(s+"").indexOf("calc(")){s=_specialProps[i]&&_specialProps[i](t,i,r)||_getComputedProperty(t,i)||_getProperty(t,i)||(i==="opacity"?1:0);// note: some browsers, like Firefox, don't report borderRadius correctly! Instead, it only reports every corner like borderTopLeftRadius
|
|
535
|
+
}}return r&&!~(s+"").trim().indexOf(" ")?_convertToUnit(t,i,s,r)+r:s},_tweenComplexCSSString=function e(t,i,r,n){
|
|
536
536
|
// note: we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus "this" would refer to the plugin.
|
|
537
|
-
if(!
|
|
537
|
+
if(!r||r==="none"){
|
|
538
538
|
// some browsers like Safari actually PREFER the prefixed property and mis-report the unprefixed value like clipPath (BUG). In other words, even though clipPath exists in the style ("clipPath" in target.style) and it's set in the CSS properly (along with -webkit-clip-path), Safari reports clipPath as "none" whereas WebkitClipPath reports accurately like "ellipse(100% 0% at 50% 0%)", so in this case we must SWITCH to using the prefixed property instead. See https://gsap.com/forums/topic/18310-clippath-doesnt-work-on-ios/
|
|
539
|
-
var s=_checkPropPrefix(i,t,1),o=s&&_getComputedProperty(t,s,1);if(o&&o!==
|
|
540
|
-
}}var a=new PropTween(this._pt,t.style,i,0,1,_renderComplexString),u=0,f=0,l,h,_,c,d,m,p,g,v,C,y,w;a.b=
|
|
541
|
-
|
|
542
|
-
|
|
539
|
+
var s=_checkPropPrefix(i,t,1),o=s&&_getComputedProperty(t,s,1);if(o&&o!==r){i=s;r=o}else if(i==="borderColor"){r=_getComputedProperty(t,"borderTopColor");// Firefox bug: always reports "borderColor" as "", so we must fall back to borderTopColor. See https://gsap.com/forums/topic/24583-how-to-return-colors-that-i-had-after-reverse/
|
|
540
|
+
}}var a=new PropTween(this._pt,t.style,i,0,1,_renderComplexString),u=0,f=0,l,h,_,c,d,m,p,g,v,C,y,w;a.b=r;a.e=n;r+="";// ensure values are strings
|
|
541
|
+
n+="";if(n.substring(0,6)==="var(--"){n=_getComputedProperty(t,n.substring(4,n.indexOf(")")))}if(n==="auto"){m=t.style[i];t.style[i]=n;n=_getComputedProperty(t,i)||n;m?t.style[i]=m:_removeProperty(t,i)}l=[r,n];_colorStringFilter(l);// pass an array with the starting and ending values and let the filter do whatever it needs to the values. If colors are found, it returns true and then we must match where the color shows up order-wise because for things like boxShadow, sometimes the browser provides the computed values with the color FIRST, but the user provides it with the color LAST, so flip them if necessary. Same for drop-shadow().
|
|
542
|
+
r=l[0];n=l[1];_=r.match(_numWithUnitExp)||[];w=n.match(_numWithUnitExp)||[];if(w.length){while(h=_numWithUnitExp.exec(n)){p=h[0];v=n.substring(u,h.index);if(d){d=(d+1)%5}else if(v.substr(-5)==="rgba("||v.substr(-5)==="hsla("){d=1}if(p!==(m=_[f++]||"")){c=parseFloat(m)||0;y=m.substr((c+"").length);p.charAt(1)==="="&&(p=_parseRelative(c,p)+y);g=parseFloat(p);C=p.substr((g+"").length);u=_numWithUnitExp.lastIndex-C.length;if(!C){
|
|
543
543
|
//if something like "perspective:300" is passed in and we must add a unit to the end
|
|
544
|
-
C=C||_config.units[i]||y;if(u===
|
|
544
|
+
C=C||_config.units[i]||y;if(u===n.length){n+=C;a.e+=C}}if(y!==C){c=_convertToUnit(t,i,m,C)||0}// these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.
|
|
545
545
|
a._pt={_next:a._pt,p:v||f===1?v:",",
|
|
546
546
|
//note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
|
|
547
|
-
s:c,c:g-c,m:d&&d<4||i==="zIndex"?Math.round:0}}}a.c=u<
|
|
548
|
-
}else{a.r=i==="display"&&
|
|
547
|
+
s:c,c:g-c,m:d&&d<4||i==="zIndex"?Math.round:0}}}a.c=u<n.length?n.substring(u,n.length):"";//we use the "c" of the PropTween to store the final part of the string (after the last number)
|
|
548
|
+
}else{a.r=i==="display"&&n==="none"?_renderNonTweeningValueOnlyAtEnd:_renderNonTweeningValue}_relExp.test(n)&&(a.e=0);//if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).
|
|
549
549
|
this._pt=a;//start the linked list with this new PropTween. Remember, we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within another plugin too, thus "this" would refer to the plugin.
|
|
550
|
-
return a},_keywordToPercent={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},_convertKeywordsToPercentages=function e(t){var i=t.split(" "),
|
|
550
|
+
return a},_keywordToPercent={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},_convertKeywordsToPercentages=function e(t){var i=t.split(" "),r=i[0],n=i[1]||"50%";if(r==="top"||r==="bottom"||n==="left"||n==="right"){
|
|
551
551
|
//the user provided them in the wrong order, so flip them
|
|
552
|
-
t=n;n=
|
|
553
|
-
o.uncache=1;_removeIndependentTransforms(
|
|
552
|
+
t=r;r=n;n=t}i[0]=_keywordToPercent[r]||r;i[1]=_keywordToPercent[n]||n;return i.join(" ")},_renderClearProps=function e(t,i){if(i.tween&&i.tween._time===i.tween._dur){var r=i.t,n=r.style,s=i.u,o=r._gsap,a,u,f;if(s==="all"||s===true){n.cssText="";u=1}else{s=s.split(",");f=s.length;while(--f>-1){a=s[f];if(_transformProps[a]){u=1;a=a==="transformOrigin"?_transformOriginProp:_transformProp}_removeProperty(r,a)}}if(u){_removeProperty(r,_transformProp);if(o){o.svg&&r.removeAttribute("transform");n.scale=n.rotate=n.translate="none";_parseTransform(r,1);// force all the cached values back to "normal"/identity, otherwise if there's another tween that's already set to render transforms on this element, it could display the wrong values.
|
|
553
|
+
o.uncache=1;_removeIndependentTransforms(n)}}}},
|
|
554
554
|
// note: specialProps should return 1 if (and only if) they have a non-zero priority. It indicates we need to sort the linked list.
|
|
555
|
-
_specialProps={clearProps:function e(t,i,n,
|
|
555
|
+
_specialProps={clearProps:function e(t,i,r,n,s){if(s.data!=="isFromStart"){var o=t._pt=new PropTween(t._pt,i,r,0,0,_renderClearProps);o.u=n;o.pr=-10;o.tween=s;t._props.push(r);return 1}}
|
|
556
556
|
/* className feature (about 0.4kb gzipped).
|
|
557
557
|
, className(plugin, target, property, endValue, tween) {
|
|
558
558
|
let _renderClassName = (ratio, data) => {
|
|
@@ -621,68 +621,68 @@ _specialProps={clearProps:function e(t,i,n,r,s){if(s.data!=="isFromStart"){var o
|
|
|
621
621
|
* TRANSFORMS
|
|
622
622
|
* --------------------------------------------------------------------------------------
|
|
623
623
|
*/
|
|
624
|
-
_identity2DMatrix=[1,0,0,1,0,0],_rotationalProperties={},_isNullTransform=function e(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},_getComputedTransformMatrixAsArray=function e(t){var i=_getComputedProperty(t,_transformProp);return _isNullTransform(i)?_identity2DMatrix:i.substr(7).match(_numExp).map(_round)},_getMatrix=function e(t,i){var
|
|
625
|
-
s=[u.a,u.b,u.c,u.d,u.e,u.f];return s.join(",")==="1,0,0,1,0,0"?_identity2DMatrix:s}else if(s===_identity2DMatrix&&!t.offsetParent&&t!==_docElement&&!
|
|
624
|
+
_identity2DMatrix=[1,0,0,1,0,0],_rotationalProperties={},_isNullTransform=function e(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},_getComputedTransformMatrixAsArray=function e(t){var i=_getComputedProperty(t,_transformProp);return _isNullTransform(i)?_identity2DMatrix:i.substr(7).match(_numExp).map(_round)},_getMatrix=function e(t,i){var r=t._gsap||_getCache(t),n=t.style,s=_getComputedTransformMatrixAsArray(t),o,a,u,f;if(r.svg&&t.getAttribute("transform")){u=t.transform.baseVal.consolidate().matrix;//ensures that even complex values like "translate(50,60) rotate(135,0,0)" are parsed because it mashes it into a matrix.
|
|
625
|
+
s=[u.a,u.b,u.c,u.d,u.e,u.f];return s.join(",")==="1,0,0,1,0,0"?_identity2DMatrix:s}else if(s===_identity2DMatrix&&!t.offsetParent&&t!==_docElement&&!r.svg){
|
|
626
626
|
//note: if offsetParent is null, that means the element isn't in the normal document flow, like if it has display:none or one of its ancestors has display:none). Firefox returns null for getComputedStyle() if the element is in an iframe that has display:none. https://bugzilla.mozilla.org/show_bug.cgi?id=548397
|
|
627
627
|
//browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px).
|
|
628
|
-
u=
|
|
628
|
+
u=n.display;n.display="block";o=t.parentNode;if(!o||!t.offsetParent&&!t.getBoundingClientRect().width){
|
|
629
629
|
// note: in 3.3.0 we switched target.offsetParent to _doc.body.contains(target) to avoid [sometimes unnecessary] MutationObserver calls but that wasn't adequate because there are edge cases where nested position: fixed elements need to get reparented to accurately sense transforms. See https://github.com/greensock/GSAP/issues/388 and https://github.com/greensock/GSAP/issues/375. Note: position: fixed elements report a null offsetParent but they could also be invisible because they're in an ancestor with display: none, so we check getBoundingClientRect(). We only want to alter the DOM if we absolutely have to because it can cause iframe content to reload, like a Vimeo video.
|
|
630
630
|
f=1;//flag
|
|
631
631
|
a=t.nextElementSibling;_docElement.appendChild(t);//we must add it to the DOM in order to get values properly
|
|
632
|
-
}s=_getComputedTransformMatrixAsArray(t);u?
|
|
632
|
+
}s=_getComputedTransformMatrixAsArray(t);u?n.display=u:_removeProperty(t,"display");if(f){a?o.insertBefore(t,a):o?o.appendChild(t):_docElement.removeChild(t)}}return i&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s},_applySVGOrigin=function e(t,i,r,n,s,o){var a=t._gsap,u=s||_getMatrix(t,true),f=a.xOrigin||0,l=a.yOrigin||0,h=a.xOffset||0,_=a.yOffset||0,c=u[0],d=u[1],m=u[2],p=u[3],g=u[4],v=u[5],C=i.split(" "),y=parseFloat(C[0])||0,w=parseFloat(C[1])||0,P,T,S,x;if(!r){P=_getBBox(t);y=P.x+(~C[0].indexOf("%")?y/100*P.width:y);w=P.y+(~(C[1]||C[0]).indexOf("%")?w/100*P.height:w);// if (!("xOrigin" in cache) && (xOrigin || yOrigin)) { // added in 3.12.3, reverted in 3.12.4; requires more exploration
|
|
633
633
|
// xOrigin -= bounds.x;
|
|
634
634
|
// yOrigin -= bounds.y;
|
|
635
635
|
// }
|
|
636
636
|
}else if(u!==_identity2DMatrix&&(T=c*p-d*m)){
|
|
637
637
|
//if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero.
|
|
638
638
|
S=y*(p/T)+w*(-m/T)+(m*v-p*g)/T;x=y*(-d/T)+w*(c/T)-(c*v-d*g)/T;y=S;w=x;// theory: we only had to do this for smoothing and it assumes that the previous one was not originIsAbsolute.
|
|
639
|
-
}if(
|
|
640
|
-
if(o){_addNonTweeningPT(o,a,"xOrigin",f,y);_addNonTweeningPT(o,a,"yOrigin",l,w);_addNonTweeningPT(o,a,"xOffset",h,a.xOffset);_addNonTweeningPT(o,a,"yOffset",_,a.yOffset)}t.setAttribute("data-svg-origin",y+" "+w)},_parseTransform=function e(t,i){var
|
|
639
|
+
}if(n||n!==false&&a.smooth){g=y-f;v=w-l;a.xOffset=h+(g*c+v*m)-g;a.yOffset=_+(g*d+v*p)-v}else{a.xOffset=a.yOffset=0}a.xOrigin=y;a.yOrigin=w;a.smooth=!!n;a.origin=i;a.originIsAbsolute=!!r;t.style[_transformOriginProp]="0px 0px";//otherwise, if someone sets an origin via CSS, it will likely interfere with the SVG transform attribute ones (because remember, we're baking the origin into the matrix() value).
|
|
640
|
+
if(o){_addNonTweeningPT(o,a,"xOrigin",f,y);_addNonTweeningPT(o,a,"yOrigin",l,w);_addNonTweeningPT(o,a,"xOffset",h,a.xOffset);_addNonTweeningPT(o,a,"yOffset",_,a.yOffset)}t.setAttribute("data-svg-origin",y+" "+w)},_parseTransform=function e(t,i){var r=t._gsap||new GSCache(t);if("x"in r&&!i&&!r.uncache){return r}var n=t.style,s=r.scaleX<0,o="px",a="deg",u=getComputedStyle(t),f=_getComputedProperty(t,_transformOriginProp)||"0",l,h,_,c,d,m,p,g,v,C,y,w,P,T,S,x,b,M,k,F,E,j,N,A,D,O,R,z,I,W,B,L;l=h=_=m=p=g=v=C=y=0;c=d=1;r.svg=!!(t.getCTM&&_isSVG(t));if(u.translate){
|
|
641
641
|
// accommodate independent transforms by combining them into normal ones.
|
|
642
|
-
if(u.translate!=="none"||u.scale!=="none"||u.rotate!=="none"){
|
|
642
|
+
if(u.translate!=="none"||u.scale!=="none"||u.rotate!=="none"){n[_transformProp]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[_transformProp]!=="none"?u[_transformProp]:"")}n.scale=n.rotate=n.translate="none"}T=_getMatrix(t,r.svg);if(r.svg){if(r.uncache){
|
|
643
643
|
// if cache.uncache is true (and maybe if origin is 0,0), we need to set element.style.transformOrigin = (cache.xOrigin - bbox.x) + "px " + (cache.yOrigin - bbox.y) + "px". Previously we let the data-svg-origin stay instead, but when introducing revert(), it complicated things.
|
|
644
|
-
D=t.getBBox();f=
|
|
645
|
-
}_applySVGOrigin(t,A||f,!!A||
|
|
644
|
+
D=t.getBBox();f=r.xOrigin-D.x+"px "+(r.yOrigin-D.y)+"px";A=""}else{A=!i&&t.getAttribute("data-svg-origin");// Remember, to work around browser inconsistencies we always force SVG elements' transformOrigin to 0,0 and offset the translation accordingly.
|
|
645
|
+
}_applySVGOrigin(t,A||f,!!A||r.originIsAbsolute,r.smooth!==false,T)}w=r.xOrigin||0;P=r.yOrigin||0;if(T!==_identity2DMatrix){M=T[0];//a11
|
|
646
646
|
k=T[1];//a21
|
|
647
647
|
F=T[2];//a31
|
|
648
648
|
E=T[3];//a41
|
|
649
649
|
l=j=T[4];h=N=T[5];//2D matrix
|
|
650
650
|
if(T.length===6){c=Math.sqrt(M*M+k*k);d=Math.sqrt(E*E+F*F);m=M||k?_atan2(k,M)*_RAD2DEG:0;//note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).
|
|
651
|
-
v=F||E?_atan2(F,E)*_RAD2DEG+m:0;v&&(d*=Math.abs(Math.cos(v*_DEG2RAD)));if(
|
|
651
|
+
v=F||E?_atan2(F,E)*_RAD2DEG+m:0;v&&(d*=Math.abs(Math.cos(v*_DEG2RAD)));if(r.svg){l-=w-(w*M+P*F);h-=P-(w*k+P*E)}//3D matrix
|
|
652
652
|
}else{L=T[6];W=T[7];R=T[8];z=T[9];I=T[10];B=T[11];l=T[12];h=T[13];_=T[14];S=_atan2(L,I);p=S*_RAD2DEG;//rotationX
|
|
653
653
|
if(S){x=Math.cos(-S);b=Math.sin(-S);A=j*x+R*b;D=N*x+z*b;O=L*x+I*b;R=j*-b+R*x;z=N*-b+z*x;I=L*-b+I*x;B=W*-b+B*x;j=A;N=D;L=O}//rotationY
|
|
654
654
|
S=_atan2(-F,I);g=S*_RAD2DEG;if(S){x=Math.cos(-S);b=Math.sin(-S);A=M*x-R*b;D=k*x-z*b;O=F*x-I*b;B=E*b+B*x;M=A;k=D;F=O}//rotationZ
|
|
655
655
|
S=_atan2(k,M);m=S*_RAD2DEG;if(S){x=Math.cos(S);b=Math.sin(S);A=M*x+k*b;D=j*x+N*b;k=k*x-M*b;N=N*x-j*b;M=A;j=D}if(p&&Math.abs(p)+Math.abs(m)>359.9){
|
|
656
656
|
//when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here.
|
|
657
|
-
p=m=0;g=180-g}c=_round(Math.sqrt(M*M+k*k+F*F));d=_round(Math.sqrt(N*N+L*L));S=_atan2(j,N);v=Math.abs(S)>2e-4?S*_RAD2DEG:0;y=B?1/(B<0?-B:B):0}if(
|
|
657
|
+
p=m=0;g=180-g}c=_round(Math.sqrt(M*M+k*k+F*F));d=_round(Math.sqrt(N*N+L*L));S=_atan2(j,N);v=Math.abs(S)>2e-4?S*_RAD2DEG:0;y=B?1/(B<0?-B:B):0}if(r.svg){
|
|
658
658
|
//sense if there are CSS transforms applied on an SVG element in which case we must overwrite them when rendering. The transform attribute is more reliable cross-browser, but we can't just remove the CSS ones because they may be applied in a CSS rule somewhere (not just inline).
|
|
659
|
-
A=t.getAttribute("transform");
|
|
659
|
+
A=t.getAttribute("transform");r.forceCSS=t.setAttribute("transform","")||!_isNullTransform(_getComputedProperty(t,_transformProp));A&&t.setAttribute("transform",A)}}if(Math.abs(v)>90&&Math.abs(v)<270){if(s){c*=-1;v+=m<=0?180:-180;m+=m<=0?180:-180}else{d*=-1;v+=v<=0?180:-180}}i=i||r.uncache;r.x=l-((r.xPercent=l&&(!i&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-l)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+o;r.y=h-((r.yPercent=h&&(!i&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-h)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+o;r.z=_+o;r.scaleX=_round(c);r.scaleY=_round(d);r.rotation=_round(m)+a;r.rotationX=_round(p)+a;r.rotationY=_round(g)+a;r.skewX=v+a;r.skewY=C+a;r.transformPerspective=y+o;if(r.zOrigin=parseFloat(f.split(" ")[2])||!i&&r.zOrigin||0){n[_transformOriginProp]=_firstTwoOnly(f)}r.xOffset=r.yOffset=0;r.force3D=_config.force3D;r.renderTransform=r.svg?_renderSVGTransforms:_supports3D?_renderCSSTransforms:_renderNon3DTransforms;r.uncache=0;return r},_firstTwoOnly=function e(t){return(t=t.split(" "))[0]+" "+t[1]},
|
|
660
660
|
//for handling transformOrigin values, stripping out the 3rd dimension
|
|
661
|
-
_addPxTranslate=function e(t,i,
|
|
662
|
-
if(C&&(h!==_zeroDeg||l!==_zeroDeg)){var P=parseFloat(l)*_DEG2RAD,T=Math.sin(P),S=Math.cos(P),x;P=parseFloat(h)*_DEG2RAD;x=Math.cos(P);o=_addPxTranslate(v,o,T*x*-C);a=_addPxTranslate(v,a,-Math.sin(P)*-C);u=_addPxTranslate(v,u,S*x*-C+C)}if(p!==_zeroPx){y+="perspective("+p+_endParenthesis}if(
|
|
661
|
+
_addPxTranslate=function e(t,i,r){var n=getUnit(i);return _round(parseFloat(i)+parseFloat(_convertToUnit(t,"x",r+"px",n)))+n},_renderNon3DTransforms=function e(t,i){i.z="0px";i.rotationY=i.rotationX="0deg";i.force3D=0;_renderCSSTransforms(t,i)},_zeroDeg="0deg",_zeroPx="0px",_endParenthesis=") ",_renderCSSTransforms=function e(t,i){var r=i||this,n=r.xPercent,s=r.yPercent,o=r.x,a=r.y,u=r.z,f=r.rotation,l=r.rotationY,h=r.rotationX,_=r.skewX,c=r.skewY,d=r.scaleX,m=r.scaleY,p=r.transformPerspective,g=r.force3D,v=r.target,C=r.zOrigin,y="",w=g==="auto"&&t&&t!==1||g===true;// Safari has a bug that causes it not to render 3D transform-origin values properly, so we force the z origin to 0, record it in the cache, and then do the math here to offset the translate values accordingly (basically do the 3D transform-origin part manually)
|
|
662
|
+
if(C&&(h!==_zeroDeg||l!==_zeroDeg)){var P=parseFloat(l)*_DEG2RAD,T=Math.sin(P),S=Math.cos(P),x;P=parseFloat(h)*_DEG2RAD;x=Math.cos(P);o=_addPxTranslate(v,o,T*x*-C);a=_addPxTranslate(v,a,-Math.sin(P)*-C);u=_addPxTranslate(v,u,S*x*-C+C)}if(p!==_zeroPx){y+="perspective("+p+_endParenthesis}if(n||s){y+="translate("+n+"%, "+s+"%) "}if(w||o!==_zeroPx||a!==_zeroPx||u!==_zeroPx){y+=u!==_zeroPx||w?"translate3d("+o+", "+a+", "+u+") ":"translate("+o+", "+a+_endParenthesis}if(f!==_zeroDeg){y+="rotate("+f+_endParenthesis}if(l!==_zeroDeg){y+="rotateY("+l+_endParenthesis}if(h!==_zeroDeg){y+="rotateX("+h+_endParenthesis}if(_!==_zeroDeg||c!==_zeroDeg){y+="skew("+_+", "+c+_endParenthesis}if(d!==1||m!==1){y+="scale("+d+", "+m+_endParenthesis}v.style[_transformProp]=y||"translate(0, 0)"},_renderSVGTransforms=function e(t,i){var r=i||this,n=r.xPercent,s=r.yPercent,o=r.x,a=r.y,u=r.rotation,f=r.skewX,l=r.skewY,h=r.scaleX,_=r.scaleY,c=r.target,d=r.xOrigin,m=r.yOrigin,p=r.xOffset,g=r.yOffset,v=r.forceCSS,C=parseFloat(o),y=parseFloat(a),w,P,T,S,x;u=parseFloat(u);f=parseFloat(f);l=parseFloat(l);if(l){
|
|
663
663
|
//for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees.
|
|
664
|
-
l=parseFloat(l);f+=l;u+=l}if(u||f){u*=_DEG2RAD;f*=_DEG2RAD;w=Math.cos(u)*h;P=Math.sin(u)*h;T=Math.sin(u-f)*-_;S=Math.cos(u-f)*_;if(f){l*=_DEG2RAD;x=Math.tan(f-l);x=Math.sqrt(1+x*x);T*=x;S*=x;if(l){x=Math.tan(l);x=Math.sqrt(1+x*x);w*=x;P*=x}}w=_round(w);P=_round(P);T=_round(T);S=_round(S)}else{w=h;S=_;P=T=0}if(C&&!~(o+"").indexOf("px")||y&&!~(a+"").indexOf("px")){C=_convertToUnit(c,"x",o,"px");y=_convertToUnit(c,"y",a,"px")}if(d||m||p||g){C=_round(C+d-(d*w+m*T)+p);y=_round(y+m-(d*P+m*S)+g)}if(
|
|
664
|
+
l=parseFloat(l);f+=l;u+=l}if(u||f){u*=_DEG2RAD;f*=_DEG2RAD;w=Math.cos(u)*h;P=Math.sin(u)*h;T=Math.sin(u-f)*-_;S=Math.cos(u-f)*_;if(f){l*=_DEG2RAD;x=Math.tan(f-l);x=Math.sqrt(1+x*x);T*=x;S*=x;if(l){x=Math.tan(l);x=Math.sqrt(1+x*x);w*=x;P*=x}}w=_round(w);P=_round(P);T=_round(T);S=_round(S)}else{w=h;S=_;P=T=0}if(C&&!~(o+"").indexOf("px")||y&&!~(a+"").indexOf("px")){C=_convertToUnit(c,"x",o,"px");y=_convertToUnit(c,"y",a,"px")}if(d||m||p||g){C=_round(C+d-(d*w+m*T)+p);y=_round(y+m-(d*P+m*S)+g)}if(n||s){
|
|
665
665
|
//The SVG spec doesn't support percentage-based translation in the "transform" attribute, so we merge it into the translation to simulate it.
|
|
666
|
-
x=c.getBBox();C=_round(C+
|
|
667
|
-
},_addRotationalPropTween=function e(t,i,n,
|
|
666
|
+
x=c.getBBox();C=_round(C+n/100*x.width);y=_round(y+s/100*x.height)}x="matrix("+w+","+P+","+T+","+S+","+C+","+y+")";c.setAttribute("transform",x);v&&(c.style[_transformProp]=x);//some browsers prioritize CSS transforms over the transform attribute. When we sense that the user has CSS transforms applied, we must overwrite them this way (otherwise some browser simply won't render the transform attribute changes!)
|
|
667
|
+
},_addRotationalPropTween=function e(t,i,r,n,s){var o=360,a=_isString(s),u=parseFloat(s)*(a&&~s.indexOf("rad")?_RAD2DEG:1),f=u-n,l=n+f+"deg",h,_;if(a){h=s.split("_")[1];if(h==="short"){f%=o;if(f!==f%(o/2)){f+=f<0?o:-o}}if(h==="cw"&&f<0){f=(f+o*_bigNum)%o-~~(f/o)*o}else if(h==="ccw"&&f>0){f=(f-o*_bigNum)%o-~~(f/o)*o}}t._pt=_=new PropTween(t._pt,i,r,n,f,_renderPropWithEnd);_.e=l;_.u="deg";t._props.push(r);return _},_assign=function e(t,i){
|
|
668
668
|
// Internet Explorer doesn't have Object.assign(), so we recreate it here.
|
|
669
|
-
for(var
|
|
669
|
+
for(var r in i){t[r]=i[r]}return t},_addRawTransformPTs=function e(t,i,r){
|
|
670
670
|
//for handling cases where someone passes in a whole transform string, like transform: "scale(2, 3) rotate(20deg) translateY(30em)"
|
|
671
|
-
var
|
|
671
|
+
var n=_assign({},r._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=r.style,a,u,f,l,h,_,c,d;if(n.svg){f=r.getAttribute("transform");r.setAttribute("transform","");o[_transformProp]=i;a=_parseTransform(r,1);_removeProperty(r,_transformProp);r.setAttribute("transform",f)}else{f=getComputedStyle(r)[_transformProp];o[_transformProp]=i;a=_parseTransform(r,1);o[_transformProp]=f}for(u in _transformProps){f=n[u];l=a[u];if(f!==l&&s.indexOf(u)<0){
|
|
672
672
|
//tweening to no perspective gives very unintuitive results - just keep the same perspective in that case.
|
|
673
|
-
c=getUnit(f);d=getUnit(l);h=c!==d?_convertToUnit(
|
|
674
|
-
_forEachName("padding,margin,Width,Radius",(function(e,t){var i="Top",
|
|
673
|
+
c=getUnit(f);d=getUnit(l);h=c!==d?_convertToUnit(r,u,f,d):parseFloat(f);_=parseFloat(l);t._pt=new PropTween(t._pt,a,u,h,_-h,_renderCSSProp);t._pt.u=d||0;t._props.push(u)}}_assign(a,n)};// handle splitting apart padding, margin, borderWidth, and borderRadius into their 4 components. Firefox, for example, won't report borderRadius correctly - it will only do borderTopLeftRadius and the other corners. We also want to handle paddingTop, marginLeft, borderRightWidth, etc.
|
|
674
|
+
_forEachName("padding,margin,Width,Radius",(function(e,t){var i="Top",r="Right",n="Bottom",s="Left",o=(t<3?[i,r,n,s]:[i+s,i+r,n+r,n+s]).map((function(i){return t<2?e+i:"border"+i+e}));_specialProps[t>1?"border"+e:e]=function(e,t,i,r,n){var s,a;if(arguments.length<4){
|
|
675
675
|
// getter, passed target, property, and unit (from _get())
|
|
676
|
-
s=o.map((function(t){return _get(e,t,i)}));a=s.join(" ");return a.split(s[0]).length===5?s[0]:a}s=(
|
|
677
|
-
this.styles=this.styles||_getStyleSaver(t);S=this.styles.props;this.tween=
|
|
676
|
+
s=o.map((function(t){return _get(e,t,i)}));a=s.join(" ");return a.split(s[0]).length===5?s[0]:a}s=(r+"").split(" ");a={};o.forEach((function(e,t){return a[e]=s[t]=s[t]||s[(t-1)/2|0]}));e.init(t,a,n)}}));var CSSPlugin={name:"css",register:_initCore,targetTest:function e(t){return t.style&&t.nodeType},init:function e(t,i,r,n,s){var o=this._props,a=t.style,u=r.vars.startAt,f,l,h,_,c,d,m,p,g,v,C,y,w,P,T,S,x;_pluginInitted||_initCore();// we may call init() multiple times on the same plugin instance, like when adding special properties, so make sure we don't overwrite the revert data or inlineProps
|
|
677
|
+
this.styles=this.styles||_getStyleSaver(t);S=this.styles.props;this.tween=r;for(m in i){if(m==="autoRound"){continue}l=i[m];if(_plugins[m]&&_checkPlugin(m,i,r,n,t,s)){
|
|
678
678
|
// plugins
|
|
679
|
-
continue}c=typeof l;d=_specialProps[m];if(c==="function"){l=l.call(n,
|
|
679
|
+
continue}c=typeof l;d=_specialProps[m];if(c==="function"){l=l.call(r,n,t,s);c=typeof l}if(c==="string"&&~l.indexOf("random(")){l=_replaceRandom(l)}if(d){d(this,t,m,l,r)&&(T=1)}else if(m.substr(0,2)==="--"){
|
|
680
680
|
//CSS variable
|
|
681
681
|
f=(getComputedStyle(t).getPropertyValue(m)+"").trim();l+="";_colorExp.lastIndex=0;if(!_colorExp.test(f)){
|
|
682
682
|
// colors don't have units
|
|
683
|
-
p=getUnit(f);g=getUnit(l);g?p!==g&&(f=_convertToUnit(t,m,f,g)+g):p&&(l+=p)}this.add(a,"setProperty",f,l,
|
|
683
|
+
p=getUnit(f);g=getUnit(l);g?p!==g&&(f=_convertToUnit(t,m,f,g)+g):p&&(l+=p)}this.add(a,"setProperty",f,l,n,s,0,0,m);o.push(m);S.push(m,0,a[m])}else if(c!=="undefined"){if(u&&m in u){
|
|
684
684
|
// in case someone hard-codes a complex value as the start, like top: "calc(2vh / 2)". Without this, it'd use the computed value (always in px)
|
|
685
|
-
f=typeof u[m]==="function"?u[m].call(n,
|
|
685
|
+
f=typeof u[m]==="function"?u[m].call(r,n,t,s):u[m];_isString(f)&&~f.indexOf("random(")&&(f=_replaceRandom(f));getUnit(f+"")||f==="auto"||(f+=_config.units[m]||getUnit(_get(t,m))||"");// for cases when someone passes in a unitless value like {x: 100}; if we try setting translate(100, 0px) it won't work.
|
|
686
686
|
(f+"").charAt(1)==="="&&(f=_get(t,m));// can't work with relative values
|
|
687
687
|
}else{f=_get(t,m)}_=parseFloat(f);v=c==="string"&&l.charAt(1)==="="&&l.substr(0,2);v&&(l=l.substr(2));h=parseFloat(l);if(m in _propertyAliases){if(m==="autoAlpha"){
|
|
688
688
|
//special case where we control the visibility along with opacity. We still allow the opacity value to pass through and get tweened.
|
|
@@ -700,9 +700,9 @@ g=getUnit(l)||(m in _config.units?_config.units[m]:p);p!==g&&(_=_convertToUnit(t
|
|
|
700
700
|
//when the tween goes all the way back to the beginning, we need to revert it to the OLD/ORIGINAL value (with those units). We record that as a "b" (beginning) property and point to a render method that handles that. (performance optimization)
|
|
701
701
|
this._pt.b=f;this._pt.r=_renderCSSPropWithBeginning}}else if(!(m in a)){if(m in t){
|
|
702
702
|
//maybe it's not a style - it could be a property added directly to an element in which case we'll try to animate that.
|
|
703
|
-
this.add(t,m,f||t[m],v?v+l:l,
|
|
703
|
+
this.add(t,m,f||t[m],v?v+l:l,n,s)}else if(m!=="parseTransform"){_missingPlugin(m,l);continue}}else{_tweenComplexCSSString.call(this,t,m,f,v?v+l:l)}C||(m in a?S.push(m,0,a[m]):typeof t[m]==="function"?S.push(m,2,t[m]()):S.push(m,1,f||t[m]));o.push(m)}}T&&_sortPropTweensByPriority(this)},render:function e(t,i){if(i.tween._time||!_reverting()){var r=i._pt;while(r){r.r(t,r.d);r=r._next}}else{i.styles.revert()}},get:_get,aliases:_propertyAliases,getSetter:function e(t,i,r){
|
|
704
704
|
//returns a setter function that accepts target, property, value and applies it accordingly. Remember, properties like "x" aren't as simple as target.style.property = value because they've got to be applied to a proxy object and then merged into a transform string in a renderer.
|
|
705
|
-
var r=_propertyAliases[i];r&&r.indexOf(",")<0&&(i=r);return i in _transformProps&&i!==_transformOriginProp&&(t._gsap.x||_get(t,"x"))?n&&_recentSetterPlugin===n?i==="scale"?_setterScale:_setterTransform:(_recentSetterPlugin=n||{})&&(i==="scale"?_setterScaleWithRender:_setterTransformWithRender):t.style&&!_isUndefined(t.style[i])?_setterCSSStyle:~i.indexOf("-")?_setterCSSProp:_getSetter(t,i)},core:{_removeProperty:_removeProperty,_getMatrix:_getMatrix}};gsap.utils.checkPrefix=_checkPropPrefix;gsap.core.getStyleSaver=_getStyleSaver;(function(e,t,i,n){var r=_forEachName(e+","+t+","+i,(function(e){_transformProps[e]=1}));_forEachName(t,(function(e){_config.units[e]="deg";_rotationalProperties[e]=1}));_propertyAliases[r[13]]=e+","+t;_forEachName(n,(function(e){var t=e.split(":");_propertyAliases[t[1]]=r[t[0]]}))})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){_config.units[e]="px"}));gsap.registerPlugin(CSSPlugin);var gsapWithCSS=gsap.registerPlugin(CSSPlugin)||gsap;var miaSvg='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="head-default">\n <path id="border-head" d="M15.8188 3C16.5046 3.00015 17.141 3.36269 17.4986 3.95703L21.7112 10.957C22.0963 11.5972 22.0963 12.4028 21.7112 13.043L17.4986 20.043C17.141 20.6373 16.5046 20.9998 15.8188 21H8.18127C7.49525 21 6.85822 20.6375 6.50049 20.043L2.28892 13.043C1.90369 12.4027 1.90369 11.5973 2.28892 10.957L6.50049 3.95703C6.85822 3.36252 7.49525 3 8.18127 3H15.8188Z" stroke="var(--mds-emoji-mia-head-stroke-color, rgb(194 160 251))" stroke-width="var(--mds-emoji-mia-head-stroke-width, 2px)" fill="var(--mds-emoji-mia-head-stroke-color, rgb(194 160 251))"/>\n <path id="path-head" d="M15.8188 3C16.5046 3.00015 17.141 3.36269 17.4986 3.95703L21.7112 10.957C22.0963 11.5972 22.0963 12.4028 21.7112 13.043L17.4986 20.043C17.141 20.6373 16.5046 20.9998 15.8188 21H8.18127C7.49525 21 6.85822 20.6375 6.50049 20.043L2.28892 13.043C1.90369 12.4027 1.90369 11.5973 2.28892 10.957L6.50049 3.95703C6.85822 3.36252 7.49525 3 8.18127 3H15.8188Z" fill="var(--mds-emoji-mia-head-color, rgb(224 207 253))"/>\n </g>\n <g id="eyes-default">\n <path id="left-eye" d="M8 8H10V12H8V8Z" fill="var(--mds-emoji-mia-eyes-color, rgb(81 9 207))"/>\n <path id="right-eye" d="M14 8H16V12H14V8Z" fill="var(--mds-emoji-mia-eyes-color, rgb(81 9 207))"/>\n </g>\n <g id="eyes-closed" style="visibility:hidden;">\n <path id="left-eye-closed" d="M6 10H10V12H6V10Z" fill="var(--mds-emoji-mia-eyes-color, rgb(81 9 207))"/>\n <path id="right-eye-closed" d="M14 10H18V12H14V10Z" fill="var(--mds-emoji-mia-eyes-color, rgb(81 9 207))"/>\n </g>\n <path id="mouth-default" d="M16.707 15.707C15.4771 16.937 13.6985 17.5 12 17.5C10.3015 17.5 8.52294 16.937 7.29297 15.707L8.70703 14.293C9.47706 15.063 10.6985 15.5 12 15.5C13.3015 15.5 14.5229 15.063 15.293 14.293L16.707 15.707Z" fill="var(--mds-emoji-mia-mouth-color, rgb(98 12 245))"/>\n <path id="mouth-smile" style="visibility:hidden;" d="M16 14H8C8.33333 15.3333 9 18 12 18C15 18 15.6667 15.3333 16 14Z" fill="var(--mds-emoji-mia-mouth-color, rgb(98 12 245))"/>\n <path id="mouth-serious" style="visibility:hidden;" d="M8 15H16V17H8V15Z" fill="var(--mds-emoji-mia-mouth-color, rgb(98 12 245))"/>\n <path id="hand-think" style="visibility:hidden;" d="M6 16C6.55228 16 7 16.4477 7 17V18H13C13.5523 18 14 18.4477 14 19C14 19.5523 13.5523 20 13 20H10.3818C11.1252 20 11.6088 20.7824 11.2764 21.4473L10.2764 23.4473C10.107 23.786 9.76059 24 9.38184 24H4V20L5 18V16H6Z" fill="var(--mds-emoji-mia-hands-color, rgb(98 12 245))"/>\n</svg>\n';var simiSvg='<svg width="440" height="440" viewBox="0 0 440 440" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="ears-default">\n <g id="ear-right">\n <path id="ear-right-shape" fill="var(--mds-emoji-simi-skin, #F36320)" d="M363.838 54.3257C339.126 44.6171 278.031 90.7244 256.023 111.557C205.523 159.363 303.523 209.826 358.387 195.099C380.992 189.032 391.095 169.008 388.672 165.367C386.734 162.454 374.135 161.322 368.078 161.12C376.962 129.567 388.551 64.0342 363.838 54.3257Z"/>\n <path id="ear-right-inner-shape" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M351.676 53.2891C356.294 52.7076 360.415 52.9806 363.838 54.3252C364.658 54.6472 365.437 55.0331 366.178 55.4746C368.347 56.9073 370.299 58.8573 372.053 61.2344C385.423 81.3621 375.744 133.891 368.078 161.119C374.135 161.321 386.734 162.455 388.672 165.367C391.094 169.008 380.992 189.032 358.387 195.1C357.17 195.426 355.929 195.687 354.667 195.888C317.523 201.796 244.693 161.119 265.859 130.788C281.528 108.336 324.274 59.2313 351.676 53.2891Z"/>\n <path id="ear-right-hole" fill="var(--mds-emoji-simi-skin-dark, #C3481B)" d="M350.023 84.8079C329.105 90.1196 311.307 114.384 305.023 125.853C299.251 136.387 303.53 147.927 311.277 155C320.553 163.469 334.801 165.535 342.726 151.808C361.778 118.808 355.529 93.3915 350.023 84.8079Z"/>\n <path id="ear-right-outline-border" stroke="var(--mds-emoji-simi-skin-dark, #C3481B)" stroke-width="9" stroke-linecap="round" d="M363.838 54.3257C339.126 44.6171 278.031 90.7244 256.023 111.557C205.523 159.363 303.523 209.826 358.387 195.099C380.992 189.032 391.095 169.008 388.672 165.367C386.734 162.454 374.135 161.322 368.078 161.12C376.962 129.567 388.551 64.0342 363.838 54.3257Z"/>\n <path id="ear-right-border" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="7" stroke-linecap="round" d="M349.523 84.5C334.523 89 291.523 121 306.523 149"/>\n </g>\n <g id="ear-left">\n <path id="ear-left-shape" fill="var(--mds-emoji-simi-skin, #F36320)" d="M77.1852 54.3257C101.898 44.6171 162.993 90.7244 185 111.557C235.5 159.363 137.5 209.826 82.6365 195.099C60.0315 189.032 49.9287 169.008 52.3515 165.367C54.2897 162.454 66.8883 161.322 72.9453 161.12C64.0617 129.567 52.4726 64.0342 77.1852 54.3257Z"/>\n <path id="ear-left-inner-shape" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M89.3476 53.2891C84.7294 52.7076 80.6085 52.9806 77.1855 54.3252C76.3658 54.6472 75.5869 55.0331 74.8457 55.4746C72.6763 56.9073 70.7246 58.8573 68.9707 61.2344C55.6008 81.3621 65.2794 133.891 72.9453 161.119C66.8883 161.321 54.2898 162.455 52.3516 165.367C49.9291 169.008 60.0319 189.032 82.6367 195.1C83.8533 195.426 85.0943 195.687 86.3564 195.888C123.5 201.796 196.33 161.119 175.164 130.788C159.496 108.336 116.75 59.2313 89.3476 53.2891Z"/>\n <path id="ear-left-hole" fill="var(--mds-emoji-simi-skin-dark, #C3481B)" d="M91 84.8079C111.919 90.1196 129.716 114.384 136 125.853C141.772 136.387 137.494 147.927 129.747 155C120.471 163.469 106.223 165.535 98.2973 151.808C79.2451 118.808 85.494 93.3915 91 84.8079Z"/>\n <path id="ear-left-outline-border" stroke="var(--mds-emoji-simi-skin-dark, #C3481B)" stroke-width="9" stroke-linecap="round" d="M77.1852 54.3257C101.898 44.6171 162.993 90.7244 185 111.557C235.5 159.363 137.5 209.826 82.6365 195.099C60.0315 189.032 49.9287 169.008 52.3515 165.367C54.2897 162.454 66.8883 161.322 72.9453 161.12C64.0617 129.567 52.4726 64.0342 77.1852 54.3257Z"/>\n <path id="ear-left-border" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="7" stroke-linecap="round" d="M91.5 84.5C106.5 89 149.5 121 134.5 149"/>\n </g>\n </g>\n <g id="head-default">\n <path id="shape-head" fill="var(--mds-emoji-simi-skin, #F36320)" d="M378.732 217.557C340.98 122.357 268.622 107.557 219.909 107.557C171.197 107.557 98.8384 122.357 61.0863 217.557C50.181 245.057 52.6419 250.557 21.1818 271.057C19.6595 281.557 27.7783 295.057 42.4935 297.057C38.7724 298.224 30.5183 300.557 27.2708 300.557C23.2115 300.557 65.1456 387.557 219.909 387.557C374.673 387.557 416.789 300.057 412.729 300.057C409.482 300.057 401.228 297.724 397.507 296.557C412.222 294.557 420.34 281.057 418.818 270.557C387.358 250.057 389.637 245.057 378.732 217.557Z"/>\n <g id="ear-tufts">\n <g id="right-tuft">\n <path id="right-tuft-shape" fill="var(--mds-emoji-simi-skin, #F36320)" d="M336.411 123.628C333.005 118.799 313.911 124.433 304.789 127.853C295.789 132.254 282.34 139.697 296.289 146.057C313.289 153.808 342.492 168.294 342.492 153.808C343.708 143.547 331.749 140.126 326.681 139.321C331.343 136.102 339.816 128.457 336.411 123.628Z"/>\n <path id="right-tuft-outline" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="7" stroke-linecap="round" d="M304.789 127.853C313.911 124.433 333.005 118.799 336.411 123.628C339.816 128.457 331.343 136.102 326.681 139.321C331.749 140.126 343.708 143.547 342.492 153.808"/>\n </g>\n <g id="left-tuft">\n <path id="left-tuft-shape" fill="var(--mds-emoji-simi-skin, #F36320)" d="M104.167 122.628C107.573 117.799 126.667 123.433 135.789 126.853C144.789 131.254 158.239 138.697 144.289 145.057C127.289 152.808 98.0863 167.294 98.0863 152.808C96.8701 142.547 108.83 139.126 113.897 138.321C109.235 135.102 100.762 127.457 104.167 122.628Z"/>\n <path id="left-tuft-outline" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="7" stroke-linecap="round" d="M135.789 126.853C126.667 123.433 107.573 117.799 104.167 122.628C100.762 127.457 109.235 135.102 113.897 138.321C108.83 139.126 96.8701 142.547 98.0864 152.808"/>\n </g>\n </g>\n <g id="cheeks">\n <path id="right-cheek" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M380.5 290.057C364 262.557 340 266.355 318 279.057C344.5 305.557 344 327.557 330 361.557C384.8 341.157 386.5 305.39 380.5 290.057Z"/>\n <path id="left-cheek" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M59.3658 290.057C75.8658 262.557 99.8658 266.355 121.866 279.057C95.3658 305.557 95.8658 327.557 109.866 361.557C55.0658 341.157 53.3658 305.39 59.3658 290.057Z"/>\n </g>\n <path id="chin" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M220.5 372.557C256.675 372.557 286 352.186 286 327.057C286 301.928 256.675 260.557 220.5 260.557C184.325 260.557 155 301.928 155 327.057C155 352.186 184.325 372.557 220.5 372.557Z"/>\n </g>\n <g id="eyebrows-default">\n <path id="left-eyebrow" fill="var(--mds-emoji-simi-eyebrow, #FEEFD8)" d="M175.248 176.007C177.691 183.997 168.289 189.539 152.865 194.255C137.442 198.97 131.072 201.193 128.629 193.203C126.186 185.212 132.802 175.371 148.226 170.655C163.649 165.94 172.805 168.016 175.248 176.007Z"/>\n <path id="right-eyebrow" fill="var(--mds-emoji-simi-eyebrow, #FEEFD8)" d="M265.189 175.007C262.746 182.997 272.148 188.539 287.572 193.255C302.995 197.97 309.365 200.193 311.808 192.203C314.251 184.212 307.635 174.371 292.211 169.655C276.788 164.94 267.632 167.016 265.189 175.007Z"/>\n </g>\n <g id="eyes-default" style="transform-origin:50% 50%;">\n <g id="right-eye">\n <ellipse id="right-eye-inner-shape" fill="var(--mds-emoji-simi-eye, #40281B)" cx="287.002" cy="249.057" rx="18.5" ry="24.5" transform="rotate(12 287.002 249.057)"/>\n <circle id="right-eye-inner-light" fill="var(--mds-emoji-simi-eye-light, #FFFFFF)" cx="291" cy="242.557" r="6"/>\n </g>\n <g id="left-eye">\n <ellipse id="left-eye-inner-shape" fill="var(--mds-emoji-simi-eye, #40281B)" cx="18.5" cy="24.5" rx="18.5" ry="24.5" transform="matrix(-0.978148 0.207912 0.207912 0.978148 165.139 221.541)"/>\n <circle id="left-eye-inner-light" fill="var(--mds-emoji-simi-eye-light, #FFFFFF)" cx="6" cy="6" r="6" transform="matrix(-1 0 0 1 160.14 236.852)"/>\n </g>\n </g>\n <g id="eyes-closed" style="visibility: hidden;">\n <path id="left-eye-closed" stroke="var(--mds-emoji-simi-eye, #40281B)" stroke-width="12" stroke-linecap="round" d="M125 248.5C137.5 240.5 167.1 241.3 179.5 248.5"/>\n <path id="right-eye-closed" stroke="var(--mds-emoji-simi-eye, #40281B)" stroke-width="12" stroke-linecap="round" d="M315.5 248.5C303 240.5 273.4 241.3 261 248.5"/>\n </g>\n <g id="eyes-focused" style="visibility: hidden;">\n <g id="right-eye-focused">\n <ellipse id="right-eye-inner-shape-focused" fill="var(--mds-emoji-simi-eye, #40281B)" cx="287.002" cy="249.057" rx="18.5" ry="24.5" transform="rotate(-90 287.002 249.057)"/>\n <circle id="right-eye-inner-light-focused" fill="var(--mds-emoji-simi-eye-light, #FFFFFF)" cx="291" cy="242.557" r="6"/>\n </g>\n <g id="left-eye-focused">\n <ellipse id="left-eye-inner-shape-focused" fill="var(--mds-emoji-simi-eye, #40281B)" cx="18.5" cy="24.5" rx="18.5" ry="24.5" transform="matrix(-4.37114e-08 1 1 4.37114e-08 127.637 230.852)"/>\n <circle id="left-eye-inner-light-focused" fill="var(--mds-emoji-simi-eye-light, #FFFFFF)" cx="6" cy="6" r="6" transform="matrix(-1 0 0 1 160.14 236.852)"/>\n </g>\n </g>\n <path id="gadget-default" fill="var(--mds-emoji-simi-gadget, #2B1C15)" fill-rule="evenodd" clip-rule="evenodd" d="M296 186C327.723 186 353.88 209.825 357.557 240.558H367C370.314 240.558 373 243.244 373 246.558C373 249.871 370.314 252.558 367 252.558H357.834C355.501 284.671 328.709 310 296 310C262.189 310 234.7 282.936 234.014 249.289C230.711 246.983 225.885 245.558 220.5 245.558C215.114 245.558 210.288 246.983 206.985 249.289C206.299 282.936 178.811 310 145 310C112.291 310 85.4993 284.671 83.166 252.558H74C70.6864 252.558 68.0002 249.871 68 246.558C68 243.244 70.6863 240.558 74 240.558H83.4434C87.12 209.825 113.277 186 145 186C175.248 186 200.437 207.662 205.9 236.318C210.539 234.42 215.652 233.558 220.5 233.558C225.348 233.558 230.461 234.419 235.099 236.317C240.563 207.661 265.752 186 296 186ZM145 198C117.386 198 95 220.386 95 248C95 275.614 117.386 298 145 298C172.614 298 195 275.614 195 248C195 220.386 172.614 198 145 198ZM296 198C268.386 198 246 220.386 246 248C246 275.614 268.386 298 296 298C323.614 298 346 275.614 346 248C346 220.386 323.614 198 296 198Z"/>\n <g id="mouth-default">\n <path id="muzzle-shape-mouth-default" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M220.5 328.5C238.5 341 263 324.813 263 307.312C263 289.812 243.972 261 220.5 261C197.028 261 178 289.812 178 307.312C178 324.813 201 341 220.5 328.5Z"/>\n <path id="shape-mouth-mouth-default" fill="var(--mds-emoji-simi-mouth, #2B1C15)" d="M220 298.057C221.933 298.057 223.5 299.624 223.5 301.557V324.914C224.677 325.612 226.31 326.349 228.29 326.949C231.08 327.793 234.312 328.287 237.507 328.095C240.693 327.903 243.74 327.039 246.322 325.27C248.871 323.524 251.171 320.758 252.696 316.401C253.335 314.576 255.332 313.615 257.156 314.253C258.981 314.892 259.942 316.889 259.304 318.713C257.329 324.356 254.159 328.386 250.278 331.044C246.43 333.681 242.086 334.832 237.928 335.083C233.778 335.332 229.713 334.694 226.262 333.649C223.943 332.947 221.784 332.025 220 330.976C218.216 332.025 216.057 332.947 213.738 333.649C210.287 334.694 206.221 335.332 202.072 335.083C197.914 334.832 193.57 333.681 189.722 331.044C185.841 328.386 182.671 324.356 180.696 318.713C180.058 316.889 181.019 314.892 182.844 314.253C184.668 313.615 186.665 314.576 187.304 316.401C188.829 320.758 191.128 323.524 193.678 325.27C196.26 327.039 199.307 327.903 202.493 328.095C205.688 328.287 208.919 327.793 211.71 326.949C213.689 326.35 215.323 325.612 216.5 324.914V301.557C216.5 299.624 218.067 298.057 220 298.057Z"/>\n <g id="nose-mouth-default">\n <path id="node-shape-mouth-default" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M219.5 273.557C207.626 273.557 198 280.105 198 288.182C198 296.259 207.626 309.557 219.5 309.557C231.374 309.557 241 296.259 241 288.182C241 280.105 231.374 273.557 219.5 273.557Z"/>\n <ellipse id="nose-light-mouth-default" fill="var(--mds-emoji-simi-nose-light, #7E695F)" cx="220" cy="285.557" rx="11" ry="5"/>\n </g>\n </g>\n <g id="mouth-smile" style="visibility: hidden;">\n <g id="inner-mouth">\n <ellipse id="throat-mouth-smile" fill="var(--mds-emoji-simi-mouth-throat, #C3481B)" cx="220.5" cy="326" rx="32.5" ry="29" />\n <path id="teeth-mouth-smile" fill="var(--mds-emoji-simi-mouth-teeth, #FFFFFF)" d="M220.5 329C235.689 329 248.003 331.686 248.003 335C248.003 338.314 235.689 341 220.5 341C205.311 341 192.997 338.314 192.997 335C192.997 331.686 205.311 329 220.5 329Z"/>\n <path id="lips-mouth-smile" stroke="var(--mds-emoji-simi-nose, #2B1C15)" stroke-width="7" d="M220.5 300.5C236.62 300.5 249.5 313.138 249.5 328.5C249.5 343.862 236.62 356.5 220.5 356.5C204.38 356.5 191.5 343.862 191.5 328.5C191.5 313.138 204.38 300.5 220.5 300.5Z" />\n </g>\n <path id="muzzle-shape-mouth-smile" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M220.5 328.5C238.5 341 263 324.813 263 307.312C263 289.812 243.972 261 220.5 261C197.028 261 178 289.812 178 307.312C178 324.813 201 341 220.5 328.5Z"/>\n <path id="shape-mouth-smile" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M220 298.057C221.933 298.057 223.5 299.624 223.5 301.557V324.914C224.677 325.612 226.31 326.349 228.29 326.949C231.08 327.793 234.312 328.287 237.507 328.095C240.693 327.903 243.74 327.039 246.322 325.27C248.871 323.524 251.171 320.758 252.696 316.401C253.335 314.576 255.332 313.615 257.156 314.253C258.981 314.892 259.942 316.889 259.304 318.713C257.329 324.356 254.159 328.386 250.278 331.044C246.43 333.681 242.086 334.832 237.928 335.083C233.778 335.332 229.713 334.694 226.262 333.649C223.943 332.947 221.784 332.025 220 330.976C218.216 332.025 216.057 332.947 213.738 333.649C210.287 334.694 206.221 335.332 202.072 335.083C197.914 334.832 193.57 333.681 189.722 331.044C185.841 328.386 182.671 324.356 180.696 318.713C180.058 316.889 181.019 314.892 182.844 314.253C184.668 313.615 186.665 314.576 187.304 316.401C188.829 320.758 191.128 323.524 193.678 325.27C196.26 327.039 199.307 327.903 202.493 328.095C205.688 328.287 208.919 327.793 211.71 326.949C213.689 326.35 215.323 325.612 216.5 324.914V301.557C216.5 299.624 218.067 298.057 220 298.057Z"/>\n <g id="nose-mouth-smile">\n <path id="nose-shape-mouth-smile" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M219.5 273.557C207.626 273.557 198 280.105 198 288.182C198 296.259 207.626 309.557 219.5 309.557C231.374 309.557 241 296.259 241 288.182C241 280.105 231.374 273.557 219.5 273.557Z"/>\n <ellipse id="nose-light-mouth-smile" fill="var(--mds-emoji-simi-nose-light, #7E695F)" cx="220" cy="285.557" rx="11" ry="5"/>\n </g>\n </g>\n <g id="mouth-serious" style="visibility: hidden;">\n <path id="muzzle-shape-mouth-serious" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M220.5 328.5C238.5 341 263 324.813 263 307.312C263 289.812 243.972 261 220.5 261C197.028 261 178 289.812 178 307.312C178 324.813 201 341 220.5 328.5Z"/>\n <path id="shape-mouth-serious" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M220 298C221.933 298 223.5 299.567 223.5 301.5V326.675C224.663 326.774 225.818 326.903 226.821 327.026C227.869 327.155 228.796 327.283 229.462 327.38C229.795 327.428 230.064 327.469 230.251 327.497C230.344 327.511 230.418 327.522 230.469 327.53C230.494 327.534 230.514 327.538 230.527 327.54C230.534 327.541 230.539 327.541 230.543 327.542C230.545 327.542 230.547 327.543 230.548 327.543H230.55C232.459 327.847 233.76 329.641 233.456 331.55C233.152 333.459 231.359 334.76 229.45 334.456C229.45 334.456 229.448 334.456 229.447 334.456C229.445 334.456 229.441 334.455 229.436 334.454C229.426 334.452 229.41 334.451 229.389 334.447C229.345 334.441 229.28 334.43 229.194 334.417C229.023 334.391 228.772 334.353 228.458 334.308C227.83 334.217 226.954 334.095 225.968 333.974C223.947 333.725 221.629 333.5 220 333.5C218.371 333.5 216.053 333.725 214.032 333.974C213.046 334.095 212.17 334.217 211.542 334.308C211.228 334.353 210.977 334.391 210.806 334.417C210.72 334.43 210.655 334.441 210.611 334.447C210.59 334.451 210.574 334.452 210.563 334.454C210.559 334.455 210.555 334.456 210.553 334.456C210.552 334.456 210.55 334.456 210.55 334.456C208.641 334.76 206.848 333.459 206.544 331.55C206.24 329.641 207.541 327.848 209.45 327.544L209.452 327.543C209.453 327.543 209.455 327.542 209.457 327.542C209.461 327.541 209.466 327.541 209.473 327.54C209.486 327.538 209.506 327.534 209.531 327.53C209.582 327.522 209.656 327.511 209.749 327.497C209.936 327.469 210.205 327.428 210.538 327.38C211.204 327.283 212.131 327.155 213.179 327.026C214.182 326.903 215.337 326.774 216.5 326.675V301.5C216.5 299.567 218.067 298 220 298Z" />\n <g id="nose-mouth-serious">\n <path id="nose-shape-mouth-serious" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M219.5 273.557C207.626 273.557 198 280.105 198 288.182C198 296.259 207.626 309.557 219.5 309.557C231.374 309.557 241 296.259 241 288.182C241 280.105 231.374 273.557 219.5 273.557Z"/>\n <ellipse id="nose-light-mouth-serious" fill="var(--mds-emoji-simi-nose-light, #7E695F)" cx="220" cy="285.557" rx="11" ry="5"/>\n </g>\n </g>\n <g id="hand-think" style="visibility: hidden;">\n <path id="shape-hand-think" fill="var(--mds-emoji-simi-skin, #F36320)" d="M237.5 438C238.5 435 241 428.5 243.5 421.5C257.989 413.451 258.739 397.302 255.5 383.467C278 367.934 263.5 350 255.5 350C251.5 340.4 242.5 339 238.5 339.5C244.5 324 233 323.5 229 323.5C225 323.5 202.5 323 189 351C183.4 374.6 195 400.833 201.5 411C200.667 411.5 199 414.5 195.5 420C211 426.5 204 423.5 237.5 438Z" />\n <path id="palm-hand-think" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="6" d="M251 369C267 409.5 249.5 416.5 242 423.5L236.5 437.5"/>\n <path id="finger-3-hand-think" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="6" d="M256 382.5C262.5 379.333 273.7 370.1 266.5 358.5C257.5 344 234 360 230 363"/>\n <path id="finger-2-hand-think" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="6" d="M256 350.5C256 338 236.1 329.9 208.5 357.5"/>\n <path id="finger-1-hand-think" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="6" d="M196.5 420.5L201.5 410.5C195.167 400 183.8 373.6 189 352C194.2 330.4 218.833 323.667 230.5 323C235.333 322.5 243.9 325.1 239.5 339.5"/>\n </g>\n</svg>\n';var mdsEmojiCss=function(){return"@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-emoji-expression-follow-mouse-traits-duration:.2s;--mds-emoji-expression-follow-mouse-head-duration:.3s;--mds-emoji-expression-max-rotation:16deg;--mds-emoji-perspective:400px;align-items:stretch;aspect-ratio:1;display:flex;height:calc(var(--spacing,.0025rem)*1200);justify-content:stretch;perspective:var(--mds-emoji-perspective,400px);perspective-origin:50%;width:calc(var(--spacing,.0025rem)*1200)}svg{height:100%;overflow:visible;transform-style:preserve-3d;transition:transform .2s ease-out;width:100%}:host([name=mia]){--mds-emoji-mia-eyes-color:rgb(var(--magma-accent-ai-emphasis-hover,var(--variant-ai-03,87 20 242)));--mds-emoji-mia-hands-color:rgb(var(--magma-accent-ai-emphasis,var(--variant-ai-04,126 73 245)));--mds-emoji-mia-head-color:rgb(var(--magma-accent-ai-surface-hover,var(--variant-ai-08,219 205 252)));--mds-emoji-mia-head-stroke-color:rgb(var(--magma-accent-ai-border,var(--variant-ai-06,184 156 250)));--mds-emoji-mia-head-stroke-width:0px;--mds-emoji-mia-mouth-color:rgb(var(--magma-accent-ai-emphasis,var(--variant-ai-04,126 73 245)));--mds-emoji-offset-eyes:1px;--mds-emoji-offset-gadget:1px;--mds-emoji-offset-hands:2px;--mds-emoji-offset-head:0;--mds-emoji-offset-mouth:1px;container-type:size}:host([name=simi]){--mds-emoji-offset-ears:0;--mds-emoji-offset-eyebrows:10px;--mds-emoji-offset-eyes:7px;--mds-emoji-offset-gadget:14px;--mds-emoji-offset-hands:18px;--mds-emoji-offset-head:5px;--mds-emoji-offset-mouth:16px;--mds-emoji-simi-eye-light:#fff;--mds-emoji-simi-eye:#40281b;--mds-emoji-simi-eyebrow:#feefd8;--mds-emoji-simi-gadget:#2b1c15;--mds-emoji-simi-mouth-teeth:#fff;--mds-emoji-simi-mouth-throat:#c3481b;--mds-emoji-simi-mouth:#2b1c15;--mds-emoji-simi-nose-light:#7e695f;--mds-emoji-simi-nose:#2b1c15;--mds-emoji-simi-outline:#2b1c15;--mds-emoji-simi-skin-dark:#c3481b;--mds-emoji-simi-skin-light:#feefd8;--mds-emoji-simi-skin:#f36320}"};var MdsEmoji=/** @class */function(){function e(e){var t=this;registerInstance(this,e);
|
|
705
|
+
var n=_propertyAliases[i];n&&n.indexOf(",")<0&&(i=n);return i in _transformProps&&i!==_transformOriginProp&&(t._gsap.x||_get(t,"x"))?r&&_recentSetterPlugin===r?i==="scale"?_setterScale:_setterTransform:(_recentSetterPlugin=r||{})&&(i==="scale"?_setterScaleWithRender:_setterTransformWithRender):t.style&&!_isUndefined(t.style[i])?_setterCSSStyle:~i.indexOf("-")?_setterCSSProp:_getSetter(t,i)},core:{_removeProperty:_removeProperty,_getMatrix:_getMatrix}};gsap.utils.checkPrefix=_checkPropPrefix;gsap.core.getStyleSaver=_getStyleSaver;(function(e,t,i,r){var n=_forEachName(e+","+t+","+i,(function(e){_transformProps[e]=1}));_forEachName(t,(function(e){_config.units[e]="deg";_rotationalProperties[e]=1}));_propertyAliases[n[13]]=e+","+t;_forEachName(r,(function(e){var t=e.split(":");_propertyAliases[t[1]]=n[t[0]]}))})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){_config.units[e]="px"}));gsap.registerPlugin(CSSPlugin);var gsapWithCSS=gsap.registerPlugin(CSSPlugin)||gsap;var miaSvg='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="head-default">\n <path id="border-head" d="M15.8188 3C16.5046 3.00015 17.141 3.36269 17.4986 3.95703L21.7112 10.957C22.0963 11.5972 22.0963 12.4028 21.7112 13.043L17.4986 20.043C17.141 20.6373 16.5046 20.9998 15.8188 21H8.18127C7.49525 21 6.85822 20.6375 6.50049 20.043L2.28892 13.043C1.90369 12.4027 1.90369 11.5973 2.28892 10.957L6.50049 3.95703C6.85822 3.36252 7.49525 3 8.18127 3H15.8188Z" stroke="var(--mds-emoji-mia-head-stroke-color, rgb(194 160 251))" stroke-width="var(--mds-emoji-mia-head-stroke-width, 2px)" fill="var(--mds-emoji-mia-head-stroke-color, rgb(194 160 251))"/>\n <path id="path-head" d="M15.8188 3C16.5046 3.00015 17.141 3.36269 17.4986 3.95703L21.7112 10.957C22.0963 11.5972 22.0963 12.4028 21.7112 13.043L17.4986 20.043C17.141 20.6373 16.5046 20.9998 15.8188 21H8.18127C7.49525 21 6.85822 20.6375 6.50049 20.043L2.28892 13.043C1.90369 12.4027 1.90369 11.5973 2.28892 10.957L6.50049 3.95703C6.85822 3.36252 7.49525 3 8.18127 3H15.8188Z" fill="var(--mds-emoji-mia-head-color, rgb(224 207 253))"/>\n </g>\n <g id="eyes-default">\n <path id="left-eye" d="M8 8H10V12H8V8Z" fill="var(--mds-emoji-mia-eyes-color, rgb(81 9 207))"/>\n <path id="right-eye" d="M14 8H16V12H14V8Z" fill="var(--mds-emoji-mia-eyes-color, rgb(81 9 207))"/>\n </g>\n <g id="eyes-closed" style="visibility:hidden;">\n <path id="left-eye-closed" d="M6 10H10V12H6V10Z" fill="var(--mds-emoji-mia-eyes-color, rgb(81 9 207))"/>\n <path id="right-eye-closed" d="M14 10H18V12H14V10Z" fill="var(--mds-emoji-mia-eyes-color, rgb(81 9 207))"/>\n </g>\n <path id="mouth-default" d="M16.707 15.707C15.4771 16.937 13.6985 17.5 12 17.5C10.3015 17.5 8.52294 16.937 7.29297 15.707L8.70703 14.293C9.47706 15.063 10.6985 15.5 12 15.5C13.3015 15.5 14.5229 15.063 15.293 14.293L16.707 15.707Z" fill="var(--mds-emoji-mia-mouth-color, rgb(98 12 245))"/>\n <path id="mouth-smile" style="visibility:hidden;" d="M16 14H8C8.33333 15.3333 9 18 12 18C15 18 15.6667 15.3333 16 14Z" fill="var(--mds-emoji-mia-mouth-color, rgb(98 12 245))"/>\n <path id="mouth-serious" style="visibility:hidden;" d="M8 15H16V17H8V15Z" fill="var(--mds-emoji-mia-mouth-color, rgb(98 12 245))"/>\n <path id="hand-think" style="visibility:hidden;" d="M6 16C6.55228 16 7 16.4477 7 17V18H13C13.5523 18 14 18.4477 14 19C14 19.5523 13.5523 20 13 20H10.3818C11.1252 20 11.6088 20.7824 11.2764 21.4473L10.2764 23.4473C10.107 23.786 9.76059 24 9.38184 24H4V20L5 18V16H6Z" fill="var(--mds-emoji-mia-hands-color, rgb(98 12 245))"/>\n</svg>\n';var simiSvg='<svg width="440" height="440" viewBox="0 0 440 440" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="ears-default">\n <g id="ear-right">\n <path id="ear-right-shape" fill="var(--mds-emoji-simi-skin, #F36320)" d="M363.838 54.3257C339.126 44.6171 278.031 90.7244 256.023 111.557C205.523 159.363 303.523 209.826 358.387 195.099C380.992 189.032 391.095 169.008 388.672 165.367C386.734 162.454 374.135 161.322 368.078 161.12C376.962 129.567 388.551 64.0342 363.838 54.3257Z"/>\n <path id="ear-right-inner-shape" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M351.676 53.2891C356.294 52.7076 360.415 52.9806 363.838 54.3252C364.658 54.6472 365.437 55.0331 366.178 55.4746C368.347 56.9073 370.299 58.8573 372.053 61.2344C385.423 81.3621 375.744 133.891 368.078 161.119C374.135 161.321 386.734 162.455 388.672 165.367C391.094 169.008 380.992 189.032 358.387 195.1C357.17 195.426 355.929 195.687 354.667 195.888C317.523 201.796 244.693 161.119 265.859 130.788C281.528 108.336 324.274 59.2313 351.676 53.2891Z"/>\n <path id="ear-right-hole" fill="var(--mds-emoji-simi-skin-dark, #C3481B)" d="M350.023 84.8079C329.105 90.1196 311.307 114.384 305.023 125.853C299.251 136.387 303.53 147.927 311.277 155C320.553 163.469 334.801 165.535 342.726 151.808C361.778 118.808 355.529 93.3915 350.023 84.8079Z"/>\n <path id="ear-right-outline-border" stroke="var(--mds-emoji-simi-skin-dark, #C3481B)" stroke-width="9" stroke-linecap="round" d="M363.838 54.3257C339.126 44.6171 278.031 90.7244 256.023 111.557C205.523 159.363 303.523 209.826 358.387 195.099C380.992 189.032 391.095 169.008 388.672 165.367C386.734 162.454 374.135 161.322 368.078 161.12C376.962 129.567 388.551 64.0342 363.838 54.3257Z"/>\n <path id="ear-right-border" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="7" stroke-linecap="round" d="M349.523 84.5C334.523 89 291.523 121 306.523 149"/>\n </g>\n <g id="ear-left">\n <path id="ear-left-shape" fill="var(--mds-emoji-simi-skin, #F36320)" d="M77.1852 54.3257C101.898 44.6171 162.993 90.7244 185 111.557C235.5 159.363 137.5 209.826 82.6365 195.099C60.0315 189.032 49.9287 169.008 52.3515 165.367C54.2897 162.454 66.8883 161.322 72.9453 161.12C64.0617 129.567 52.4726 64.0342 77.1852 54.3257Z"/>\n <path id="ear-left-inner-shape" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M89.3476 53.2891C84.7294 52.7076 80.6085 52.9806 77.1855 54.3252C76.3658 54.6472 75.5869 55.0331 74.8457 55.4746C72.6763 56.9073 70.7246 58.8573 68.9707 61.2344C55.6008 81.3621 65.2794 133.891 72.9453 161.119C66.8883 161.321 54.2898 162.455 52.3516 165.367C49.9291 169.008 60.0319 189.032 82.6367 195.1C83.8533 195.426 85.0943 195.687 86.3564 195.888C123.5 201.796 196.33 161.119 175.164 130.788C159.496 108.336 116.75 59.2313 89.3476 53.2891Z"/>\n <path id="ear-left-hole" fill="var(--mds-emoji-simi-skin-dark, #C3481B)" d="M91 84.8079C111.919 90.1196 129.716 114.384 136 125.853C141.772 136.387 137.494 147.927 129.747 155C120.471 163.469 106.223 165.535 98.2973 151.808C79.2451 118.808 85.494 93.3915 91 84.8079Z"/>\n <path id="ear-left-outline-border" stroke="var(--mds-emoji-simi-skin-dark, #C3481B)" stroke-width="9" stroke-linecap="round" d="M77.1852 54.3257C101.898 44.6171 162.993 90.7244 185 111.557C235.5 159.363 137.5 209.826 82.6365 195.099C60.0315 189.032 49.9287 169.008 52.3515 165.367C54.2897 162.454 66.8883 161.322 72.9453 161.12C64.0617 129.567 52.4726 64.0342 77.1852 54.3257Z"/>\n <path id="ear-left-border" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="7" stroke-linecap="round" d="M91.5 84.5C106.5 89 149.5 121 134.5 149"/>\n </g>\n </g>\n <g id="head-default">\n <path id="shape-head" fill="var(--mds-emoji-simi-skin, #F36320)" d="M378.732 217.557C340.98 122.357 268.622 107.557 219.909 107.557C171.197 107.557 98.8384 122.357 61.0863 217.557C50.181 245.057 52.6419 250.557 21.1818 271.057C19.6595 281.557 27.7783 295.057 42.4935 297.057C38.7724 298.224 30.5183 300.557 27.2708 300.557C23.2115 300.557 65.1456 387.557 219.909 387.557C374.673 387.557 416.789 300.057 412.729 300.057C409.482 300.057 401.228 297.724 397.507 296.557C412.222 294.557 420.34 281.057 418.818 270.557C387.358 250.057 389.637 245.057 378.732 217.557Z"/>\n <g id="ear-tufts">\n <g id="right-tuft">\n <path id="right-tuft-shape" fill="var(--mds-emoji-simi-skin, #F36320)" d="M336.411 123.628C333.005 118.799 313.911 124.433 304.789 127.853C295.789 132.254 282.34 139.697 296.289 146.057C313.289 153.808 342.492 168.294 342.492 153.808C343.708 143.547 331.749 140.126 326.681 139.321C331.343 136.102 339.816 128.457 336.411 123.628Z"/>\n <path id="right-tuft-outline" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="7" stroke-linecap="round" d="M304.789 127.853C313.911 124.433 333.005 118.799 336.411 123.628C339.816 128.457 331.343 136.102 326.681 139.321C331.749 140.126 343.708 143.547 342.492 153.808"/>\n </g>\n <g id="left-tuft">\n <path id="left-tuft-shape" fill="var(--mds-emoji-simi-skin, #F36320)" d="M104.167 122.628C107.573 117.799 126.667 123.433 135.789 126.853C144.789 131.254 158.239 138.697 144.289 145.057C127.289 152.808 98.0863 167.294 98.0863 152.808C96.8701 142.547 108.83 139.126 113.897 138.321C109.235 135.102 100.762 127.457 104.167 122.628Z"/>\n <path id="left-tuft-outline" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="7" stroke-linecap="round" d="M135.789 126.853C126.667 123.433 107.573 117.799 104.167 122.628C100.762 127.457 109.235 135.102 113.897 138.321C108.83 139.126 96.8701 142.547 98.0864 152.808"/>\n </g>\n </g>\n <g id="cheeks">\n <path id="right-cheek" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M380.5 290.057C364 262.557 340 266.355 318 279.057C344.5 305.557 344 327.557 330 361.557C384.8 341.157 386.5 305.39 380.5 290.057Z"/>\n <path id="left-cheek" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M59.3658 290.057C75.8658 262.557 99.8658 266.355 121.866 279.057C95.3658 305.557 95.8658 327.557 109.866 361.557C55.0658 341.157 53.3658 305.39 59.3658 290.057Z"/>\n </g>\n <path id="chin" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M220.5 372.557C256.675 372.557 286 352.186 286 327.057C286 301.928 256.675 260.557 220.5 260.557C184.325 260.557 155 301.928 155 327.057C155 352.186 184.325 372.557 220.5 372.557Z"/>\n </g>\n <g id="eyebrows-default">\n <path id="left-eyebrow" fill="var(--mds-emoji-simi-eyebrow, #FEEFD8)" d="M175.248 176.007C177.691 183.997 168.289 189.539 152.865 194.255C137.442 198.97 131.072 201.193 128.629 193.203C126.186 185.212 132.802 175.371 148.226 170.655C163.649 165.94 172.805 168.016 175.248 176.007Z"/>\n <path id="right-eyebrow" fill="var(--mds-emoji-simi-eyebrow, #FEEFD8)" d="M265.189 175.007C262.746 182.997 272.148 188.539 287.572 193.255C302.995 197.97 309.365 200.193 311.808 192.203C314.251 184.212 307.635 174.371 292.211 169.655C276.788 164.94 267.632 167.016 265.189 175.007Z"/>\n </g>\n <g id="eyes-default" style="transform-origin:50% 50%;">\n <g id="right-eye">\n <ellipse id="right-eye-inner-shape" fill="var(--mds-emoji-simi-eye, #40281B)" cx="287.002" cy="249.057" rx="18.5" ry="24.5" transform="rotate(12 287.002 249.057)"/>\n <circle id="right-eye-inner-light" fill="var(--mds-emoji-simi-eye-light, #FFFFFF)" cx="291" cy="242.557" r="6"/>\n </g>\n <g id="left-eye">\n <ellipse id="left-eye-inner-shape" fill="var(--mds-emoji-simi-eye, #40281B)" cx="18.5" cy="24.5" rx="18.5" ry="24.5" transform="matrix(-0.978148 0.207912 0.207912 0.978148 165.139 221.541)"/>\n <circle id="left-eye-inner-light" fill="var(--mds-emoji-simi-eye-light, #FFFFFF)" cx="6" cy="6" r="6" transform="matrix(-1 0 0 1 160.14 236.852)"/>\n </g>\n </g>\n <g id="eyes-closed" style="visibility: hidden;">\n <path id="left-eye-closed" stroke="var(--mds-emoji-simi-eye, #40281B)" stroke-width="12" stroke-linecap="round" d="M125 248.5C137.5 240.5 167.1 241.3 179.5 248.5"/>\n <path id="right-eye-closed" stroke="var(--mds-emoji-simi-eye, #40281B)" stroke-width="12" stroke-linecap="round" d="M315.5 248.5C303 240.5 273.4 241.3 261 248.5"/>\n </g>\n <g id="eyes-focused" style="visibility: hidden;">\n <g id="right-eye-focused">\n <ellipse id="right-eye-inner-shape-focused" fill="var(--mds-emoji-simi-eye, #40281B)" cx="287.002" cy="249.057" rx="18.5" ry="24.5" transform="rotate(-90 287.002 249.057)"/>\n <circle id="right-eye-inner-light-focused" fill="var(--mds-emoji-simi-eye-light, #FFFFFF)" cx="291" cy="242.557" r="6"/>\n </g>\n <g id="left-eye-focused">\n <ellipse id="left-eye-inner-shape-focused" fill="var(--mds-emoji-simi-eye, #40281B)" cx="18.5" cy="24.5" rx="18.5" ry="24.5" transform="matrix(-4.37114e-08 1 1 4.37114e-08 127.637 230.852)"/>\n <circle id="left-eye-inner-light-focused" fill="var(--mds-emoji-simi-eye-light, #FFFFFF)" cx="6" cy="6" r="6" transform="matrix(-1 0 0 1 160.14 236.852)"/>\n </g>\n </g>\n <path id="gadget-default" fill="var(--mds-emoji-simi-gadget, #2B1C15)" fill-rule="evenodd" clip-rule="evenodd" d="M296 186C327.723 186 353.88 209.825 357.557 240.558H367C370.314 240.558 373 243.244 373 246.558C373 249.871 370.314 252.558 367 252.558H357.834C355.501 284.671 328.709 310 296 310C262.189 310 234.7 282.936 234.014 249.289C230.711 246.983 225.885 245.558 220.5 245.558C215.114 245.558 210.288 246.983 206.985 249.289C206.299 282.936 178.811 310 145 310C112.291 310 85.4993 284.671 83.166 252.558H74C70.6864 252.558 68.0002 249.871 68 246.558C68 243.244 70.6863 240.558 74 240.558H83.4434C87.12 209.825 113.277 186 145 186C175.248 186 200.437 207.662 205.9 236.318C210.539 234.42 215.652 233.558 220.5 233.558C225.348 233.558 230.461 234.419 235.099 236.317C240.563 207.661 265.752 186 296 186ZM145 198C117.386 198 95 220.386 95 248C95 275.614 117.386 298 145 298C172.614 298 195 275.614 195 248C195 220.386 172.614 198 145 198ZM296 198C268.386 198 246 220.386 246 248C246 275.614 268.386 298 296 298C323.614 298 346 275.614 346 248C346 220.386 323.614 198 296 198Z"/>\n <g id="mouth-default">\n <path id="muzzle-shape-mouth-default" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M220.5 328.5C238.5 341 263 324.813 263 307.312C263 289.812 243.972 261 220.5 261C197.028 261 178 289.812 178 307.312C178 324.813 201 341 220.5 328.5Z"/>\n <path id="shape-mouth-mouth-default" fill="var(--mds-emoji-simi-mouth, #2B1C15)" d="M220 298.057C221.933 298.057 223.5 299.624 223.5 301.557V324.914C224.677 325.612 226.31 326.349 228.29 326.949C231.08 327.793 234.312 328.287 237.507 328.095C240.693 327.903 243.74 327.039 246.322 325.27C248.871 323.524 251.171 320.758 252.696 316.401C253.335 314.576 255.332 313.615 257.156 314.253C258.981 314.892 259.942 316.889 259.304 318.713C257.329 324.356 254.159 328.386 250.278 331.044C246.43 333.681 242.086 334.832 237.928 335.083C233.778 335.332 229.713 334.694 226.262 333.649C223.943 332.947 221.784 332.025 220 330.976C218.216 332.025 216.057 332.947 213.738 333.649C210.287 334.694 206.221 335.332 202.072 335.083C197.914 334.832 193.57 333.681 189.722 331.044C185.841 328.386 182.671 324.356 180.696 318.713C180.058 316.889 181.019 314.892 182.844 314.253C184.668 313.615 186.665 314.576 187.304 316.401C188.829 320.758 191.128 323.524 193.678 325.27C196.26 327.039 199.307 327.903 202.493 328.095C205.688 328.287 208.919 327.793 211.71 326.949C213.689 326.35 215.323 325.612 216.5 324.914V301.557C216.5 299.624 218.067 298.057 220 298.057Z"/>\n <g id="nose-mouth-default">\n <path id="node-shape-mouth-default" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M219.5 273.557C207.626 273.557 198 280.105 198 288.182C198 296.259 207.626 309.557 219.5 309.557C231.374 309.557 241 296.259 241 288.182C241 280.105 231.374 273.557 219.5 273.557Z"/>\n <ellipse id="nose-light-mouth-default" fill="var(--mds-emoji-simi-nose-light, #7E695F)" cx="220" cy="285.557" rx="11" ry="5"/>\n </g>\n </g>\n <g id="mouth-smile" style="visibility: hidden;">\n <g id="inner-mouth">\n <ellipse id="throat-mouth-smile" fill="var(--mds-emoji-simi-mouth-throat, #C3481B)" cx="220.5" cy="326" rx="32.5" ry="29" />\n <path id="teeth-mouth-smile" fill="var(--mds-emoji-simi-mouth-teeth, #FFFFFF)" d="M220.5 329C235.689 329 248.003 331.686 248.003 335C248.003 338.314 235.689 341 220.5 341C205.311 341 192.997 338.314 192.997 335C192.997 331.686 205.311 329 220.5 329Z"/>\n <path id="lips-mouth-smile" stroke="var(--mds-emoji-simi-nose, #2B1C15)" stroke-width="7" d="M220.5 300.5C236.62 300.5 249.5 313.138 249.5 328.5C249.5 343.862 236.62 356.5 220.5 356.5C204.38 356.5 191.5 343.862 191.5 328.5C191.5 313.138 204.38 300.5 220.5 300.5Z" />\n </g>\n <path id="muzzle-shape-mouth-smile" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M220.5 328.5C238.5 341 263 324.813 263 307.312C263 289.812 243.972 261 220.5 261C197.028 261 178 289.812 178 307.312C178 324.813 201 341 220.5 328.5Z"/>\n <path id="shape-mouth-smile" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M220 298.057C221.933 298.057 223.5 299.624 223.5 301.557V324.914C224.677 325.612 226.31 326.349 228.29 326.949C231.08 327.793 234.312 328.287 237.507 328.095C240.693 327.903 243.74 327.039 246.322 325.27C248.871 323.524 251.171 320.758 252.696 316.401C253.335 314.576 255.332 313.615 257.156 314.253C258.981 314.892 259.942 316.889 259.304 318.713C257.329 324.356 254.159 328.386 250.278 331.044C246.43 333.681 242.086 334.832 237.928 335.083C233.778 335.332 229.713 334.694 226.262 333.649C223.943 332.947 221.784 332.025 220 330.976C218.216 332.025 216.057 332.947 213.738 333.649C210.287 334.694 206.221 335.332 202.072 335.083C197.914 334.832 193.57 333.681 189.722 331.044C185.841 328.386 182.671 324.356 180.696 318.713C180.058 316.889 181.019 314.892 182.844 314.253C184.668 313.615 186.665 314.576 187.304 316.401C188.829 320.758 191.128 323.524 193.678 325.27C196.26 327.039 199.307 327.903 202.493 328.095C205.688 328.287 208.919 327.793 211.71 326.949C213.689 326.35 215.323 325.612 216.5 324.914V301.557C216.5 299.624 218.067 298.057 220 298.057Z"/>\n <g id="nose-mouth-smile">\n <path id="nose-shape-mouth-smile" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M219.5 273.557C207.626 273.557 198 280.105 198 288.182C198 296.259 207.626 309.557 219.5 309.557C231.374 309.557 241 296.259 241 288.182C241 280.105 231.374 273.557 219.5 273.557Z"/>\n <ellipse id="nose-light-mouth-smile" fill="var(--mds-emoji-simi-nose-light, #7E695F)" cx="220" cy="285.557" rx="11" ry="5"/>\n </g>\n </g>\n <g id="mouth-serious" style="visibility: hidden;">\n <path id="muzzle-shape-mouth-serious" fill="var(--mds-emoji-simi-skin-light, #FEEFD8)" d="M220.5 328.5C238.5 341 263 324.813 263 307.312C263 289.812 243.972 261 220.5 261C197.028 261 178 289.812 178 307.312C178 324.813 201 341 220.5 328.5Z"/>\n <path id="shape-mouth-serious" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M220 298C221.933 298 223.5 299.567 223.5 301.5V326.675C224.663 326.774 225.818 326.903 226.821 327.026C227.869 327.155 228.796 327.283 229.462 327.38C229.795 327.428 230.064 327.469 230.251 327.497C230.344 327.511 230.418 327.522 230.469 327.53C230.494 327.534 230.514 327.538 230.527 327.54C230.534 327.541 230.539 327.541 230.543 327.542C230.545 327.542 230.547 327.543 230.548 327.543H230.55C232.459 327.847 233.76 329.641 233.456 331.55C233.152 333.459 231.359 334.76 229.45 334.456C229.45 334.456 229.448 334.456 229.447 334.456C229.445 334.456 229.441 334.455 229.436 334.454C229.426 334.452 229.41 334.451 229.389 334.447C229.345 334.441 229.28 334.43 229.194 334.417C229.023 334.391 228.772 334.353 228.458 334.308C227.83 334.217 226.954 334.095 225.968 333.974C223.947 333.725 221.629 333.5 220 333.5C218.371 333.5 216.053 333.725 214.032 333.974C213.046 334.095 212.17 334.217 211.542 334.308C211.228 334.353 210.977 334.391 210.806 334.417C210.72 334.43 210.655 334.441 210.611 334.447C210.59 334.451 210.574 334.452 210.563 334.454C210.559 334.455 210.555 334.456 210.553 334.456C210.552 334.456 210.55 334.456 210.55 334.456C208.641 334.76 206.848 333.459 206.544 331.55C206.24 329.641 207.541 327.848 209.45 327.544L209.452 327.543C209.453 327.543 209.455 327.542 209.457 327.542C209.461 327.541 209.466 327.541 209.473 327.54C209.486 327.538 209.506 327.534 209.531 327.53C209.582 327.522 209.656 327.511 209.749 327.497C209.936 327.469 210.205 327.428 210.538 327.38C211.204 327.283 212.131 327.155 213.179 327.026C214.182 326.903 215.337 326.774 216.5 326.675V301.5C216.5 299.567 218.067 298 220 298Z" />\n <g id="nose-mouth-serious">\n <path id="nose-shape-mouth-serious" fill="var(--mds-emoji-simi-nose, #2B1C15)" d="M219.5 273.557C207.626 273.557 198 280.105 198 288.182C198 296.259 207.626 309.557 219.5 309.557C231.374 309.557 241 296.259 241 288.182C241 280.105 231.374 273.557 219.5 273.557Z"/>\n <ellipse id="nose-light-mouth-serious" fill="var(--mds-emoji-simi-nose-light, #7E695F)" cx="220" cy="285.557" rx="11" ry="5"/>\n </g>\n </g>\n <g id="hand-think" style="visibility: hidden;">\n <path id="shape-hand-think" fill="var(--mds-emoji-simi-skin, #F36320)" d="M237.5 438C238.5 435 241 428.5 243.5 421.5C257.989 413.451 258.739 397.302 255.5 383.467C278 367.934 263.5 350 255.5 350C251.5 340.4 242.5 339 238.5 339.5C244.5 324 233 323.5 229 323.5C225 323.5 202.5 323 189 351C183.4 374.6 195 400.833 201.5 411C200.667 411.5 199 414.5 195.5 420C211 426.5 204 423.5 237.5 438Z" />\n <path id="palm-hand-think" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="6" d="M251 369C267 409.5 249.5 416.5 242 423.5L236.5 437.5"/>\n <path id="finger-3-hand-think" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="6" d="M256 382.5C262.5 379.333 273.7 370.1 266.5 358.5C257.5 344 234 360 230 363"/>\n <path id="finger-2-hand-think" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="6" d="M256 350.5C256 338 236.1 329.9 208.5 357.5"/>\n <path id="finger-1-hand-think" stroke="var(--mds-emoji-simi-outline, #2B1C15)" stroke-width="6" d="M196.5 420.5L201.5 410.5C195.167 400 183.8 373.6 189 352C194.2 330.4 218.833 323.667 230.5 323C235.333 322.5 243.9 325.1 239.5 339.5"/>\n </g>\n</svg>\n';var mdsEmojiCss=function(){return"@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-emoji-expression-follow-mouse-traits-duration:.2s;--mds-emoji-expression-follow-mouse-head-duration:.3s;--mds-emoji-expression-max-rotation:16deg;--mds-emoji-perspective:400px;align-items:stretch;aspect-ratio:1;display:flex;height:calc(var(--spacing,.0025rem)*1200);justify-content:stretch;perspective:var(--mds-emoji-perspective,400px);perspective-origin:50%;width:calc(var(--spacing,.0025rem)*1200)}svg{height:100%;overflow:visible;transform-style:preserve-3d;transition:transform .2s ease-out;width:100%}:host([name=mia]){--mds-emoji-mia-eyes-color:rgb(var(--magma-accent-ai-emphasis-hover,var(--variant-ai-03,87 20 242)));--mds-emoji-mia-hands-color:rgb(var(--magma-accent-ai-emphasis,var(--variant-ai-04,126 73 245)));--mds-emoji-mia-head-color:rgb(var(--magma-accent-ai-surface-hover,var(--variant-ai-08,219 205 252)));--mds-emoji-mia-head-stroke-color:rgb(var(--magma-accent-ai-border,var(--variant-ai-06,184 156 250)));--mds-emoji-mia-head-stroke-width:0px;--mds-emoji-mia-mouth-color:rgb(var(--magma-accent-ai-emphasis,var(--variant-ai-04,126 73 245)));--mds-emoji-offset-eyes:1px;--mds-emoji-offset-gadget:1px;--mds-emoji-offset-hands:2px;--mds-emoji-offset-head:0;--mds-emoji-offset-mouth:1px;container-type:size}:host([name=simi]){--mds-emoji-offset-ears:0;--mds-emoji-offset-eyebrows:10px;--mds-emoji-offset-eyes:7px;--mds-emoji-offset-gadget:14px;--mds-emoji-offset-hands:18px;--mds-emoji-offset-head:5px;--mds-emoji-offset-mouth:16px;--mds-emoji-simi-eye-light:#fff;--mds-emoji-simi-eye:#40281b;--mds-emoji-simi-eyebrow:#feefd8;--mds-emoji-simi-gadget:#2b1c15;--mds-emoji-simi-mouth-teeth:#fff;--mds-emoji-simi-mouth-throat:#c3481b;--mds-emoji-simi-mouth:#2b1c15;--mds-emoji-simi-nose-light:#7e695f;--mds-emoji-simi-nose:#2b1c15;--mds-emoji-simi-outline:#2b1c15;--mds-emoji-simi-skin-dark:#c3481b;--mds-emoji-simi-skin-light:#feefd8;--mds-emoji-simi-skin:#f36320}"};var MdsEmoji=/** @class */function(){function e(e){var t=this;registerInstance(this,e);
|
|
706
706
|
/**
|
|
707
707
|
* Specifies which emoji to display.
|
|
708
708
|
*/this.name="mia";this.isFollowingMouse=false;this.isBusy=false;this.isSmiling=false;this.isAgreeing=false;this.isThinking=false;this.isBlinking=false;this.isDisagreeing=false;
|
|
@@ -719,14 +719,23 @@ this.expressionAnimations=[];
|
|
|
719
719
|
// How far the thinking hand slides in and out, as a share of its own size: a
|
|
720
720
|
// viewBox independent value, so the gesture reads the same on Mia (24 units) and
|
|
721
721
|
// on Simi (440 units).
|
|
722
|
-
this.handEntryOffset=25;this.wasFollowingMouse=false;this.wasBlinking=false;this.headOffsetX=0;this.headOffsetY=0;this.headOffset=0;this.eyesOffsetX=0;this.eyesOffsetY=0;this.eyesOffset=1;this.mouthOffsetX=0;this.mouthOffsetY=0;this.mouthOffset=1;this.handOffsetX=0;this.handOffsetY=0;this.handOffset=2;this.gadgetOffsetX=0;this.gadgetOffsetY=0;this.gadgetOffset=2;this.eyebrowsOffsetX=0;this.eyebrowsOffsetY=0;this.eyebrowsOffset=2;this.earsOffsetX=0;this.earsOffsetY=0;this.earsOffset=2;this.mouseX=0;this.mouseY=0;this.currentRotateX=0;this.currentRotateY=0;
|
|
722
|
+
this.handEntryOffset=25;this.wasFollowingMouse=false;this.wasBlinking=false;this.headOffsetX=0;this.headOffsetY=0;this.headOffset=0;this.eyesOffsetX=0;this.eyesOffsetY=0;this.eyesOffset=1;this.mouthOffsetX=0;this.mouthOffsetY=0;this.mouthOffset=1;this.handOffsetX=0;this.handOffsetY=0;this.handOffset=2;this.gadgetOffsetX=0;this.gadgetOffsetY=0;this.gadgetOffset=2;this.eyebrowsOffsetX=0;this.eyebrowsOffsetY=0;this.eyebrowsOffset=2;this.earsOffsetX=0;this.earsOffsetY=0;this.earsOffset=2;this.mouseX=0;this.mouseY=0;this.currentRotateX=0;this.currentRotateY=0;
|
|
723
|
+
// Whether the values below come from the computed style. They are read lazily
|
|
724
|
+
// by rotate until it is available: see updateCSSCustomProps.
|
|
725
|
+
this.cssCustomPropsRead=false;this.expressionAngleMax=16;// massimo angolo di rotazione della emoji
|
|
723
726
|
this.expressionFollowMouseHeadDuration=.3;// durata dell'animazione di rotazione della testa quando segue il mouse
|
|
724
727
|
this.expressionFollowMouseTraitsDuration=.2;// durata dell'animazione di rotazione degli occhi e della bocca quando segue il mouse
|
|
725
728
|
this.blinkTimeline=null;this.blinkDelay=null;this.svgLibrary={mia:miaSvg,simi:simiSvg};
|
|
726
729
|
/**
|
|
727
730
|
* Stops the tracking and recentres the face, keeping whether it was on: an expression pauses
|
|
728
731
|
* it this way and restoreFollowMouse resumes it when the expression ends.
|
|
729
|
-
*/this.pauseFollowMouse=function(){if(!t.isFollowingMouse)return Promise.resolve();t.isFollowingMouse=false;t.rotate(0,0);return new Promise((function(e){return setTimeout(e,t.expressionFollowMouseTraitsDuration*1e3)}))};this.isEmojiName=function(e){return e!=null&&{}.hasOwnProperty.call(t.svgLibrary,e)};this.updateCSSCustomProps=function(){if(typeof window==="undefined")return;var e=window.getComputedStyle(t.host);
|
|
732
|
+
*/this.pauseFollowMouse=function(){if(!t.isFollowingMouse)return Promise.resolve();t.isFollowingMouse=false;t.rotate(0,0);return new Promise((function(e){return setTimeout(e,t.expressionFollowMouseTraitsDuration*1e3)}))};this.isEmojiName=function(e){return e!=null&&{}.hasOwnProperty.call(t.svgLibrary,e)};this.updateCSSCustomProps=function(){if(typeof window==="undefined")return;var e=window.getComputedStyle(t.host);
|
|
733
|
+
// Stencil loads children before their parents, so a slotted emoji reaches
|
|
734
|
+
// componentDidLoad while its host's shadow DOM has not rendered the slot yet.
|
|
735
|
+
// Outside the flat tree the computed style is empty, every value fell back and
|
|
736
|
+
// the durations became 1000 seconds: the head took minutes to follow the
|
|
737
|
+
// pointer. Keep the current values and let rotate read them again later.
|
|
738
|
+
if(e.display===""){t.cssCustomPropsRead=false;return}t.cssCustomPropsRead=true;t.expressionAngleMax=cssRotationToNumber(e.getPropertyValue("--mds-emoji-expression-max-rotation"),16);t.expressionFollowMouseHeadDuration=cssDurationToSeconds(e.getPropertyValue("--mds-emoji-expression-follow-mouse-head-duration"),.3);t.expressionFollowMouseTraitsDuration=cssDurationToSeconds(e.getPropertyValue("--mds-emoji-expression-follow-mouse-traits-duration"),.2);t.headOffset=cssSizeToNumber(e.getPropertyValue("--mds-emoji-offset-head"),1);t.eyesOffset=cssSizeToNumber(e.getPropertyValue("--mds-emoji-offset-eyes"),1);t.mouthOffset=cssSizeToNumber(e.getPropertyValue("--mds-emoji-offset-mouth"),1);t.handOffset=cssSizeToNumber(e.getPropertyValue("--mds-emoji-offset-hands"),1);t.gadgetOffset=cssSizeToNumber(e.getPropertyValue("--mds-emoji-offset-gadget"),1);t.eyebrowsOffset=cssSizeToNumber(e.getPropertyValue("--mds-emoji-offset-eyebrows"),1);t.earsOffset=cssSizeToNumber(e.getPropertyValue("--mds-emoji-offset-ears"),1)};this.updateSvgDictionary=function(e){if(typeof window==="undefined")return;var i=document.createElement("template");i.innerHTML=t.svgLibrary[e].trim();t.svgRootEl=i.content.firstElementChild;t.updateCSSCustomProps();
|
|
730
739
|
// The shadow DOM is fully replaced, so every cached node/setter/timeline now
|
|
731
740
|
// points at detached elements: drop them so they rebuild against the new SVG.
|
|
732
741
|
t.resetAnimationState();if(t.host.shadowRoot)t.host.shadowRoot.innerHTML=t.svgRootEl.outerHTML;if(t.isBlinking){t.blinkTimeline=t.buildBlinkTimeline();t.scheduleBlink()}
|
|
@@ -745,12 +754,12 @@ t.resetAnimationState();if(t.host.shadowRoot)t.host.shadowRoot.innerHTML=t.svgRo
|
|
|
745
754
|
// Build.isBrowser, which the hydrate build compiles to false. Without it the
|
|
746
755
|
// prerender of every mds-emoji dies inside GSAP's CSSPlugin, which reads a null
|
|
747
756
|
// computed transform from mock-doc (check.ssr).
|
|
748
|
-
if(!Build.isBrowser)return;t.resetEyesToDefault();if(t.isFollowingMouse){t.moveHead(t.mouseX,t.mouseY)}else{var
|
|
757
|
+
if(!Build.isBrowser)return;t.resetEyesToDefault();if(t.isFollowingMouse){t.moveHead(t.mouseX,t.mouseY)}else{var r=t.getEmojiCenter(),n=r.centerX,s=r.centerY;t.moveHead(n,s)}
|
|
749
758
|
// A face swapped while the emoji is thinking has to arrive already thinking:
|
|
750
759
|
// the hand and the focused eyes belong to the state, not to the SVG that is
|
|
751
760
|
// leaving, so they are put back in place at once, without replaying the
|
|
752
761
|
// entrance on a face that is only now appearing.
|
|
753
|
-
if(t.isThinking)t.setStartThinkingAnimation(0)};this.resetAnimationState=function(){var e,i;t.killExpressionAnimations();(e=t.blinkDelay)===null||e===void 0?void 0:e.kill();t.blinkDelay=null;(i=t.blinkTimeline)===null||i===void 0?void 0:i.kill();t.blinkTimeline=null;t.headEl=null;t.eyesEl=null;t.handEl=null;t.mouthEl=null;t.gadgetEl=null;t.eyebrowsEl=null;t.earsEl=null};this.queryPart=function(e){var i,n
|
|
762
|
+
if(t.isThinking)t.setStartThinkingAnimation(0)};this.resetAnimationState=function(){var e,i;t.killExpressionAnimations();(e=t.blinkDelay)===null||e===void 0?void 0:e.kill();t.blinkDelay=null;(i=t.blinkTimeline)===null||i===void 0?void 0:i.kill();t.blinkTimeline=null;t.headEl=null;t.eyesEl=null;t.handEl=null;t.mouthEl=null;t.gadgetEl=null;t.eyebrowsEl=null;t.earsEl=null};this.queryPart=function(e){var i,r,n;return(n=(r=(i=t.host.shadowRoot)===null||i===void 0?void 0:i.firstElementChild)===null||r===void 0?void 0:r.querySelector("[id='".concat(e,"']")))!==null&&n!==void 0?n:null};this.resetEyesToDefault=function(){t.svgPartState("eyes","default");var e=t.queryPart("eyes-default");if(e)gsapWithCSS.set(e,{scaleY:1})};this.getEmojiCenter=function(){var e=t.host.getBoundingClientRect();return{centerX:e.left+e.width/2,centerY:e.top+e.height/2}};
|
|
754
763
|
// Takes the face over for a new expression: whatever was playing is stopped, the
|
|
755
764
|
// traits go back to their rest pose and the token that identifies the new owner
|
|
756
765
|
// is returned.
|
|
@@ -769,14 +778,14 @@ this.hideThinkingHand=function(e){var i=t.handEl instanceof NodeList?null:t.hand
|
|
|
769
778
|
// No overwrite is needed on either branch: every caller kills the tracked
|
|
770
779
|
// expression animations first, and rotate() drives the hand on the translation
|
|
771
780
|
// channel, which neither of these values touches.
|
|
772
|
-
var
|
|
781
|
+
var r={scale:0,rotateZ:45,xPercent:-t.handEntryOffset,yPercent:t.handEntryOffset};if(!e){gsapWithCSS.set(i,r);i.style.visibility="hidden";return}t.trackExpression(gsapWithCSS.to(i,Object.assign(Object.assign({},r),{ease:"expo.inOut",duration:e,onComplete:function(){i.style.visibility="hidden"}})))};this.restoreReadyState=function(e){
|
|
773
782
|
// A superseded expression never hands the face back: its timeline may still be
|
|
774
783
|
// running when another one has already taken ownership.
|
|
775
784
|
if(!t.isCurrentExpression(e))return;t.isBusy=false;t.restoreFollowMouse();t.scheduleBlink()};this.restoreFollowMouse=function(){if(t.wasFollowingMouse){t.moveHead(t.mouseX,t.mouseY);t.startFollowMouse();return}
|
|
776
785
|
// Never followed the pointer: stay centred on the viewer. This used to run
|
|
777
786
|
// unconditionally, right after startFollowMouse, so it immediately undid the
|
|
778
787
|
// restore and snapped the head back to centre until the next mouse move.
|
|
779
|
-
var e=t.getEmojiCenter(),i=e.centerX,
|
|
788
|
+
var e=t.getEmojiCenter(),i=e.centerX,r=e.centerY;t.moveHead(i,r)};this.stopConcurrentAnimations=function(){
|
|
780
789
|
// An expression owns the whole face: smile, agree, disagree and think must not
|
|
781
790
|
// play while the traits are still offset toward the last pointer position, so
|
|
782
791
|
// stop tracking and bring the emoji back to centre, where it looks straight at
|
|
@@ -796,7 +805,7 @@ var e=t.isThinking;t.isThinking=false;t.pauseBlinking();t.killExpressionAnimatio
|
|
|
796
805
|
// halfway through, which is what left the eyes and the hand offset toward the
|
|
797
806
|
// pointer for as long as the expression lasted. The head keeps its eased
|
|
798
807
|
// rotation, the only part of the re-centring big enough to be seen.
|
|
799
|
-
var i=t.getEmojiCenter(),
|
|
808
|
+
var i=t.getEmojiCenter(),r=i.centerX,n=i.centerY;t.moveHead(r,n,true);
|
|
800
809
|
// The hand does not blink out of existence when an expression interrupts the
|
|
801
810
|
// thinking: it is pulled away over the opening of the animation taking over.
|
|
802
811
|
t.hideThinkingHand(e?.25:0)};
|
|
@@ -805,40 +814,40 @@ t.hideThinkingHand(e?.25:0)};
|
|
|
805
814
|
* smiling mouth, closed eyes) stay for as long as the animation would have lasted, then the
|
|
806
815
|
* face is handed back. The head, the eyebrows and the bounces keep still, as the blinking and
|
|
807
816
|
* the following of the pointer do by not running at all.
|
|
808
|
-
*/this.holdStillExpression=function(e,i,
|
|
817
|
+
*/this.holdStillExpression=function(e,i,r){i.forEach((function(e){var i=e[0],r=e[1];return t.svgPartState(i,r)}));t.trackExpression(gsapWithCSS.delayedCall(r/1e3,(function(){i.forEach((function(e){var i=e[0];return t.svgPartState(i)}));t.restoreReadyState(e)})));return new Promise((function(e){return setTimeout(e,r)}))};this.setAgreeAnimation=function(e){var i=1780;if(prefersReducedMotion())return t.holdStillExpression(e,[["mouth","smile"]],i);var r="expo.out";var n="auto";var s={value:0};
|
|
809
818
|
// head movement
|
|
810
|
-
var o=gsapWithCSS.timeline({defaults:{ease:
|
|
819
|
+
var o=gsapWithCSS.timeline({defaults:{ease:r,overwrite:n},onComplete:function(){t.restoreReadyState(e)}}).to(s,{value:0,duration:.08,onUpdate:function(){t.rotate(0,s.value)}}).to(s,{value:-100,duration:.24,onUpdate:function(){t.rotate(0,s.value)}}).to(s,{value:50,duration:.18,onUpdate:function(){t.rotate(0,s.value)}}).to(s,{value:-25,duration:.12,onUpdate:function(){t.rotate(0,s.value)}}).to(s,{value:0,duration:.16,onUpdate:function(){t.rotate(0,s.value)}});t.trackExpression(o);
|
|
811
820
|
// eyebrows
|
|
812
821
|
if(t.eyebrowsEl){var a=gsapWithCSS.timeline({defaults:{ease:"expo.out",overwrite:"auto"},onComplete:function(){a.reverse()}}).to(t.eyebrowsEl,{yPercent:-40,duration:.4});t.trackExpression(a)}
|
|
813
822
|
// mouth
|
|
814
|
-
t.svgPartState("mouth","smile");t.trackExpression(gsapWithCSS.timeline({defaults:{ease:
|
|
823
|
+
t.svgPartState("mouth","smile");t.trackExpression(gsapWithCSS.timeline({defaults:{ease:r,overwrite:n},onComplete:function(){t.svgPartState("mouth","default")}}).to(t.mouthEl,{scaleY:1.2,duration:.2}).to(t.mouthEl,{scaleY:1,duration:.2}));return new Promise((function(e){return setTimeout(e,i)}))};this.setSmileAnimation=function(e){var i=750;if(prefersReducedMotion()){return t.holdStillExpression(e,[["mouth","smile"],["eyes","closed"]],i)}var r="expo.out";var n="auto";
|
|
815
824
|
// mouth
|
|
816
|
-
t.svgPartState("mouth","smile");t.trackExpression(gsapWithCSS.timeline({defaults:{ease:
|
|
825
|
+
t.svgPartState("mouth","smile");t.trackExpression(gsapWithCSS.timeline({defaults:{ease:r,overwrite:n},onComplete:function(){t.svgPartState("mouth","default")}}).to(t.mouthEl,{scaleY:1,duration:.15}).to(t.mouthEl,{scaleY:.75,duration:.15}).to(t.mouthEl,{scaleY:1,duration:.15}).to(t.mouthEl,{scaleY:.75,duration:.15}).to(t.mouthEl,{scaleY:1,duration:.15}));
|
|
817
826
|
// eyes
|
|
818
|
-
t.svgPartState("eyes","closed");var s=gsapWithCSS.timeline({defaults:{ease:
|
|
827
|
+
t.svgPartState("eyes","closed");var s=gsapWithCSS.timeline({defaults:{ease:r,duration:.25,overwrite:n},onComplete:function(){s.to(t.eyesEl,{yPercent:0,onComplete:function(){t.svgPartState("eyes")}})}}).to(t.eyesEl,{yPercent:-20}).to(t.eyesEl,{yPercent:10});t.trackExpression(s);
|
|
819
828
|
// eyebrows
|
|
820
|
-
if(t.eyebrowsEl){t.trackExpression(gsapWithCSS.timeline({defaults:{ease:
|
|
829
|
+
if(t.eyebrowsEl){t.trackExpression(gsapWithCSS.timeline({defaults:{ease:r,overwrite:n}}).to(t.eyebrowsEl,{yPercent:"-=15",duration:.15}).to(t.eyebrowsEl,{yPercent:"+=10",duration:.15}))}
|
|
821
830
|
// emoji
|
|
822
|
-
var o=gsapWithCSS.timeline({defaults:{overwrite:
|
|
831
|
+
var o=gsapWithCSS.timeline({defaults:{overwrite:n},onComplete:function(){t.svgPartState("mouth","default");t.restoreReadyState(e)}}).to(t.host,{yPercent:"-=".concat(t.host.getBoundingClientRect().height/10),scaleX:.95,duration:1,ease:"elastic.out"}).to(t.host,{yPercent:"+=".concat(t.host.getBoundingClientRect().height/10),scaleX:1,duration:.75,ease:"expo.out"});t.trackExpression(o);return new Promise((function(e){return setTimeout(e,i)}))};this.setDisagreeAnimation=function(e,i){if(e===void 0){e=0}if(prefersReducedMotion()){return t.holdStillExpression(i,[["mouth","serious"]],780+e)}var r={value:0};var n=gsapWithCSS.timeline({ease:"power2.inOut",onStart:function(){t.svgPartState("mouth","serious")},onComplete:function(){if(e>0){
|
|
823
832
|
// Tracked like every other step: an expression asked for while the
|
|
824
833
|
// emoji is still frowning has to cancel the pending smile too.
|
|
825
|
-
t.trackExpression(gsapWithCSS.delayedCall(e/1e3,(function(){t.svgPartState("mouth","default");t.restoreReadyState(i)})));return}t.svgPartState("mouth","default");t.restoreReadyState(i)}}).to(
|
|
834
|
+
t.trackExpression(gsapWithCSS.delayedCall(e/1e3,(function(){t.svgPartState("mouth","default");t.restoreReadyState(i)})));return}t.svgPartState("mouth","default");t.restoreReadyState(i)}}).to(r,{value:0,duration:.08,onUpdate:function(){t.rotate(r.value,0)}}).to(r,{value:-100,duration:.24,onUpdate:function(){t.rotate(r.value,0)}}).to(r,{value:50,duration:.18,onUpdate:function(){t.rotate(r.value,0)}}).to(r,{value:-25,duration:.12,onUpdate:function(){t.rotate(r.value,0)}}).to(r,{value:0,duration:.16,onUpdate:function(){t.rotate(r.value,0)}});t.trackExpression(n);return new Promise((function(t){return setTimeout(t,780+e)}))};this.setStartThinkingAnimation=function(e){if(e===void 0){e=.5}var i="expo.inOut";var r=t.handEl instanceof NodeList?null:t.handEl;
|
|
826
835
|
// under reduced motion the hand is simply there, and the eyes do not wander
|
|
827
|
-
var
|
|
836
|
+
var n=prefersReducedMotion();if(r&&n){gsapWithCSS.set(r,{xPercent:0,yPercent:0,scale:1,rotateZ:0});r.style.visibility="visible"}else if(r){r.style.visibility="visible";
|
|
828
837
|
// Only the percentage channel is animated, because rotate() owns the
|
|
829
838
|
// translation one. The hand therefore lands exactly where the SVG draws it,
|
|
830
839
|
// instead of keeping the offset it was carrying toward the pointer, and its
|
|
831
840
|
// entrance mirrors its exit: the two used to move it on different channels,
|
|
832
841
|
// with an amount scaled by the viewBox, so the leftover of one showed up as a
|
|
833
842
|
// displaced hand at the beginning of the next.
|
|
834
|
-
t.trackExpression(gsapWithCSS.fromTo(
|
|
843
|
+
t.trackExpression(gsapWithCSS.fromTo(r,{scale:0,rotateZ:45,xPercent:-t.handEntryOffset,yPercent:t.handEntryOffset},{xPercent:0,yPercent:0,scale:1,rotateZ:0,ease:i,duration:e,overwrite:"auto"}))}if(!n)t.moveEyesThinkAnimation();t.svgPartState("mouth","serious");t.svgPartState("eyes","focused");
|
|
835
844
|
// Settles even when there is no hand to show: an unresolved promise used to
|
|
836
845
|
// leave every caller awaiting startThinking hanging for good.
|
|
837
846
|
return new Promise((function(t){return setTimeout(t,e*1e3)}))};this.moveEyesThinkAnimation=function(){if(!t.eyesEl||!t.isThinking)return;var e=gsapWithCSS.utils.random(.15,.3,.01,true)();var i="expo.out";
|
|
838
847
|
// 'auto' and not true: the eyes also carry the translation tween of rotate(),
|
|
839
848
|
// and killing that one outright is what left them looking toward the pointer,
|
|
840
849
|
// off centre, for the whole time the emoji was thinking.
|
|
841
|
-
var
|
|
850
|
+
var r={duration:e,ease:i,overwrite:"auto"};var n=5;var s=gsapWithCSS.utils.random(n*-1,n,.1);var o=gsapWithCSS.utils.random(n*-1,n,.1);t.trackExpression(gsapWithCSS.to(t.eyesEl,Object.assign(Object.assign({xPercent:s,yPercent:o},r),{onComplete:function(){
|
|
842
851
|
// Nothing to reset when the state is over: the exit animation, or the
|
|
843
852
|
// take-over of another expression, has already put the eyes back.
|
|
844
853
|
if(!t.isThinking)return;var e=gsapWithCSS.utils.random(.2,.7,.1);t.trackExpression(gsapWithCSS.delayedCall(e,t.moveEyesThinkAnimation))}})))};this.setStopThinkingAnimation=function(e){if(e===void 0){e=.5}
|
|
@@ -847,7 +856,7 @@ var i=prefersReducedMotion()?0:e;t.hideThinkingHand(i);if(t.eyesEl){t.trackExpre
|
|
|
847
856
|
// A single, reusable blink sequence. Built once and replayed via restart(),
|
|
848
857
|
// it never grows over time and is fully controlled by play/pause, unlike the
|
|
849
858
|
// previous recursive chain that died permanently the moment isBusy was set.
|
|
850
|
-
this.buildBlinkTimeline=function(){var e=t.queryPart("eyes-default");var i=t.queryPart("eyes-closed");if(!e||!i)return null;var
|
|
859
|
+
this.buildBlinkTimeline=function(){var e=t.queryPart("eyes-default");var i=t.queryPart("eyes-closed");if(!e||!i)return null;var r={ease:"expo.in",duration:.2};var n={ease:"expo.out",duration:.2};return gsapWithCSS.timeline({paused:true,onComplete:t.scheduleBlink}).to(e,Object.assign({scaleY:.5},r)).add((function(){t.svgPartState("eyes","closed")})).fromTo(i,{scaleY:.5},Object.assign({scaleY:1},n)).add((function(){t.svgPartState("eyes","default")})).fromTo(e,{scaleY:.75},Object.assign({scaleY:1},n))};
|
|
851
860
|
// Queues the next blink after a random idle delay. Gated on the blinking
|
|
852
861
|
// intent and isBusy, so it is a no-op while another animation owns the eyes
|
|
853
862
|
// and is simply called again once that animation finishes.
|
|
@@ -865,22 +874,33 @@ t.resetEyesToDefault()};this.handleFollowMouse=function(e){
|
|
|
865
874
|
t.mouseX=e.clientX;t.mouseY=e.clientY;if(!t.isFollowingMouse)return;t.followMouse()};this.followMouse=function(){
|
|
866
875
|
// Reduced motion keeps the face still; stopFollowMouse still recentres it, because
|
|
867
876
|
// that is a state the caller asked for rather than an animation of its own.
|
|
868
|
-
if(prefersReducedMotion())return;if(t.isFollowingMouse){t.moveHead(t.mouseX,t.mouseY);return}var e=t.getEmojiCenter(),i=e.centerX,
|
|
877
|
+
if(prefersReducedMotion())return;if(t.isFollowingMouse){t.moveHead(t.mouseX,t.mouseY);return}var e=t.getEmojiCenter(),i=e.centerX,r=e.centerY;t.moveHead(i,r)};
|
|
869
878
|
// The one place the pointer becomes a pose: the direction of the point from the centre,
|
|
870
879
|
// with a reach that depends on the viewport, not on the size of the emoji (#800).
|
|
871
|
-
this.moveHead=function(e,i,
|
|
880
|
+
this.moveHead=function(e,i,r){if(r===void 0){r=false}var n=t.getEmojiCenter(),s=n.centerX,o=n.centerY;var a=gazeToward(e-s,i-o,gazeReach(window.innerWidth,window.innerHeight));t.rotate(a.x,a.y,r)};this.rotate=function(e,i,r){if(r===void 0){r=false}if(!t.cssCustomPropsRead)t.updateCSSCustomProps();var n="power1.out";
|
|
872
881
|
// The traits can be put in place at once instead of eased there: an expression
|
|
873
882
|
// about to take the face over owns them from this very frame, and a tween still
|
|
874
883
|
// on its way would be killed halfway through, leaving them offset toward the
|
|
875
884
|
// pointer for as long as that expression lasts.
|
|
876
|
-
var s=
|
|
877
|
-
t.currentRotateY=o(t.expressionAngleMax,e);t.headOffsetX=o(t.headOffset,e);t.headOffsetY=o(t.headOffset,i);t.eyesOffsetX=o(t.eyesOffset,e);t.eyesOffsetY=o(t.eyesOffset,i);t.mouthOffsetX=o(t.mouthOffset,e);t.mouthOffsetY=o(t.mouthOffset,i);t.handOffsetX=o(t.handOffset,e);t.handOffsetY=o(t.handOffset,i);t.gadgetOffsetX=o(t.gadgetOffset,e);t.gadgetOffsetY=o(t.gadgetOffset,i);t.eyebrowsOffsetX=o(t.eyebrowsOffset,e);t.eyebrowsOffsetY=o(t.eyebrowsOffset,i);t.earsOffsetX=o(t.earsOffset,e);t.earsOffsetY=o(t.earsOffset,i);if(!t.headEl){t.headEl=t.svgPartState("head");t.eyebrowsEl=t.svgPartState("eyebrows");t.earsEl=t.svgPartState("ears");t.eyesEl=t.svgPartState("eyes");t.handEl=t.svgPartState("hand","think");if(t.handEl)t.handEl.style.visibility="hidden";t.mouthEl=t.svgPartState("mouth");t.gadgetEl=t.svgPartState("gadget")}var a={duration:s,ease:
|
|
885
|
+
var s=r?0:t.expressionFollowMouseTraitsDuration;var o=function(e,t){return gsapWithCSS.utils.clamp(-e,e,t*e)};t.currentRotateX=o(t.expressionAngleMax,-i);// Y invertito
|
|
886
|
+
t.currentRotateY=o(t.expressionAngleMax,e);t.headOffsetX=o(t.headOffset,e);t.headOffsetY=o(t.headOffset,i);t.eyesOffsetX=o(t.eyesOffset,e);t.eyesOffsetY=o(t.eyesOffset,i);t.mouthOffsetX=o(t.mouthOffset,e);t.mouthOffsetY=o(t.mouthOffset,i);t.handOffsetX=o(t.handOffset,e);t.handOffsetY=o(t.handOffset,i);t.gadgetOffsetX=o(t.gadgetOffset,e);t.gadgetOffsetY=o(t.gadgetOffset,i);t.eyebrowsOffsetX=o(t.eyebrowsOffset,e);t.eyebrowsOffsetY=o(t.eyebrowsOffset,i);t.earsOffsetX=o(t.earsOffset,e);t.earsOffsetY=o(t.earsOffset,i);if(!t.headEl){t.headEl=t.svgPartState("head");t.eyebrowsEl=t.svgPartState("eyebrows");t.earsEl=t.svgPartState("ears");t.eyesEl=t.svgPartState("eyes");t.handEl=t.svgPartState("hand","think");if(t.handEl)t.handEl.style.visibility="hidden";t.mouthEl=t.svgPartState("mouth");t.gadgetEl=t.svgPartState("gadget")}var a={duration:s,ease:n,
|
|
878
887
|
// 'auto' overwrite drops only the x and y left over from the previous pointer
|
|
879
888
|
// update, and leaves alone the percentage channel the expressions animate.
|
|
880
889
|
overwrite:"auto"};
|
|
881
890
|
// Each facial element is tweened independently with its own offset so they
|
|
882
891
|
// move by different amounts, giving the emoji a layered, parallax-like depth.
|
|
883
|
-
gsapWithCSS.to(t.host,{rotateX:t.currentRotateX,rotateY:t.currentRotateY,transformOrigin:"50% 50%",duration:t.expressionFollowMouseHeadDuration,ease:
|
|
892
|
+
gsapWithCSS.to(t.host,{rotateX:t.currentRotateX,rotateY:t.currentRotateY,transformOrigin:"50% 50%",duration:t.expressionFollowMouseHeadDuration,ease:n,
|
|
893
|
+
// A newer pose replaces the previous one: without it a slower tween still
|
|
894
|
+
// running kept writing its own angles once the newer one had finished.
|
|
895
|
+
overwrite:"auto"});if(t.eyesEl){gsapWithCSS.to(t.eyesEl,Object.assign({translateX:t.eyesOffsetX,translateY:t.eyesOffsetY,transformOrigin:"50% 50%"},a))}if(t.handEl){gsapWithCSS.to(t.handEl,Object.assign({translateX:t.handOffsetX,translateY:t.handOffsetY,transformOrigin:"50% 50%"},a))}if(t.headEl){gsapWithCSS.to(t.headEl,Object.assign({translateX:t.headOffsetX,translateY:t.headOffsetY,transformOrigin:"0% 100%"},a))}if(t.mouthEl){gsapWithCSS.to(t.mouthEl,Object.assign({translateX:t.mouthOffsetX,translateY:t.mouthOffsetY,transformOrigin:"50% 50%"},a))}if(t.gadgetEl){gsapWithCSS.to(t.gadgetEl,Object.assign({translateX:t.gadgetOffsetX,translateY:t.gadgetOffsetY,transformOrigin:"50% 50%"},a))}if(t.eyebrowsEl){gsapWithCSS.to(t.eyebrowsEl,Object.assign({translateX:t.eyebrowsOffsetX,translateY:t.eyebrowsOffsetY,transformOrigin:"50% 50%"},a))}if(t.earsEl){gsapWithCSS.to(t.earsEl,Object.assign({translateX:t.earsOffsetX,translateY:t.earsOffsetY,transformOrigin:"50% 50%"},a))}}}
|
|
896
|
+
// A move disconnects the host and connects it again, while componentDidLoad runs
|
|
897
|
+
// once: the pointer listener follows the connection, so a moved emoji still hears it.
|
|
898
|
+
e.prototype.connectedCallback=function(){if(typeof window==="undefined")return;window.addEventListener("mousemove",this.handleFollowMouse)};e.prototype.componentDidLoad=function(){if(typeof window==="undefined")return;this.updateCSSCustomProps();this.checkNameChanged(this.name)};e.prototype.disconnectedCallback=function(){var e,t;if(typeof window==="undefined")return;
|
|
899
|
+
// In the lazy build the instance can hear of a disconnect after the host is back on
|
|
900
|
+
// the page. GSAP causes one: to read the transform of a host that is not drawn (a
|
|
901
|
+
// slotted emoji before its slot is rendered) it appends it to <html> for a moment
|
|
902
|
+
// and puts it back. The emoji is still mounted then, nothing to tear down.
|
|
903
|
+
if(this.host.isConnected)return;window.removeEventListener("mousemove",this.handleFollowMouse);this.isThinking=false;this.isBlinking=false;this.isFollowingMouse=false;this.killExpressionAnimations();(e=this.blinkDelay)===null||e===void 0?void 0:e.kill();(t=this.blinkTimeline)===null||t===void 0?void 0:t.kill();[this.host,this.eyesEl,this.handEl,this.headEl,this.mouthEl,this.gadgetEl,this.eyebrowsEl,this.earsEl].forEach((function(e){return e&&gsapWithCSS.killTweensOf(e)}))};
|
|
884
904
|
/**
|
|
885
905
|
* Emoji agrees, useful for confirm actions.
|
|
886
906
|
*/e.prototype.agree=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.beginExpression();return[4/*yield*/,this.setAgreeAnimation(e)];case 1:t.sent();return[2/*return*/,Promise.resolve()]}}))}))};
|
|
@@ -940,6 +960,6 @@ if(!this.isEmojiName(e)){if(e!=null){console.warn('mds-emoji: ignoring the unkno
|
|
|
940
960
|
// Putting the attribute in place first fixes the order; Stencil's own reflection
|
|
941
961
|
// lands on the same value later, so this stays idempotent, and the re-entrant
|
|
942
962
|
// attributeChangedCallback is a no-op because the value did not change.
|
|
943
|
-
if(this.host.getAttribute("name")!==e)this.host.setAttribute("name",e);this.updateSvgDictionary(e)};e.prototype.svgPartState=function(e,t){var i,n,
|
|
963
|
+
if(this.host.getAttribute("name")!==e)this.host.setAttribute("name",e);this.updateSvgDictionary(e)};e.prototype.svgPartState=function(e,t){var i,r,n,s;var o=(r=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.firstElementChild)===null||r===void 0?void 0:r.querySelectorAll("[id^='".concat(e,"-']"));if(!o||o.length===0)return null;if((t===undefined||t==="")&&o){o===null||o===void 0?void 0:o.forEach((function(e){
|
|
944
964
|
// const currentState = el.id.split('-')[1]
|
|
945
|
-
e.style.visibility="hidden";if(e.id.split("-")[1]==="default")e.style.visibility="visible"}));return o}var a=(s=(
|
|
965
|
+
e.style.visibility="hidden";if(e.id.split("-")[1]==="default")e.style.visibility="visible"}));return o}var a=(s=(n=this.host.shadowRoot)===null||n===void 0?void 0:n.firstElementChild)===null||s===void 0?void 0:s.querySelector("[id='".concat(e,"-default']"));o===null||o===void 0?void 0:o.forEach((function(e){e.style.visibility="hidden";if(e.id.split("-")[1]===t){a=e}}));if(!a)return null;a.style.visibility="visible";return a};e.prototype.render=function(){return h(Host,{key:"228ea1ce5afd636026b77ac0a00462a7e2471470"})};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{name:[{checkNameChanged:0}]}},enumerable:false,configurable:true});return e}();MdsEmoji.style=mdsEmojiCss();export{MdsEmoji as mds_emoji};
|