@norgate-av/ch5-crcomlib 2.17.2
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/LICENSE.txt +13 -0
- package/README.md +95 -0
- package/build_bundles/amd/@types/ch5-animation/ch5-animation.d.ts +53 -0
- package/build_bundles/amd/@types/ch5-animation/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-animation/interfaces/i-ch5-animation-attributes.d.ts +10 -0
- package/build_bundles/amd/@types/ch5-animation/interfaces/t-ch5-animation.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-background/ch5-background.d.ts +114 -0
- package/build_bundles/amd/@types/ch5-background/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-background/interfaces/i-ch5-background-attributes.d.ts +15 -0
- package/build_bundles/amd/@types/ch5-background/interfaces/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-background/interfaces/t-ch5-background.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-base/ch5-base-class.d.ts +138 -0
- package/build_bundles/amd/@types/ch5-base/ch5-base-log.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-button/ch5-button-base.d.ts +222 -0
- package/build_bundles/amd/@types/ch5-button/ch5-button-label.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-button/ch5-button-mode-state.d.ts +42 -0
- package/build_bundles/amd/@types/ch5-button/ch5-button-mode.d.ts +38 -0
- package/build_bundles/amd/@types/ch5-button/ch5-button-signal.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-button/ch5-button-utils.d.ts +22 -0
- package/build_bundles/amd/@types/ch5-button/ch5-button.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-button/index.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-button/interfaces/i-ch5-button-attributes.d.ts +40 -0
- package/build_bundles/amd/@types/ch5-button/interfaces/i-ch5-button-label-attributes.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-button/interfaces/i-ch5-button-mode-attributes.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-button/interfaces/i-ch5-button-mode-common.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-button/interfaces/i-ch5-button-mode-state-attributes.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-button/interfaces/index.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-button/interfaces/t-ch5-button.d.ts +20 -0
- package/build_bundles/amd/@types/ch5-button/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-button-list/base-classes/ch5-button-list-base.d.ts +213 -0
- package/build_bundles/amd/@types/ch5-button-list/base-classes/ch5-button-list-individual-button-base.d.ts +25 -0
- package/build_bundles/amd/@types/ch5-button-list/base-classes/ch5-button-list-label-base.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-button-list/base-classes/ch5-button-list-mode-base.d.ts +43 -0
- package/build_bundles/amd/@types/ch5-button-list/base-classes/ch5-button-list-mode-state-base.d.ts +47 -0
- package/build_bundles/amd/@types/ch5-button-list/ch5-button-list-individual-button.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-button-list/ch5-button-list-label.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-button-list/ch5-button-list-mode-state.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-button-list/ch5-button-list-mode.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-button-list/ch5-button-list.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-button-list/index.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-button-list/interfaces/i-ch5-button-list-attributes.d.ts +56 -0
- package/build_bundles/amd/@types/ch5-button-list/interfaces/i-ch5-button-list-individual-button-attributes.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-button-list/interfaces/i-ch5-button-list-label-documentation.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-button-list/interfaces/i-ch5-button-list-mode-attributes.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-button-list/interfaces/i-ch5-button-list-mode-state-attributes.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-button-list/interfaces/t-ch5-button-list.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-button-list/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-color-chip/ch5-color-chip.d.ts +51 -0
- package/build_bundles/amd/@types/ch5-color-chip/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-color-chip/interfaces/i-ch5-color-chip-attributes.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-color-picker/ch5-color-picker.d.ts +61 -0
- package/build_bundles/amd/@types/ch5-color-picker/color-picker.d.ts +10 -0
- package/build_bundles/amd/@types/ch5-color-picker/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-color-picker/interfaces/i-ch5-color-picker-attributes.d.ts +10 -0
- package/build_bundles/amd/@types/ch5-common/ch5-augment-var-signals-names.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-common/ch5-common-log.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-common/ch5-common.d.ts +183 -0
- package/build_bundles/amd/@types/ch5-common/ch5-config.d.ts +37 -0
- package/build_bundles/amd/@types/ch5-common/ch5-log.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-common/ch5-mutation-observer.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-common/ch5-pressable-slider.d.ts +61 -0
- package/build_bundles/amd/@types/ch5-common/ch5-pressable.d.ts +43 -0
- package/build_bundles/amd/@types/ch5-common/ch5-signal-attribute-registry.d.ts +41 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-appendclasswheninviewport.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-customclass.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-customstyle.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-dir.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-id.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-noshowtype.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatecustomclass.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatecustomstyle.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateenable.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatehidepulse.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateshow.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateshowpulse.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-sendeventonshow.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-show.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-class.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-debug.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-disabled.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-role.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/common/i-ch5-common-style.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-button-list-attributes.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-animation.d.ts +10 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-color-chip.d.ts +10 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-datetime.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-dpad-child.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-media-player.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-set3.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-template.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-text.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-toggle.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-video-documentation.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-video-switcher.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes-video.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-attributes.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common-documentation-video-switcher.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-common.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-gestureable.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-subpage-reference-list-attributes.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/i-ch5-tab-button-attributes.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/index.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-common/interfaces/t-ch5-common.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-common/utils/ch5-color-utils.d.ts +15 -0
- package/build_bundles/amd/@types/ch5-common/utils/common-functions.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-common/utils/component-helper.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-common/utils/html-callback.d.ts +20 -0
- package/build_bundles/amd/@types/ch5-common/utils/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-common-input/ch5-common-input.d.ts +55 -0
- package/build_bundles/amd/@types/ch5-common-input/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-common-input/interfaces/i-ch5-common-input-attributes.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-common-input/interfaces/i-ch5-common-input.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-common-input/interfaces/t-ch5-common-input.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/ch5-component.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-core/ch5-core-intersection-observer.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-core/ch5-debug.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-core/ch5-heartbeat.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-core/ch5-platform.d.ts +15 -0
- package/build_bundles/amd/@types/ch5-core/ch5-properties.d.ts +18 -0
- package/build_bundles/amd/@types/ch5-core/ch5-property.d.ts +65 -0
- package/build_bundles/amd/@types/ch5-core/ch5-signal-behavior-subject.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-core/ch5-signal-bridge-receive.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-core/ch5-signal-bridge.d.ts +18 -0
- package/build_bundles/amd/@types/ch5-core/ch5-signal-factory.d.ts +17 -0
- package/build_bundles/amd/@types/ch5-core/ch5-signal.d.ts +32 -0
- package/build_bundles/amd/@types/ch5-core/ch5-translation-configuration.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-core/ch5-translation-factory.d.ts +10 -0
- package/build_bundles/amd/@types/ch5-core/ch5-translation-listeners.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-core/ch5-translation-utility.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-core/ch5-uid.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-core/ch5-version.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-core/index.d.ts +32 -0
- package/build_bundles/amd/@types/ch5-core/interfaces-sig-com.d.ts +53 -0
- package/build_bundles/amd/@types/ch5-core/resize-observer.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/types/callbacks.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-core/types/ch5-platform-info.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-core/types/core.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-core/types/signal.type.d.ts +20 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/animate.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/components.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/debounce.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/get-signal.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/is-crestron-device.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/is-crestron-touchscreen.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/is-ios-device.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/is-safari-mobile.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/publish-signal.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/signals.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/subscribe-in-view-port-change.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/subscribe-signal-script.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/subscribe-signal.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/textformat.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/translation-interface-register.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/trigger-translation.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-core/utility-functions/unsubscribe-signal.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-appendclass.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-appendstyle.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-enable.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-hidepulse.d.ts +18 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-i18n.d.ts +18 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-innerhtml.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-log.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-mutation-observer.d.ts +18 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-show.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-showpulse.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-attrs-text-content.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/ch5-custom-attributes.d.ts +22 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/index.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/helpers/custom-attribute.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/helpers/i-custom-attribute.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-appendclass.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-appendstyle.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-enable.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-hidepulse.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-i18n.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-innerhtml.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-keep-sig-subscription.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-noshow-type.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-show.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-showpulse.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-text-content.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/index.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/interfaces/t-ch5-attrs.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/utils/ch5-attrs-constants.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-custom-attrs/utils/ch5-attrs-utility.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-datetime/ch5-datetime.d.ts +66 -0
- package/build_bundles/amd/@types/ch5-datetime/date-time-util.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-datetime/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-datetime/interfaces/i-ch5-datetime-attributes.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-datetime/interfaces/t-ch5-datetime.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-dpad/ch5-dpad-button-base.d.ts +74 -0
- package/build_bundles/amd/@types/ch5-dpad/ch5-dpad-button.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-dpad/ch5-dpad-utils.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-dpad/ch5-dpad.d.ts +85 -0
- package/build_bundles/amd/@types/ch5-dpad/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-dpad/interfaces/i-ch5-dpad-attributes.d.ts +20 -0
- package/build_bundles/amd/@types/ch5-dpad/interfaces/i-ch5-dpad-button-base-attributes.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-dpad/interfaces/t-ch5-dpad.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-emulator/ch5-emulator.d.ts +44 -0
- package/build_bundles/amd/@types/ch5-emulator/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-form/ch5-form.d.ts +90 -0
- package/build_bundles/amd/@types/ch5-form/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-form/interfaces/i-ch5-form-attributes.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-image/ch5-image-mode.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-image/ch5-image-uri-model.d.ts +23 -0
- package/build_bundles/amd/@types/ch5-image/ch5-image.d.ts +140 -0
- package/build_bundles/amd/@types/ch5-image/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-image/interfaces/i-ch5-image-attributes.d.ts +23 -0
- package/build_bundles/amd/@types/ch5-image/interfaces/i-ch5-image-mode-attributes.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-import-htmlsnippet/ch5-import-htmlsnippet.d.ts +34 -0
- package/build_bundles/amd/@types/ch5-import-htmlsnippet/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-import-htmlsnippet/interfaces/i-ch5-import-htmlsnippet-attributes.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-jointotext-boolean/ch5-jointotext-boolean.d.ts +27 -0
- package/build_bundles/amd/@types/ch5-jointotext-boolean/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-jointotext-boolean/interfaces/i-ch5-jointotext-boolean-attributes.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-jointotext-boolean/interfaces/i-ch5-jointotext-boolean-documentation.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-jointotext-boolean/interfaces/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/ch5-jointotext-numeric.d.ts +47 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/float-format.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/hex-format.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/numeric-format-factory.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/numeric-format.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/percentage-format.d.ts +10 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/raw-format.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/signed-format.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/time-format.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/format/unsigned-format.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/interfaces/i-ch5-jointotext-numeric-attributes.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-jointotext-numeric/interfaces/t-ch5-jointotext-numeric.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-jointotext-string/ch5-jointotext-string.d.ts +25 -0
- package/build_bundles/amd/@types/ch5-jointotext-string/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-jointotext-string/interfaces/i-ch5-jointotext-string-attributes.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-keypad/ch5-keypad-btn.d.ts +53 -0
- package/build_bundles/amd/@types/ch5-keypad/ch5-keypad-utils.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-keypad/ch5-keypad.d.ts +98 -0
- package/build_bundles/amd/@types/ch5-keypad/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-keypad/interfaces/i-ch5-keypad-attributes.d.ts +25 -0
- package/build_bundles/amd/@types/ch5-keypad/interfaces/i-ch5-keypad-btn-attributes.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-keypad/interfaces/t-ch5-keypad.d.ts +15 -0
- package/build_bundles/amd/@types/ch5-label/ch5-label.d.ts +40 -0
- package/build_bundles/amd/@types/ch5-label/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-label/interfaces/i-ch5-label-attributes.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-list/animation/ch5-animation-factory.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-list/animation/ch5-animation.d.ts +18 -0
- package/build_bundles/amd/@types/ch5-list/animation/ch5-standard-animation.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-list/ch5-list-abstract-helper.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-list/ch5-list-animation.d.ts +39 -0
- package/build_bundles/amd/@types/ch5-list/ch5-list-buffered-items.d.ts +17 -0
- package/build_bundles/amd/@types/ch5-list/ch5-list-event-manager.d.ts +25 -0
- package/build_bundles/amd/@types/ch5-list/ch5-list-signal-manager.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-list/ch5-list-size-resolver.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-list/ch5-list-template.d.ts +53 -0
- package/build_bundles/amd/@types/ch5-list/ch5-list.d.ts +283 -0
- package/build_bundles/amd/@types/ch5-list/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-list/interfaces/i-ch5-list-attributes.d.ts +21 -0
- package/build_bundles/amd/@types/ch5-list/interfaces/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-list/interfaces/t-ch5-list.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-list/passiveEventListeners.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-logger/appender/AbstractAppender.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-logger/appender/AppenderFactory.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-logger/appender/RemoteAppender.d.ts +18 -0
- package/build_bundles/amd/@types/ch5-logger/enums/index.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-logger/helpers/LogMessage.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-logger/helpers/LogMessagesFilter.d.ts +17 -0
- package/build_bundles/amd/@types/ch5-logger/helpers/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-logger/index.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-logger/logger/Logger.d.ts +33 -0
- package/build_bundles/amd/@types/ch5-logger/logger/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-logger/services/RequestService.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-logger/services/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-logger/types/index.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-logger/utility/getLogger.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-logger/utility/getRemoteAppender.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-logger/utility/index.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-logger/utility/uriSchemaValidation.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-media-player/ch5-media-player-common.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-media-player/ch5-media-player-icon-button-base.d.ts +33 -0
- package/build_bundles/amd/@types/ch5-media-player/ch5-media-player-my-music.d.ts +38 -0
- package/build_bundles/amd/@types/ch5-media-player/ch5-media-player-now-playing.d.ts +68 -0
- package/build_bundles/amd/@types/ch5-media-player/ch5-media-player.d.ts +83 -0
- package/build_bundles/amd/@types/ch5-media-player/commonInterface.d.ts +133 -0
- package/build_bundles/amd/@types/ch5-media-player/index.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-media-player/interfaces/i-ch5-media-player-attributes.d.ts +15 -0
- package/build_bundles/amd/@types/ch5-media-player/interfaces/t-ch5-media-player.d.ts +27 -0
- package/build_bundles/amd/@types/ch5-media-player/music-player.d.ts +64 -0
- package/build_bundles/amd/@types/ch5-modal-dialog/ch5-modal-dialog.d.ts +103 -0
- package/build_bundles/amd/@types/ch5-modal-dialog/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-modal-dialog/interfaces/i-ch5-modal-dialog-attributes.d.ts +30 -0
- package/build_bundles/amd/@types/ch5-overlay-panel/ch5-overlay-panel.d.ts +93 -0
- package/build_bundles/amd/@types/ch5-overlay-panel/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-overlay-panel/interfaces/i-ch5-overlay-panel-attributes.d.ts +17 -0
- package/build_bundles/amd/@types/ch5-overlay-panel/interfaces/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-overlay-panel/interfaces/t-ch5-overlay-panel.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-qrcode/ch5-qrcode.d.ts +32 -0
- package/build_bundles/amd/@types/ch5-qrcode/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-qrcode/interfaces/i-ch5-qrcode-attributes.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-resync/ch5-resync.d.ts +27 -0
- package/build_bundles/amd/@types/ch5-resync/models/ch5-clear-range-data-model.d.ts +17 -0
- package/build_bundles/amd/@types/ch5-resync/models/ch5-exclude-prefixes-model.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-resync/models/ch5-resync-constants.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-resync/models/ch5-resync-reset-event-names-enum.d.ts +8 -0
- package/build_bundles/amd/@types/ch5-resync/models/ch5-states-at-default-value-model.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-resync/models/resynchronization-request-model.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-segmented-gauge/ch5-segmented-gauge.d.ts +86 -0
- package/build_bundles/amd/@types/ch5-segmented-gauge/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-segmented-gauge/interfaces/i-ch5-segmented-gauge-attributes.d.ts +17 -0
- package/build_bundles/amd/@types/ch5-segmented-gauge/interfaces/t-ch5-segmented-gauge.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-select/ch5-select.d.ts +203 -0
- package/build_bundles/amd/@types/ch5-select/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-select/interfaces/i-ch5-select-attributes.d.ts +27 -0
- package/build_bundles/amd/@types/ch5-select/interfaces/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-select/interfaces/t-ch5-select.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-select-option/ch5-select-option.d.ts +75 -0
- package/build_bundles/amd/@types/ch5-select-option/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-select-option/interfaces/i-ch5-select-option-attributes.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-select-option/interfaces/types/t-ch5-select-option-icon-position.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-signal-level-gauge/ch5-signal-level-gauge.d.ts +53 -0
- package/build_bundles/amd/@types/ch5-signal-level-gauge/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-signal-level-gauge/interfaces/i-ch5-signal-level-gauge-attributes.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-signal-level-gauge/interfaces/t-ch5-signal-level-gauge.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-slider/ch5-slider-button-label.d.ts +23 -0
- package/build_bundles/amd/@types/ch5-slider/ch5-slider-button.d.ts +37 -0
- package/build_bundles/amd/@types/ch5-slider/ch5-slider-title-label.d.ts +23 -0
- package/build_bundles/amd/@types/ch5-slider/ch5-slider.d.ts +225 -0
- package/build_bundles/amd/@types/ch5-slider/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/i-ch5-slider-attributes.d.ts +35 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/i-ch5-slider-button-attributes.d.ts +19 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/i-ch5-slider-button-documentation.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/i-ch5-slider-button-label-documentation.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/i-ch5-slider-documentation.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/i-ch5-slider-title-label-attributes.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/i-ch5-slider-title-label-documentation.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/index.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/t-ch5-slider-button.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-slider/interfaces/t-ch5-slider.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-spinner/ch5-mouse-velocity.d.ts +35 -0
- package/build_bundles/amd/@types/ch5-spinner/ch5-spinner-events.d.ts +16 -0
- package/build_bundles/amd/@types/ch5-spinner/ch5-spinner-mutation-observer.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-spinner/ch5-spinner-scroll.d.ts +44 -0
- package/build_bundles/amd/@types/ch5-spinner/ch5-spinner-template.d.ts +58 -0
- package/build_bundles/amd/@types/ch5-spinner/ch5-spinner.d.ts +145 -0
- package/build_bundles/amd/@types/ch5-spinner/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-spinner/interfaces/i-ch5-spinner-attributes.d.ts +27 -0
- package/build_bundles/amd/@types/ch5-spinner/interfaces/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-spinner/interfaces/t-ch5-spinner.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-subpage-reference-list/ch5-subpage-reference-list.d.ts +159 -0
- package/build_bundles/amd/@types/ch5-subpage-reference-list/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-subpage-reference-list/interfaces/i-ch5-subpage-reference-list-attributes.d.ts +31 -0
- package/build_bundles/amd/@types/ch5-subpage-reference-list/interfaces/t-ch5-subpage-reference-list.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-subpage-reference-list/refresh-ch5-subpage-reference-list.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-tab-button/ch5-tab-button-individual-button.d.ts +28 -0
- package/build_bundles/amd/@types/ch5-tab-button/ch5-tab-button-label.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-tab-button/ch5-tab-button.d.ts +109 -0
- package/build_bundles/amd/@types/ch5-tab-button/index.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-tab-button/interfaces/i-ch5-tab-button-attributes.d.ts +34 -0
- package/build_bundles/amd/@types/ch5-tab-button/interfaces/i-ch5-tab-button-individual-button-attributes.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-tab-button/interfaces/t-ch5-tab-button.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-tab-button/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/amd/@types/ch5-template/ch5-template-structure.d.ts +20 -0
- package/build_bundles/amd/@types/ch5-template/ch5-template.d.ts +59 -0
- package/build_bundles/amd/@types/ch5-template/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-template/interfaces/i-ch5-template-attributes.d.ts +14 -0
- package/build_bundles/amd/@types/ch5-template/interfaces/t-ch5-template.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-template/refresh-ch5-template.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-text/ch5-text.d.ts +63 -0
- package/build_bundles/amd/@types/ch5-text/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-text/interfaces/i-ch5-text-attributes.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-text/interfaces/t-ch5-text.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-textinput/ch5-textinput-mask.d.ts +69 -0
- package/build_bundles/amd/@types/ch5-textinput/ch5-textinput.d.ts +135 -0
- package/build_bundles/amd/@types/ch5-textinput/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-textinput/interfaces/i-ch5-text-input-attributes.d.ts +29 -0
- package/build_bundles/amd/@types/ch5-textinput/interfaces/i-ch5-text-input.d.ts +7 -0
- package/build_bundles/amd/@types/ch5-textinput/interfaces/index.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-textinput/interfaces/t-ch5-text-input.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-toggle/ch5-toggle.d.ts +95 -0
- package/build_bundles/amd/@types/ch5-toggle/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-toggle/interfaces/i-ch5-toggle-attributes.d.ts +22 -0
- package/build_bundles/amd/@types/ch5-toggle/interfaces/t-ch5-toggle.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-touch/ch5-touch-activity.d.ts +30 -0
- package/build_bundles/amd/@types/ch5-touch/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-triggerview/ch5-triggerview-child.d.ts +36 -0
- package/build_bundles/amd/@types/ch5-triggerview/ch5-triggerview-slides-manager.d.ts +48 -0
- package/build_bundles/amd/@types/ch5-triggerview/ch5-triggerview-swiper.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-triggerview/ch5-triggerview.d.ts +73 -0
- package/build_bundles/amd/@types/ch5-triggerview/index.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-triggerview/interfaces/i-ch5-triggerview-attributes.d.ts +10 -0
- package/build_bundles/amd/@types/ch5-triggerview/interfaces/i-ch5-triggerview-child-attributes.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-triggerview/utils.d.ts +13 -0
- package/build_bundles/amd/@types/ch5-video/ch5-video-snapshot.d.ts +18 -0
- package/build_bundles/amd/@types/ch5-video/ch5-video-touch-manager.d.ts +12 -0
- package/build_bundles/amd/@types/ch5-video/ch5-video-utils.d.ts +17 -0
- package/build_bundles/amd/@types/ch5-video/ch5-video.d.ts +185 -0
- package/build_bundles/amd/@types/ch5-video/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-video/interfaces/i-ch5-video-attributes.d.ts +39 -0
- package/build_bundles/amd/@types/ch5-video/interfaces/i-ch5-video-documentation.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-video/interfaces/i-ch5-video-helper.d.ts +96 -0
- package/build_bundles/amd/@types/ch5-video/interfaces/index.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-video/interfaces/t-ch5-video.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-video-switcher/ch5-video-switcher-screen-label.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-video-switcher/ch5-video-switcher-screen.d.ts +24 -0
- package/build_bundles/amd/@types/ch5-video-switcher/ch5-video-switcher-source-label.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-video-switcher/ch5-video-switcher-source.d.ts +25 -0
- package/build_bundles/amd/@types/ch5-video-switcher/ch5-video-switcher.d.ts +159 -0
- package/build_bundles/amd/@types/ch5-video-switcher/drag-drop-touch.d.ts +47 -0
- package/build_bundles/amd/@types/ch5-video-switcher/index.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-attributes.d.ts +29 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-documentation.d.ts +4 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-attributes.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-documentation.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-label-documentation.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-attributes.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-documentation.d.ts +3 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-label-documentation.d.ts +2 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/index.d.ts +9 -0
- package/build_bundles/amd/@types/ch5-video-switcher/interfaces/t-ch5-video-switcher.d.ts +5 -0
- package/build_bundles/amd/@types/ch5-wifi-signal-level-gauge/ch5-wifi-signal-level-gauge.d.ts +57 -0
- package/build_bundles/amd/@types/ch5-wifi-signal-level-gauge/index.d.ts +1 -0
- package/build_bundles/amd/@types/ch5-wifi-signal-level-gauge/interfaces/i-ch5-wifi-signal-level-gauge-attributes.d.ts +11 -0
- package/build_bundles/amd/@types/ch5-wifi-signal-level-gauge/interfaces/t-ch5-wifi-signal-level-gauge.d.ts +3 -0
- package/build_bundles/amd/@types/index.d.ts +45 -0
- package/build_bundles/amd/@types/utility-models/ch5-role-attribute-mapping.d.ts +52 -0
- package/build_bundles/amd/@types/utility-models/index.d.ts +1 -0
- package/build_bundles/amd/cr-com-lib.js +2 -0
- package/build_bundles/amd/cr-com-lib.js.LICENSE.txt +30 -0
- package/build_bundles/cjs/@types/ch5-animation/ch5-animation.d.ts +53 -0
- package/build_bundles/cjs/@types/ch5-animation/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-animation/interfaces/i-ch5-animation-attributes.d.ts +10 -0
- package/build_bundles/cjs/@types/ch5-animation/interfaces/t-ch5-animation.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-background/ch5-background.d.ts +114 -0
- package/build_bundles/cjs/@types/ch5-background/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-background/interfaces/i-ch5-background-attributes.d.ts +15 -0
- package/build_bundles/cjs/@types/ch5-background/interfaces/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-background/interfaces/t-ch5-background.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-base/ch5-base-class.d.ts +138 -0
- package/build_bundles/cjs/@types/ch5-base/ch5-base-log.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-button/ch5-button-base.d.ts +222 -0
- package/build_bundles/cjs/@types/ch5-button/ch5-button-label.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-button/ch5-button-mode-state.d.ts +42 -0
- package/build_bundles/cjs/@types/ch5-button/ch5-button-mode.d.ts +38 -0
- package/build_bundles/cjs/@types/ch5-button/ch5-button-signal.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-button/ch5-button-utils.d.ts +22 -0
- package/build_bundles/cjs/@types/ch5-button/ch5-button.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-button/index.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-button/interfaces/i-ch5-button-attributes.d.ts +40 -0
- package/build_bundles/cjs/@types/ch5-button/interfaces/i-ch5-button-label-attributes.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-button/interfaces/i-ch5-button-mode-attributes.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-button/interfaces/i-ch5-button-mode-common.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-button/interfaces/i-ch5-button-mode-state-attributes.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-button/interfaces/index.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-button/interfaces/t-ch5-button.d.ts +20 -0
- package/build_bundles/cjs/@types/ch5-button/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-button-list/base-classes/ch5-button-list-base.d.ts +213 -0
- package/build_bundles/cjs/@types/ch5-button-list/base-classes/ch5-button-list-individual-button-base.d.ts +25 -0
- package/build_bundles/cjs/@types/ch5-button-list/base-classes/ch5-button-list-label-base.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-button-list/base-classes/ch5-button-list-mode-base.d.ts +43 -0
- package/build_bundles/cjs/@types/ch5-button-list/base-classes/ch5-button-list-mode-state-base.d.ts +47 -0
- package/build_bundles/cjs/@types/ch5-button-list/ch5-button-list-individual-button.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-button-list/ch5-button-list-label.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-button-list/ch5-button-list-mode-state.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-button-list/ch5-button-list-mode.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-button-list/ch5-button-list.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-button-list/index.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-button-list/interfaces/i-ch5-button-list-attributes.d.ts +56 -0
- package/build_bundles/cjs/@types/ch5-button-list/interfaces/i-ch5-button-list-individual-button-attributes.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-button-list/interfaces/i-ch5-button-list-label-documentation.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-button-list/interfaces/i-ch5-button-list-mode-attributes.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-button-list/interfaces/i-ch5-button-list-mode-state-attributes.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-button-list/interfaces/t-ch5-button-list.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-button-list/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-color-chip/ch5-color-chip.d.ts +51 -0
- package/build_bundles/cjs/@types/ch5-color-chip/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-color-chip/interfaces/i-ch5-color-chip-attributes.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-color-picker/ch5-color-picker.d.ts +61 -0
- package/build_bundles/cjs/@types/ch5-color-picker/color-picker.d.ts +10 -0
- package/build_bundles/cjs/@types/ch5-color-picker/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-color-picker/interfaces/i-ch5-color-picker-attributes.d.ts +10 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-augment-var-signals-names.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-common-log.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-common.d.ts +183 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-config.d.ts +37 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-log.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-mutation-observer.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-pressable-slider.d.ts +61 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-pressable.d.ts +43 -0
- package/build_bundles/cjs/@types/ch5-common/ch5-signal-attribute-registry.d.ts +41 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-appendclasswheninviewport.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-customclass.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-customstyle.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-dir.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-id.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-noshowtype.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatecustomclass.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatecustomstyle.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateenable.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatehidepulse.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateshow.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateshowpulse.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-sendeventonshow.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-attributes-show.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-class.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-debug.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-disabled.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-role.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/common/i-ch5-common-style.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-button-list-attributes.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-animation.d.ts +10 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-color-chip.d.ts +10 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-datetime.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-dpad-child.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-media-player.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-set3.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-template.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-text.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-toggle.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-video-documentation.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-video-switcher.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes-video.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-attributes.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common-documentation-video-switcher.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-common.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-gestureable.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-subpage-reference-list-attributes.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/i-ch5-tab-button-attributes.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/index.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-common/interfaces/t-ch5-common.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-common/utils/ch5-color-utils.d.ts +15 -0
- package/build_bundles/cjs/@types/ch5-common/utils/common-functions.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-common/utils/component-helper.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-common/utils/html-callback.d.ts +20 -0
- package/build_bundles/cjs/@types/ch5-common/utils/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-common-input/ch5-common-input.d.ts +55 -0
- package/build_bundles/cjs/@types/ch5-common-input/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-common-input/interfaces/i-ch5-common-input-attributes.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-common-input/interfaces/i-ch5-common-input.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-common-input/interfaces/t-ch5-common-input.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-component.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-core-intersection-observer.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-debug.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-heartbeat.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-platform.d.ts +15 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-properties.d.ts +18 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-property.d.ts +65 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-signal-behavior-subject.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-signal-bridge-receive.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-signal-bridge.d.ts +18 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-signal-factory.d.ts +17 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-signal.d.ts +32 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-translation-configuration.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-translation-factory.d.ts +10 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-translation-listeners.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-translation-utility.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-uid.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-core/ch5-version.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-core/index.d.ts +32 -0
- package/build_bundles/cjs/@types/ch5-core/interfaces-sig-com.d.ts +53 -0
- package/build_bundles/cjs/@types/ch5-core/resize-observer.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/types/callbacks.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-core/types/ch5-platform-info.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-core/types/core.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-core/types/signal.type.d.ts +20 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/animate.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/components.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/debounce.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/get-signal.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/is-crestron-device.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/is-crestron-touchscreen.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/is-ios-device.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/is-safari-mobile.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/publish-signal.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/signals.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/subscribe-in-view-port-change.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/subscribe-signal-script.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/subscribe-signal.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/textformat.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/translation-interface-register.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/trigger-translation.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-core/utility-functions/unsubscribe-signal.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-appendclass.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-appendstyle.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-enable.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-hidepulse.d.ts +18 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-i18n.d.ts +18 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-innerhtml.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-log.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-mutation-observer.d.ts +18 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-show.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-showpulse.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-attrs-text-content.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/ch5-custom-attributes.d.ts +22 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/index.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/helpers/custom-attribute.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/helpers/i-custom-attribute.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-appendclass.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-appendstyle.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-enable.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-hidepulse.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-i18n.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-innerhtml.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-keep-sig-subscription.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-noshow-type.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-show.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-showpulse.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-text-content.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/index.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/interfaces/t-ch5-attrs.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/utils/ch5-attrs-constants.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-custom-attrs/utils/ch5-attrs-utility.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-datetime/ch5-datetime.d.ts +66 -0
- package/build_bundles/cjs/@types/ch5-datetime/date-time-util.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-datetime/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-datetime/interfaces/i-ch5-datetime-attributes.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-datetime/interfaces/t-ch5-datetime.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-dpad/ch5-dpad-button-base.d.ts +74 -0
- package/build_bundles/cjs/@types/ch5-dpad/ch5-dpad-button.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-dpad/ch5-dpad-utils.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-dpad/ch5-dpad.d.ts +85 -0
- package/build_bundles/cjs/@types/ch5-dpad/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-dpad/interfaces/i-ch5-dpad-attributes.d.ts +20 -0
- package/build_bundles/cjs/@types/ch5-dpad/interfaces/i-ch5-dpad-button-base-attributes.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-dpad/interfaces/t-ch5-dpad.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-emulator/ch5-emulator.d.ts +44 -0
- package/build_bundles/cjs/@types/ch5-emulator/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-form/ch5-form.d.ts +90 -0
- package/build_bundles/cjs/@types/ch5-form/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-form/interfaces/i-ch5-form-attributes.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-image/ch5-image-mode.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-image/ch5-image-uri-model.d.ts +23 -0
- package/build_bundles/cjs/@types/ch5-image/ch5-image.d.ts +140 -0
- package/build_bundles/cjs/@types/ch5-image/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-image/interfaces/i-ch5-image-attributes.d.ts +23 -0
- package/build_bundles/cjs/@types/ch5-image/interfaces/i-ch5-image-mode-attributes.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-import-htmlsnippet/ch5-import-htmlsnippet.d.ts +34 -0
- package/build_bundles/cjs/@types/ch5-import-htmlsnippet/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-import-htmlsnippet/interfaces/i-ch5-import-htmlsnippet-attributes.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-jointotext-boolean/ch5-jointotext-boolean.d.ts +27 -0
- package/build_bundles/cjs/@types/ch5-jointotext-boolean/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-jointotext-boolean/interfaces/i-ch5-jointotext-boolean-attributes.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-jointotext-boolean/interfaces/i-ch5-jointotext-boolean-documentation.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-jointotext-boolean/interfaces/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/ch5-jointotext-numeric.d.ts +47 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/float-format.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/hex-format.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/numeric-format-factory.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/numeric-format.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/percentage-format.d.ts +10 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/raw-format.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/signed-format.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/time-format.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/format/unsigned-format.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/interfaces/i-ch5-jointotext-numeric-attributes.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-jointotext-numeric/interfaces/t-ch5-jointotext-numeric.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-jointotext-string/ch5-jointotext-string.d.ts +25 -0
- package/build_bundles/cjs/@types/ch5-jointotext-string/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-jointotext-string/interfaces/i-ch5-jointotext-string-attributes.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-keypad/ch5-keypad-btn.d.ts +53 -0
- package/build_bundles/cjs/@types/ch5-keypad/ch5-keypad-utils.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-keypad/ch5-keypad.d.ts +98 -0
- package/build_bundles/cjs/@types/ch5-keypad/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-keypad/interfaces/i-ch5-keypad-attributes.d.ts +25 -0
- package/build_bundles/cjs/@types/ch5-keypad/interfaces/i-ch5-keypad-btn-attributes.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-keypad/interfaces/t-ch5-keypad.d.ts +15 -0
- package/build_bundles/cjs/@types/ch5-label/ch5-label.d.ts +40 -0
- package/build_bundles/cjs/@types/ch5-label/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-label/interfaces/i-ch5-label-attributes.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-list/animation/ch5-animation-factory.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-list/animation/ch5-animation.d.ts +18 -0
- package/build_bundles/cjs/@types/ch5-list/animation/ch5-standard-animation.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-list/ch5-list-abstract-helper.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-list/ch5-list-animation.d.ts +39 -0
- package/build_bundles/cjs/@types/ch5-list/ch5-list-buffered-items.d.ts +17 -0
- package/build_bundles/cjs/@types/ch5-list/ch5-list-event-manager.d.ts +25 -0
- package/build_bundles/cjs/@types/ch5-list/ch5-list-signal-manager.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-list/ch5-list-size-resolver.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-list/ch5-list-template.d.ts +53 -0
- package/build_bundles/cjs/@types/ch5-list/ch5-list.d.ts +283 -0
- package/build_bundles/cjs/@types/ch5-list/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-list/interfaces/i-ch5-list-attributes.d.ts +21 -0
- package/build_bundles/cjs/@types/ch5-list/interfaces/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-list/interfaces/t-ch5-list.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-list/passiveEventListeners.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-logger/appender/AbstractAppender.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-logger/appender/AppenderFactory.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-logger/appender/RemoteAppender.d.ts +18 -0
- package/build_bundles/cjs/@types/ch5-logger/enums/index.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-logger/helpers/LogMessage.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-logger/helpers/LogMessagesFilter.d.ts +17 -0
- package/build_bundles/cjs/@types/ch5-logger/helpers/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-logger/index.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-logger/logger/Logger.d.ts +33 -0
- package/build_bundles/cjs/@types/ch5-logger/logger/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-logger/services/RequestService.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-logger/services/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-logger/types/index.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-logger/utility/getLogger.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-logger/utility/getRemoteAppender.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-logger/utility/index.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-logger/utility/uriSchemaValidation.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-media-player/ch5-media-player-common.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-media-player/ch5-media-player-icon-button-base.d.ts +33 -0
- package/build_bundles/cjs/@types/ch5-media-player/ch5-media-player-my-music.d.ts +38 -0
- package/build_bundles/cjs/@types/ch5-media-player/ch5-media-player-now-playing.d.ts +68 -0
- package/build_bundles/cjs/@types/ch5-media-player/ch5-media-player.d.ts +83 -0
- package/build_bundles/cjs/@types/ch5-media-player/commonInterface.d.ts +133 -0
- package/build_bundles/cjs/@types/ch5-media-player/index.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-media-player/interfaces/i-ch5-media-player-attributes.d.ts +15 -0
- package/build_bundles/cjs/@types/ch5-media-player/interfaces/t-ch5-media-player.d.ts +27 -0
- package/build_bundles/cjs/@types/ch5-media-player/music-player.d.ts +64 -0
- package/build_bundles/cjs/@types/ch5-modal-dialog/ch5-modal-dialog.d.ts +103 -0
- package/build_bundles/cjs/@types/ch5-modal-dialog/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-modal-dialog/interfaces/i-ch5-modal-dialog-attributes.d.ts +30 -0
- package/build_bundles/cjs/@types/ch5-overlay-panel/ch5-overlay-panel.d.ts +93 -0
- package/build_bundles/cjs/@types/ch5-overlay-panel/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-overlay-panel/interfaces/i-ch5-overlay-panel-attributes.d.ts +17 -0
- package/build_bundles/cjs/@types/ch5-overlay-panel/interfaces/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-overlay-panel/interfaces/t-ch5-overlay-panel.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-qrcode/ch5-qrcode.d.ts +32 -0
- package/build_bundles/cjs/@types/ch5-qrcode/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-qrcode/interfaces/i-ch5-qrcode-attributes.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-resync/ch5-resync.d.ts +27 -0
- package/build_bundles/cjs/@types/ch5-resync/models/ch5-clear-range-data-model.d.ts +17 -0
- package/build_bundles/cjs/@types/ch5-resync/models/ch5-exclude-prefixes-model.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-resync/models/ch5-resync-constants.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-resync/models/ch5-resync-reset-event-names-enum.d.ts +8 -0
- package/build_bundles/cjs/@types/ch5-resync/models/ch5-states-at-default-value-model.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-resync/models/resynchronization-request-model.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-segmented-gauge/ch5-segmented-gauge.d.ts +86 -0
- package/build_bundles/cjs/@types/ch5-segmented-gauge/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-segmented-gauge/interfaces/i-ch5-segmented-gauge-attributes.d.ts +17 -0
- package/build_bundles/cjs/@types/ch5-segmented-gauge/interfaces/t-ch5-segmented-gauge.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-select/ch5-select.d.ts +203 -0
- package/build_bundles/cjs/@types/ch5-select/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-select/interfaces/i-ch5-select-attributes.d.ts +27 -0
- package/build_bundles/cjs/@types/ch5-select/interfaces/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-select/interfaces/t-ch5-select.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-select-option/ch5-select-option.d.ts +75 -0
- package/build_bundles/cjs/@types/ch5-select-option/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-select-option/interfaces/i-ch5-select-option-attributes.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-select-option/interfaces/types/t-ch5-select-option-icon-position.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-signal-level-gauge/ch5-signal-level-gauge.d.ts +53 -0
- package/build_bundles/cjs/@types/ch5-signal-level-gauge/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-signal-level-gauge/interfaces/i-ch5-signal-level-gauge-attributes.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-signal-level-gauge/interfaces/t-ch5-signal-level-gauge.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-slider/ch5-slider-button-label.d.ts +23 -0
- package/build_bundles/cjs/@types/ch5-slider/ch5-slider-button.d.ts +37 -0
- package/build_bundles/cjs/@types/ch5-slider/ch5-slider-title-label.d.ts +23 -0
- package/build_bundles/cjs/@types/ch5-slider/ch5-slider.d.ts +225 -0
- package/build_bundles/cjs/@types/ch5-slider/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/i-ch5-slider-attributes.d.ts +35 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/i-ch5-slider-button-attributes.d.ts +19 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/i-ch5-slider-button-documentation.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/i-ch5-slider-button-label-documentation.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/i-ch5-slider-documentation.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/i-ch5-slider-title-label-attributes.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/i-ch5-slider-title-label-documentation.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/index.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/t-ch5-slider-button.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-slider/interfaces/t-ch5-slider.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-spinner/ch5-mouse-velocity.d.ts +35 -0
- package/build_bundles/cjs/@types/ch5-spinner/ch5-spinner-events.d.ts +16 -0
- package/build_bundles/cjs/@types/ch5-spinner/ch5-spinner-mutation-observer.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-spinner/ch5-spinner-scroll.d.ts +44 -0
- package/build_bundles/cjs/@types/ch5-spinner/ch5-spinner-template.d.ts +58 -0
- package/build_bundles/cjs/@types/ch5-spinner/ch5-spinner.d.ts +145 -0
- package/build_bundles/cjs/@types/ch5-spinner/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-spinner/interfaces/i-ch5-spinner-attributes.d.ts +27 -0
- package/build_bundles/cjs/@types/ch5-spinner/interfaces/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-spinner/interfaces/t-ch5-spinner.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-subpage-reference-list/ch5-subpage-reference-list.d.ts +159 -0
- package/build_bundles/cjs/@types/ch5-subpage-reference-list/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-subpage-reference-list/interfaces/i-ch5-subpage-reference-list-attributes.d.ts +31 -0
- package/build_bundles/cjs/@types/ch5-subpage-reference-list/interfaces/t-ch5-subpage-reference-list.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-subpage-reference-list/refresh-ch5-subpage-reference-list.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-tab-button/ch5-tab-button-individual-button.d.ts +28 -0
- package/build_bundles/cjs/@types/ch5-tab-button/ch5-tab-button-label.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-tab-button/ch5-tab-button.d.ts +109 -0
- package/build_bundles/cjs/@types/ch5-tab-button/index.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-tab-button/interfaces/i-ch5-tab-button-attributes.d.ts +34 -0
- package/build_bundles/cjs/@types/ch5-tab-button/interfaces/i-ch5-tab-button-individual-button-attributes.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-tab-button/interfaces/t-ch5-tab-button.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-tab-button/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/cjs/@types/ch5-template/ch5-template-structure.d.ts +20 -0
- package/build_bundles/cjs/@types/ch5-template/ch5-template.d.ts +59 -0
- package/build_bundles/cjs/@types/ch5-template/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-template/interfaces/i-ch5-template-attributes.d.ts +14 -0
- package/build_bundles/cjs/@types/ch5-template/interfaces/t-ch5-template.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-template/refresh-ch5-template.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-text/ch5-text.d.ts +63 -0
- package/build_bundles/cjs/@types/ch5-text/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-text/interfaces/i-ch5-text-attributes.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-text/interfaces/t-ch5-text.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-textinput/ch5-textinput-mask.d.ts +69 -0
- package/build_bundles/cjs/@types/ch5-textinput/ch5-textinput.d.ts +135 -0
- package/build_bundles/cjs/@types/ch5-textinput/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-textinput/interfaces/i-ch5-text-input-attributes.d.ts +29 -0
- package/build_bundles/cjs/@types/ch5-textinput/interfaces/i-ch5-text-input.d.ts +7 -0
- package/build_bundles/cjs/@types/ch5-textinput/interfaces/index.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-textinput/interfaces/t-ch5-text-input.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-toggle/ch5-toggle.d.ts +95 -0
- package/build_bundles/cjs/@types/ch5-toggle/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-toggle/interfaces/i-ch5-toggle-attributes.d.ts +22 -0
- package/build_bundles/cjs/@types/ch5-toggle/interfaces/t-ch5-toggle.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-touch/ch5-touch-activity.d.ts +30 -0
- package/build_bundles/cjs/@types/ch5-touch/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-triggerview/ch5-triggerview-child.d.ts +36 -0
- package/build_bundles/cjs/@types/ch5-triggerview/ch5-triggerview-slides-manager.d.ts +48 -0
- package/build_bundles/cjs/@types/ch5-triggerview/ch5-triggerview-swiper.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-triggerview/ch5-triggerview.d.ts +73 -0
- package/build_bundles/cjs/@types/ch5-triggerview/index.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-triggerview/interfaces/i-ch5-triggerview-attributes.d.ts +10 -0
- package/build_bundles/cjs/@types/ch5-triggerview/interfaces/i-ch5-triggerview-child-attributes.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-triggerview/utils.d.ts +13 -0
- package/build_bundles/cjs/@types/ch5-video/ch5-video-snapshot.d.ts +18 -0
- package/build_bundles/cjs/@types/ch5-video/ch5-video-touch-manager.d.ts +12 -0
- package/build_bundles/cjs/@types/ch5-video/ch5-video-utils.d.ts +17 -0
- package/build_bundles/cjs/@types/ch5-video/ch5-video.d.ts +185 -0
- package/build_bundles/cjs/@types/ch5-video/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-video/interfaces/i-ch5-video-attributes.d.ts +39 -0
- package/build_bundles/cjs/@types/ch5-video/interfaces/i-ch5-video-documentation.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-video/interfaces/i-ch5-video-helper.d.ts +96 -0
- package/build_bundles/cjs/@types/ch5-video/interfaces/index.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-video/interfaces/t-ch5-video.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/ch5-video-switcher-screen-label.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/ch5-video-switcher-screen.d.ts +24 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/ch5-video-switcher-source-label.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/ch5-video-switcher-source.d.ts +25 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/ch5-video-switcher.d.ts +159 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/drag-drop-touch.d.ts +47 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/index.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-attributes.d.ts +29 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-documentation.d.ts +4 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-attributes.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-documentation.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-label-documentation.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-attributes.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-documentation.d.ts +3 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-label-documentation.d.ts +2 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/index.d.ts +9 -0
- package/build_bundles/cjs/@types/ch5-video-switcher/interfaces/t-ch5-video-switcher.d.ts +5 -0
- package/build_bundles/cjs/@types/ch5-wifi-signal-level-gauge/ch5-wifi-signal-level-gauge.d.ts +57 -0
- package/build_bundles/cjs/@types/ch5-wifi-signal-level-gauge/index.d.ts +1 -0
- package/build_bundles/cjs/@types/ch5-wifi-signal-level-gauge/interfaces/i-ch5-wifi-signal-level-gauge-attributes.d.ts +11 -0
- package/build_bundles/cjs/@types/ch5-wifi-signal-level-gauge/interfaces/t-ch5-wifi-signal-level-gauge.d.ts +3 -0
- package/build_bundles/cjs/@types/index.d.ts +45 -0
- package/build_bundles/cjs/@types/utility-models/ch5-role-attribute-mapping.d.ts +52 -0
- package/build_bundles/cjs/@types/utility-models/index.d.ts +1 -0
- package/build_bundles/cjs/cr-com-lib.js +2 -0
- package/build_bundles/cjs/cr-com-lib.js.LICENSE.txt +30 -0
- package/build_bundles/esm/_interfaces/index.d.ts +53 -0
- package/build_bundles/esm/ch5-animation/ch5-animation.d.ts +53 -0
- package/build_bundles/esm/ch5-animation/ch5-animation.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-animation/index.d.ts +1 -0
- package/build_bundles/esm/ch5-animation/interfaces/i-ch5-animation-attributes.d.ts +10 -0
- package/build_bundles/esm/ch5-animation/interfaces/i-ch5-animation-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-animation/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-animation/interfaces/t-ch5-animation.d.ts +2 -0
- package/build_bundles/esm/ch5-background/ch5-background.d.ts +114 -0
- package/build_bundles/esm/ch5-background/ch5-background.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-background/index.d.ts +1 -0
- package/build_bundles/esm/ch5-background/interfaces/i-ch5-background-attributes.d.ts +15 -0
- package/build_bundles/esm/ch5-background/interfaces/i-ch5-background-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-background/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-background/interfaces/t-ch5-background.d.ts +3 -0
- package/build_bundles/esm/ch5-base/ch5-base-class.d.ts +138 -0
- package/build_bundles/esm/ch5-base/ch5-base-log.d.ts +12 -0
- package/build_bundles/esm/ch5-button/ch5-button-base.d.ts +222 -0
- package/build_bundles/esm/ch5-button/ch5-button-label.d.ts +9 -0
- package/build_bundles/esm/ch5-button/ch5-button-mode-state.d.ts +42 -0
- package/build_bundles/esm/ch5-button/ch5-button-mode.d.ts +38 -0
- package/build_bundles/esm/ch5-button/ch5-button-pressinfo.d.ts +19 -0
- package/build_bundles/esm/ch5-button/ch5-button-signal.d.ts +16 -0
- package/build_bundles/esm/ch5-button/ch5-button-utils.d.ts +22 -0
- package/build_bundles/esm/ch5-button/ch5-button.d.ts +9 -0
- package/build_bundles/esm/ch5-button/ch5-button.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-button/index.d.ts +5 -0
- package/build_bundles/esm/ch5-button/interfaces/i-ch5-button-attributes.d.ts +40 -0
- package/build_bundles/esm/ch5-button/interfaces/i-ch5-button-documentation.d.ts +7 -0
- package/build_bundles/esm/ch5-button/interfaces/i-ch5-button-label-attributes.d.ts +2 -0
- package/build_bundles/esm/ch5-button/interfaces/i-ch5-button-mode-attributes.d.ts +3 -0
- package/build_bundles/esm/ch5-button/interfaces/i-ch5-button-mode-common.d.ts +14 -0
- package/build_bundles/esm/ch5-button/interfaces/i-ch5-button-mode-state-attributes.d.ts +5 -0
- package/build_bundles/esm/ch5-button/interfaces/i-ch5-button.d.ts +4 -0
- package/build_bundles/esm/ch5-button/interfaces/index.d.ts +5 -0
- package/build_bundles/esm/ch5-button/interfaces/t-ch5-button.d.ts +20 -0
- package/build_bundles/esm/ch5-button/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/esm/ch5-button-list/base-classes/ch5-button-list-base.d.ts +213 -0
- package/build_bundles/esm/ch5-button-list/base-classes/ch5-button-list-individual-button-base.d.ts +25 -0
- package/build_bundles/esm/ch5-button-list/base-classes/ch5-button-list-label-base.d.ts +7 -0
- package/build_bundles/esm/ch5-button-list/base-classes/ch5-button-list-mode-base.d.ts +43 -0
- package/build_bundles/esm/ch5-button-list/base-classes/ch5-button-list-mode-state-base.d.ts +47 -0
- package/build_bundles/esm/ch5-button-list/ch5-button-list-individual-button.d.ts +8 -0
- package/build_bundles/esm/ch5-button-list/ch5-button-list-label.d.ts +6 -0
- package/build_bundles/esm/ch5-button-list/ch5-button-list-mode-state.d.ts +8 -0
- package/build_bundles/esm/ch5-button-list/ch5-button-list-mode.d.ts +8 -0
- package/build_bundles/esm/ch5-button-list/ch5-button-list.d.ts +9 -0
- package/build_bundles/esm/ch5-button-list/ch5-button-list.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-button-list/index.d.ts +5 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-attributes.d.ts +56 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-individual-button-attributes.d.ts +6 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-individual-button-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-label-documentation.d.ts +2 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-mode-attributes.d.ts +13 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-mode-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-mode-state-attributes.d.ts +14 -0
- package/build_bundles/esm/ch5-button-list/interfaces/i-ch5-button-list-mode-state-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-button-list/interfaces/index.d.ts +10 -0
- package/build_bundles/esm/ch5-button-list/interfaces/t-ch5-button-list.d.ts +14 -0
- package/build_bundles/esm/ch5-button-list/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/esm/ch5-color-chip/ch5-color-chip.d.ts +51 -0
- package/build_bundles/esm/ch5-color-chip/ch5-color-chip.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-color-chip/index.d.ts +1 -0
- package/build_bundles/esm/ch5-color-chip/interfaces/i-ch5-color-chip-attributes.d.ts +12 -0
- package/build_bundles/esm/ch5-color-chip/interfaces/i-ch5-color-chip-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-color-chip/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-color-picker/ch5-color-picker.d.ts +61 -0
- package/build_bundles/esm/ch5-color-picker/ch5-color-picker.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-color-picker/color-picker.d.ts +10 -0
- package/build_bundles/esm/ch5-color-picker/index.d.ts +1 -0
- package/build_bundles/esm/ch5-color-picker/interfaces/i-ch5-color-picker-attributes.d.ts +10 -0
- package/build_bundles/esm/ch5-color-picker/interfaces/i-ch5-color-picker-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-color-picker/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-common/ch5-augment-var-signals-names.d.ts +12 -0
- package/build_bundles/esm/ch5-common/ch5-augment-var-signals-names.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-common/ch5-common-attributes.d.ts +15 -0
- package/build_bundles/esm/ch5-common/ch5-common-log.d.ts +12 -0
- package/build_bundles/esm/ch5-common/ch5-common-signal.d.ts +16 -0
- package/build_bundles/esm/ch5-common/ch5-common.d.ts +183 -0
- package/build_bundles/esm/ch5-common/ch5-config.d.ts +37 -0
- package/build_bundles/esm/ch5-common/ch5-log.d.ts +13 -0
- package/build_bundles/esm/ch5-common/ch5-mutation-observer.d.ts +19 -0
- package/build_bundles/esm/ch5-common/ch5-pressable-button.d.ts +44 -0
- package/build_bundles/esm/ch5-common/ch5-pressable-slider.d.ts +61 -0
- package/build_bundles/esm/ch5-common/ch5-pressable.d.ts +43 -0
- package/build_bundles/esm/ch5-common/ch5-signal-attribute-registry.d.ts +41 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-appendclasswheninviewport.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-customclass.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-customstyle.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-dir.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-id.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-noshowtype.d.ts +4 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatecustomclass.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatecustomstyle.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateenable.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatehidepulse.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateshow.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateshowpulse.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-sendeventonshow.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-attributes-show.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-class.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-debug.d.ts +4 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-disabled.d.ts +4 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-role.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/common/i-ch5-common-style.d.ts +3 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-button-list-attributes.d.ts +13 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-button-list-documentation.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-animation.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-animation.d.ts +10 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-color-chip.d.ts +10 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-datetime.d.ts +11 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-dpad-child.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-media-player.d.ts +12 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-set3.d.ts +11 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-template.d.ts +11 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-text.d.ts +12 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-toggle.d.ts +16 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-video-documentation.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-video-switcher.d.ts +13 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes-video.d.ts +13 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-attributes.d.ts +16 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-ch5-text.d.ts +16 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-color-chip.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-datetime.d.ts +7 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-documentation-media-player.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-documentation-text.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-documentation-toggle.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-documentation-video-switcher.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-set3.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common-wo-disable.d.ts +7 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-common.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-gestureable.d.ts +4 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-subpage-reference-list-attributes.d.ts +13 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-subpage-reference-list-documentation.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-tab-button-attributes.d.ts +13 -0
- package/build_bundles/esm/ch5-common/interfaces/i-ch5-tab-button-documentation.d.ts +8 -0
- package/build_bundles/esm/ch5-common/interfaces/index.d.ts +7 -0
- package/build_bundles/esm/ch5-common/interfaces/t-ch5-common.d.ts +8 -0
- package/build_bundles/esm/ch5-common/utils/animation/animator.d.ts +82 -0
- package/build_bundles/esm/ch5-common/utils/animation/user-scroll-events.d.ts +1 -0
- package/build_bundles/esm/ch5-common/utils/ch5-color-utils.d.ts +15 -0
- package/build_bundles/esm/ch5-common/utils/common-functions.d.ts +16 -0
- package/build_bundles/esm/ch5-common/utils/component-helper.d.ts +16 -0
- package/build_bundles/esm/ch5-common/utils/html-callback.d.ts +20 -0
- package/build_bundles/esm/ch5-common/utils/index.d.ts +1 -0
- package/build_bundles/esm/ch5-common/utils/math/easings.d.ts +30 -0
- package/build_bundles/esm/ch5-common/utils/orientation-helper.d.ts +7 -0
- package/build_bundles/esm/ch5-common/utils/tick.d.ts +3 -0
- package/build_bundles/esm/ch5-common/utils/viewport.d.ts +14 -0
- package/build_bundles/esm/ch5-common-input/ch5-common-input.d.ts +55 -0
- package/build_bundles/esm/ch5-common-input/index.d.ts +1 -0
- package/build_bundles/esm/ch5-common-input/interfaces/i-ch5-common-input-attributes.d.ts +6 -0
- package/build_bundles/esm/ch5-common-input/interfaces/i-ch5-common-input-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-common-input/interfaces/i-ch5-common-input.d.ts +5 -0
- package/build_bundles/esm/ch5-common-input/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-common-input/interfaces/t-ch5-common-input.d.ts +1 -0
- package/build_bundles/esm/ch5-core/ch5-component.d.ts +5 -0
- package/build_bundles/esm/ch5-core/ch5-core-intersection-observer.d.ts +14 -0
- package/build_bundles/esm/ch5-core/ch5-debug.d.ts +19 -0
- package/build_bundles/esm/ch5-core/ch5-heartbeat.d.ts +6 -0
- package/build_bundles/esm/ch5-core/ch5-platform.d.ts +15 -0
- package/build_bundles/esm/ch5-core/ch5-properties.d.ts +18 -0
- package/build_bundles/esm/ch5-core/ch5-property.d.ts +65 -0
- package/build_bundles/esm/ch5-core/ch5-signal-behavior-subject.d.ts +9 -0
- package/build_bundles/esm/ch5-core/ch5-signal-bridge-receive.d.ts +19 -0
- package/build_bundles/esm/ch5-core/ch5-signal-bridge.d.ts +18 -0
- package/build_bundles/esm/ch5-core/ch5-signal-factory.d.ts +17 -0
- package/build_bundles/esm/ch5-core/ch5-signal-factory.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-core/ch5-signal.d.ts +32 -0
- package/build_bundles/esm/ch5-core/ch5-translation-class.d.ts +8 -0
- package/build_bundles/esm/ch5-core/ch5-translation-configuration.d.ts +4 -0
- package/build_bundles/esm/ch5-core/ch5-translation-factory.d.ts +10 -0
- package/build_bundles/esm/ch5-core/ch5-translation-listeners.d.ts +11 -0
- package/build_bundles/esm/ch5-core/ch5-translation-utility.d.ts +19 -0
- package/build_bundles/esm/ch5-core/ch5-uid.d.ts +5 -0
- package/build_bundles/esm/ch5-core/ch5-uid.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-core/ch5-version.d.ts +4 -0
- package/build_bundles/esm/ch5-core/get-scrollable-parent.d.ts +1 -0
- package/build_bundles/esm/ch5-core/index.d.ts +32 -0
- package/build_bundles/esm/ch5-core/interfaces-sig-com.d.ts +53 -0
- package/build_bundles/esm/ch5-core/resize-observer.d.ts +1 -0
- package/build_bundles/esm/ch5-core/types/callbacks.d.ts +6 -0
- package/build_bundles/esm/ch5-core/types/ch5-platform-info.d.ts +13 -0
- package/build_bundles/esm/ch5-core/types/core.d.ts +19 -0
- package/build_bundles/esm/ch5-core/types/signal.table.d.ts +4 -0
- package/build_bundles/esm/ch5-core/types/signal.type.d.ts +20 -0
- package/build_bundles/esm/ch5-core/utility-functions/animate.d.ts +4 -0
- package/build_bundles/esm/ch5-core/utility-functions/components.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/debounce.d.ts +5 -0
- package/build_bundles/esm/ch5-core/utility-functions/get-signal.d.ts +6 -0
- package/build_bundles/esm/ch5-core/utility-functions/is-crestron-device.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/is-crestron-touchscreen.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/is-ios-device.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/is-mobile-device.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/is-safari-mobile.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/is-touch-device.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/publish-signal.d.ts +2 -0
- package/build_bundles/esm/ch5-core/utility-functions/signals.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/subscribe-in-view-port-change.d.ts +3 -0
- package/build_bundles/esm/ch5-core/utility-functions/subscribe-signal-script.d.ts +11 -0
- package/build_bundles/esm/ch5-core/utility-functions/subscribe-signal.d.ts +3 -0
- package/build_bundles/esm/ch5-core/utility-functions/textformat.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/translation-interface-register.d.ts +2 -0
- package/build_bundles/esm/ch5-core/utility-functions/trigger-translation.d.ts +1 -0
- package/build_bundles/esm/ch5-core/utility-functions/unsubscribe-signal.d.ts +2 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-appendclass.d.ts +11 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-appendstyle.d.ts +11 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-enable.d.ts +14 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-hidepulse.d.ts +18 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-i18n.d.ts +18 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-innerhtml.d.ts +11 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-log.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-mutation-observer.d.ts +18 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-show.d.ts +19 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-showpulse.d.ts +19 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-attrs-text-content.d.ts +11 -0
- package/build_bundles/esm/ch5-custom-attrs/ch5-custom-attributes.d.ts +22 -0
- package/build_bundles/esm/ch5-custom-attrs/index.d.ts +11 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/helpers/custom-attribute.d.ts +6 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/helpers/i-custom-attribute.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-appendclass.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-appendstyle.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-enable.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-hidepulse.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-i18n.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-innerhtml.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-keep-sig-subscription.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-noshow-type.d.ts +4 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-show.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-showpulse.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/i-ch5-attrs-text-content.d.ts +3 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/index.d.ts +14 -0
- package/build_bundles/esm/ch5-custom-attrs/interfaces/t-ch5-attrs.d.ts +12 -0
- package/build_bundles/esm/ch5-custom-attrs/utils/ch5-attrs-constants.d.ts +9 -0
- package/build_bundles/esm/ch5-custom-attrs/utils/ch5-attrs-utility.d.ts +1 -0
- package/build_bundles/esm/ch5-datetime/ch5-datetime.d.ts +66 -0
- package/build_bundles/esm/ch5-datetime/ch5-datetime.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-datetime/date-time-util.d.ts +1 -0
- package/build_bundles/esm/ch5-datetime/index.d.ts +1 -0
- package/build_bundles/esm/ch5-datetime/interfaces/i-ch5-datetime-attributes.d.ts +19 -0
- package/build_bundles/esm/ch5-datetime/interfaces/i-ch5-datetime-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-datetime/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-datetime/interfaces/t-ch5-datetime.d.ts +3 -0
- package/build_bundles/esm/ch5-dpad/ch5-dpad-button-base.d.ts +74 -0
- package/build_bundles/esm/ch5-dpad/ch5-dpad-button.d.ts +9 -0
- package/build_bundles/esm/ch5-dpad/ch5-dpad-utils.d.ts +16 -0
- package/build_bundles/esm/ch5-dpad/ch5-dpad.d.ts +85 -0
- package/build_bundles/esm/ch5-dpad/ch5-dpad.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-dpad/index.d.ts +1 -0
- package/build_bundles/esm/ch5-dpad/interfaces/i-ch5-dpad-attributes.d.ts +20 -0
- package/build_bundles/esm/ch5-dpad/interfaces/i-ch5-dpad-button-attributes.d.ts +3 -0
- package/build_bundles/esm/ch5-dpad/interfaces/i-ch5-dpad-button-base-attributes.d.ts +9 -0
- package/build_bundles/esm/ch5-dpad/interfaces/i-ch5-dpad-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-dpad/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-dpad/interfaces/t-ch5-dpad.d.ts +5 -0
- package/build_bundles/esm/ch5-emulator/ch5-emulator.d.ts +44 -0
- package/build_bundles/esm/ch5-emulator/ch5-emulator.s001-003.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-emulator/ch5-emulator.s004.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-emulator/ch5-emulator.s005.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-emulator/ch5-emulator.s006.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-emulator/ch5-emulator.s007.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-emulator/ch5-emulator.s008.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-emulator/ch5-emulator.s009.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-emulator/index.d.ts +1 -0
- package/build_bundles/esm/ch5-emulator/js-interface-mock.d.ts +16 -0
- package/build_bundles/esm/ch5-emulator/mocha.async.delay.d.ts +1 -0
- package/build_bundles/esm/ch5-form/ch5-form.d.ts +90 -0
- package/build_bundles/esm/ch5-form/ch5-form.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-form/index.d.ts +1 -0
- package/build_bundles/esm/ch5-form/interfaces/i-ch5-form-attributes.d.ts +16 -0
- package/build_bundles/esm/ch5-form/interfaces/i-ch5-form-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-form/interfaces/index.d.ts +1 -0
- package/build_bundles/esm/ch5-image/ch5-image-mode.d.ts +14 -0
- package/build_bundles/esm/ch5-image/ch5-image-uri-model.d.ts +23 -0
- package/build_bundles/esm/ch5-image/ch5-image.d.ts +140 -0
- package/build_bundles/esm/ch5-image/ch5-image.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-image/index.d.ts +2 -0
- package/build_bundles/esm/ch5-image/interfaces/i-ch5-image-attributes.d.ts +23 -0
- package/build_bundles/esm/ch5-image/interfaces/i-ch5-image-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-image/interfaces/i-ch5-image-mode-attributes.d.ts +3 -0
- package/build_bundles/esm/ch5-image/interfaces/i-ch5-image-mode-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-image/interfaces/i-ch5-image.d.ts +6 -0
- package/build_bundles/esm/ch5-image/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-import-htmlsnippet/ch5-import-htmlsnippet.d.ts +34 -0
- package/build_bundles/esm/ch5-import-htmlsnippet/ch5-import-htmlsnippet.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-import-htmlsnippet/index.d.ts +1 -0
- package/build_bundles/esm/ch5-import-htmlsnippet/interfaces/i-ch5-htmlsnippet-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-import-htmlsnippet/interfaces/i-ch5-import-htmlsnippet-attributes.d.ts +4 -0
- package/build_bundles/esm/ch5-import-htmlsnippet/interfaces/index.d.ts +1 -0
- package/build_bundles/esm/ch5-jointotext-boolean/ch5-jointotext-boolean.d.ts +27 -0
- package/build_bundles/esm/ch5-jointotext-boolean/ch5-jointotext-boolean.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-jointotext-boolean/index.d.ts +1 -0
- package/build_bundles/esm/ch5-jointotext-boolean/interfaces/i-ch5-jointotext-boolean-attributes.d.ts +7 -0
- package/build_bundles/esm/ch5-jointotext-boolean/interfaces/i-ch5-jointotext-boolean-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-jointotext-boolean/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-jointotext-numeric/ch5-jointotext-numeric.d.ts +47 -0
- package/build_bundles/esm/ch5-jointotext-numeric/ch5-jointotext-numeric.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/float-format.d.ts +12 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/hex-format.d.ts +7 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/numeric-format-factory.d.ts +8 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/numeric-format.d.ts +3 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/percentage-format.d.ts +10 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/raw-format.d.ts +5 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/signed-format.d.ts +7 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/time-format.d.ts +5 -0
- package/build_bundles/esm/ch5-jointotext-numeric/format/unsigned-format.d.ts +7 -0
- package/build_bundles/esm/ch5-jointotext-numeric/index.d.ts +1 -0
- package/build_bundles/esm/ch5-jointotext-numeric/interfaces/i-ch5-jointotext-numeric-attributes.d.ts +11 -0
- package/build_bundles/esm/ch5-jointotext-numeric/interfaces/i-ch5-jointotext-numeric-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-jointotext-numeric/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-jointotext-numeric/interfaces/t-ch5-jointotext-numeric.d.ts +1 -0
- package/build_bundles/esm/ch5-jointotext-string/ch5-jointotext-string.d.ts +25 -0
- package/build_bundles/esm/ch5-jointotext-string/ch5-jointotext-string.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-jointotext-string/index.d.ts +1 -0
- package/build_bundles/esm/ch5-jointotext-string/interfaces/i-ch5-jointotext-string-attributes.d.ts +6 -0
- package/build_bundles/esm/ch5-jointotext-string/interfaces/i-ch5-jointotext-string-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-jointotext-string/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-keypad/ch5-keypad-btn.d.ts +53 -0
- package/build_bundles/esm/ch5-keypad/ch5-keypad-utils.d.ts +14 -0
- package/build_bundles/esm/ch5-keypad/ch5-keypad.d.ts +98 -0
- package/build_bundles/esm/ch5-keypad/ch5-keypad.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-keypad/index.d.ts +1 -0
- package/build_bundles/esm/ch5-keypad/interfaces/i-ch5-keypad-attributes.d.ts +25 -0
- package/build_bundles/esm/ch5-keypad/interfaces/i-ch5-keypad-btn-attributes.d.ts +8 -0
- package/build_bundles/esm/ch5-keypad/interfaces/i-ch5-keypad-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-keypad/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-keypad/interfaces/t-ch5-keypad.d.ts +15 -0
- package/build_bundles/esm/ch5-label/ch5-label.d.ts +40 -0
- package/build_bundles/esm/ch5-label/ch5-label.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-label/index.d.ts +1 -0
- package/build_bundles/esm/ch5-label/interfaces/i-ch5-label-attributes.d.ts +5 -0
- package/build_bundles/esm/ch5-label/interfaces/i-ch5-label-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-label/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-list/animation/ch5-animation-factory.d.ts +4 -0
- package/build_bundles/esm/ch5-list/animation/ch5-animation.d.ts +18 -0
- package/build_bundles/esm/ch5-list/animation/ch5-standard-animation.d.ts +8 -0
- package/build_bundles/esm/ch5-list/animation/ch5-web-animation.d.ts +7 -0
- package/build_bundles/esm/ch5-list/ch5-list-abstract-helper.d.ts +14 -0
- package/build_bundles/esm/ch5-list/ch5-list-animation.d.ts +39 -0
- package/build_bundles/esm/ch5-list/ch5-list-buffered-items.d.ts +17 -0
- package/build_bundles/esm/ch5-list/ch5-list-event-manager.d.ts +25 -0
- package/build_bundles/esm/ch5-list/ch5-list-log.d.ts +4 -0
- package/build_bundles/esm/ch5-list/ch5-list-signal-manager.d.ts +12 -0
- package/build_bundles/esm/ch5-list/ch5-list-size-resolver.d.ts +16 -0
- package/build_bundles/esm/ch5-list/ch5-list-template.d.ts +53 -0
- package/build_bundles/esm/ch5-list/ch5-list.d.ts +283 -0
- package/build_bundles/esm/ch5-list/ch5-list.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-list/index.d.ts +1 -0
- package/build_bundles/esm/ch5-list/interfaces/i-ch5-list-attributes.d.ts +21 -0
- package/build_bundles/esm/ch5-list/interfaces/i-ch5-list-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-list/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-list/interfaces/t-ch5-list.d.ts +1 -0
- package/build_bundles/esm/ch5-list/passiveEventListeners.d.ts +3 -0
- package/build_bundles/esm/ch5-logger/appender/AbstractAppender.d.ts +13 -0
- package/build_bundles/esm/ch5-logger/appender/AppenderFactory.d.ts +6 -0
- package/build_bundles/esm/ch5-logger/appender/RemoteAppender.d.ts +18 -0
- package/build_bundles/esm/ch5-logger/enums/index.d.ts +13 -0
- package/build_bundles/esm/ch5-logger/helpers/LogMessage.d.ts +12 -0
- package/build_bundles/esm/ch5-logger/helpers/LogMessagesFilter.d.ts +17 -0
- package/build_bundles/esm/ch5-logger/helpers/index.d.ts +2 -0
- package/build_bundles/esm/ch5-logger/index.d.ts +3 -0
- package/build_bundles/esm/ch5-logger/logger/Logger.d.ts +33 -0
- package/build_bundles/esm/ch5-logger/logger/index.d.ts +1 -0
- package/build_bundles/esm/ch5-logger/services/RequestService.d.ts +11 -0
- package/build_bundles/esm/ch5-logger/services/index.d.ts +1 -0
- package/build_bundles/esm/ch5-logger/tests/filterMessage.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-logger/types/index.d.ts +12 -0
- package/build_bundles/esm/ch5-logger/utility/getLogger.d.ts +4 -0
- package/build_bundles/esm/ch5-logger/utility/getRemoteAppender.d.ts +2 -0
- package/build_bundles/esm/ch5-logger/utility/index.d.ts +3 -0
- package/build_bundles/esm/ch5-logger/utility/uriSchemaValidation.d.ts +1 -0
- package/build_bundles/esm/ch5-media-player/ch5-media-player-common.d.ts +4 -0
- package/build_bundles/esm/ch5-media-player/ch5-media-player-icon-button-base.d.ts +33 -0
- package/build_bundles/esm/ch5-media-player/ch5-media-player-my-music.d.ts +38 -0
- package/build_bundles/esm/ch5-media-player/ch5-media-player-now-playing.d.ts +68 -0
- package/build_bundles/esm/ch5-media-player/ch5-media-player.d.ts +83 -0
- package/build_bundles/esm/ch5-media-player/commonInterface.d.ts +133 -0
- package/build_bundles/esm/ch5-media-player/index.d.ts +3 -0
- package/build_bundles/esm/ch5-media-player/interfaces/i-ch5-media-player-attributes.d.ts +15 -0
- package/build_bundles/esm/ch5-media-player/interfaces/i-ch5-media-player-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-media-player/interfaces/i-ch5-media-player-my-music-documentation.d.ts +2 -0
- package/build_bundles/esm/ch5-media-player/interfaces/i-ch5-media-player-now-playing-documentation.d.ts +2 -0
- package/build_bundles/esm/ch5-media-player/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-media-player/interfaces/t-ch5-media-player.d.ts +27 -0
- package/build_bundles/esm/ch5-media-player/music-player.d.ts +64 -0
- package/build_bundles/esm/ch5-modal-dialog/ch5-modal-dialog.d.ts +103 -0
- package/build_bundles/esm/ch5-modal-dialog/ch5-modal-dialog.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-modal-dialog/index.d.ts +1 -0
- package/build_bundles/esm/ch5-modal-dialog/interfaces/i-ch5-modal-dialog-attributes.d.ts +30 -0
- package/build_bundles/esm/ch5-modal-dialog/interfaces/i-ch5-modal-dialog-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-modal-dialog/interfaces/index.d.ts +1 -0
- package/build_bundles/esm/ch5-overlay-panel/ch5-overlay-panel.d.ts +93 -0
- package/build_bundles/esm/ch5-overlay-panel/ch5-overlay-panel.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-overlay-panel/index.d.ts +1 -0
- package/build_bundles/esm/ch5-overlay-panel/interfaces/i-ch5-overlay-panel-attributes.d.ts +17 -0
- package/build_bundles/esm/ch5-overlay-panel/interfaces/i-ch5-overlay-panel-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-overlay-panel/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-overlay-panel/interfaces/t-ch5-overlay-panel.d.ts +3 -0
- package/build_bundles/esm/ch5-qrcode/ch5-qrcode-properties.d.ts +0 -0
- package/build_bundles/esm/ch5-qrcode/ch5-qrcode.d.ts +32 -0
- package/build_bundles/esm/ch5-qrcode/ch5-qrcode.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-qrcode/index.d.ts +1 -0
- package/build_bundles/esm/ch5-qrcode/interfaces/i-ch5-qrcode-attributes.d.ts +12 -0
- package/build_bundles/esm/ch5-qrcode/interfaces/i-ch5-qrcode-documentation.d.ts +7 -0
- package/build_bundles/esm/ch5-qrcode/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-resync/ch5-resync.d.ts +27 -0
- package/build_bundles/esm/ch5-resync/ch5-resync.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-resync/models/ch5-clear-range-data-model.d.ts +17 -0
- package/build_bundles/esm/ch5-resync/models/ch5-exclude-prefixes-model.d.ts +3 -0
- package/build_bundles/esm/ch5-resync/models/ch5-resync-constants.d.ts +3 -0
- package/build_bundles/esm/ch5-resync/models/ch5-resync-reset-event-names-enum.d.ts +8 -0
- package/build_bundles/esm/ch5-resync/models/ch5-states-at-default-value-model.d.ts +2 -0
- package/build_bundles/esm/ch5-resync/models/resynchronization-request-model.d.ts +9 -0
- package/build_bundles/esm/ch5-segmented-gauge/ch5-segmented-gauge.d.ts +86 -0
- package/build_bundles/esm/ch5-segmented-gauge/ch5-segmented-gauge.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-segmented-gauge/index.d.ts +1 -0
- package/build_bundles/esm/ch5-segmented-gauge/interfaces/i-ch5-segmented-gauge-attributes.d.ts +17 -0
- package/build_bundles/esm/ch5-segmented-gauge/interfaces/i-ch5-segmented-gauge-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-segmented-gauge/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-segmented-gauge/interfaces/t-ch5-segmented-gauge.d.ts +3 -0
- package/build_bundles/esm/ch5-select/ch5-select.d.ts +203 -0
- package/build_bundles/esm/ch5-select/ch5-select.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-select/index.d.ts +1 -0
- package/build_bundles/esm/ch5-select/interfaces/i-ch5-select-attributes.d.ts +27 -0
- package/build_bundles/esm/ch5-select/interfaces/i-ch5-select-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-select/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-select/interfaces/t-ch5-select.d.ts +2 -0
- package/build_bundles/esm/ch5-select-option/ch5-select-option.d.ts +75 -0
- package/build_bundles/esm/ch5-select-option/ch5-select-option.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-select-option/index.d.ts +1 -0
- package/build_bundles/esm/ch5-select-option/interfaces/i-ch5-select-option-attributes.d.ts +11 -0
- package/build_bundles/esm/ch5-select-option/interfaces/i-ch5-select-option-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-select-option/interfaces/index.d.ts +1 -0
- package/build_bundles/esm/ch5-select-option/interfaces/types/t-ch5-select-option-icon-position.d.ts +1 -0
- package/build_bundles/esm/ch5-signal-level-gauge/ch5-signal-level-gauge.d.ts +53 -0
- package/build_bundles/esm/ch5-signal-level-gauge/ch5-signal-level-gauge.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-signal-level-gauge/index.d.ts +1 -0
- package/build_bundles/esm/ch5-signal-level-gauge/interfaces/i-ch5-signal-level-gauge-attributes.d.ts +12 -0
- package/build_bundles/esm/ch5-signal-level-gauge/interfaces/i-ch5-signal-level-gauge-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-signal-level-gauge/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-signal-level-gauge/interfaces/t-ch5-signal-level-gauge.d.ts +2 -0
- package/build_bundles/esm/ch5-slider/ch5-slider-button-label.d.ts +23 -0
- package/build_bundles/esm/ch5-slider/ch5-slider-button.d.ts +37 -0
- package/build_bundles/esm/ch5-slider/ch5-slider-title-label.d.ts +23 -0
- package/build_bundles/esm/ch5-slider/ch5-slider.d.ts +225 -0
- package/build_bundles/esm/ch5-slider/ch5-slider.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-slider/index.d.ts +2 -0
- package/build_bundles/esm/ch5-slider/interfaces/i-ch5-slider-attributes.d.ts +35 -0
- package/build_bundles/esm/ch5-slider/interfaces/i-ch5-slider-button-attributes.d.ts +19 -0
- package/build_bundles/esm/ch5-slider/interfaces/i-ch5-slider-button-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-slider/interfaces/i-ch5-slider-button-label-documentation.d.ts +2 -0
- package/build_bundles/esm/ch5-slider/interfaces/i-ch5-slider-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-slider/interfaces/i-ch5-slider-title-label-attributes.d.ts +5 -0
- package/build_bundles/esm/ch5-slider/interfaces/i-ch5-slider-title-label-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-slider/interfaces/index.d.ts +9 -0
- package/build_bundles/esm/ch5-slider/interfaces/t-ch5-slider-button.d.ts +6 -0
- package/build_bundles/esm/ch5-slider/interfaces/t-ch5-slider.d.ts +11 -0
- package/build_bundles/esm/ch5-spinner/ch5-mouse-velocity.d.ts +35 -0
- package/build_bundles/esm/ch5-spinner/ch5-spinner-events.d.ts +16 -0
- package/build_bundles/esm/ch5-spinner/ch5-spinner-mutation-observer.d.ts +7 -0
- package/build_bundles/esm/ch5-spinner/ch5-spinner-scroll.d.ts +44 -0
- package/build_bundles/esm/ch5-spinner/ch5-spinner-template.d.ts +58 -0
- package/build_bundles/esm/ch5-spinner/ch5-spinner.d.ts +145 -0
- package/build_bundles/esm/ch5-spinner/ch5-spinner.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-spinner/index.d.ts +1 -0
- package/build_bundles/esm/ch5-spinner/interfaces/i-ch5-spinner-attributes.d.ts +27 -0
- package/build_bundles/esm/ch5-spinner/interfaces/i-ch5-spinner-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-spinner/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-spinner/interfaces/t-ch5-spinner.d.ts +2 -0
- package/build_bundles/esm/ch5-subpage-reference-list/ch5-subpage-reference-list.d.ts +159 -0
- package/build_bundles/esm/ch5-subpage-reference-list/ch5-subpage-reference-list.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-subpage-reference-list/index.d.ts +2 -0
- package/build_bundles/esm/ch5-subpage-reference-list/interfaces/i-ch5-subpage-reference-list-attributes.d.ts +31 -0
- package/build_bundles/esm/ch5-subpage-reference-list/interfaces/i-ch5-subpage-reference-list-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-subpage-reference-list/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-subpage-reference-list/interfaces/t-ch5-subpage-reference-list.d.ts +3 -0
- package/build_bundles/esm/ch5-subpage-reference-list/refresh-ch5-subpage-reference-list.d.ts +3 -0
- package/build_bundles/esm/ch5-tab-button/ch5-tab-button-individual-button.d.ts +28 -0
- package/build_bundles/esm/ch5-tab-button/ch5-tab-button-label.d.ts +6 -0
- package/build_bundles/esm/ch5-tab-button/ch5-tab-button.d.ts +109 -0
- package/build_bundles/esm/ch5-tab-button/ch5-tab-button.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-tab-button/index.d.ts +3 -0
- package/build_bundles/esm/ch5-tab-button/interfaces/i-ch5-tab-button-attributes.d.ts +34 -0
- package/build_bundles/esm/ch5-tab-button/interfaces/i-ch5-tab-button-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-tab-button/interfaces/i-ch5-tab-button-individual-button-attributes.d.ts +6 -0
- package/build_bundles/esm/ch5-tab-button/interfaces/i-ch5-tab-button-individual-button-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-tab-button/interfaces/i-ch5-tab-button-label-documentation.d.ts +2 -0
- package/build_bundles/esm/ch5-tab-button/interfaces/index.d.ts +5 -0
- package/build_bundles/esm/ch5-tab-button/interfaces/t-ch5-tab-button.d.ts +7 -0
- package/build_bundles/esm/ch5-tab-button/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/esm/ch5-template/ch5-template-structure.d.ts +20 -0
- package/build_bundles/esm/ch5-template/ch5-template.d.ts +59 -0
- package/build_bundles/esm/ch5-template/ch5-template.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-template/index.d.ts +2 -0
- package/build_bundles/esm/ch5-template/interfaces/i-ch5-template-attributes.d.ts +14 -0
- package/build_bundles/esm/ch5-template/interfaces/i-ch5-template-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-template/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-template/interfaces/t-ch5-template.d.ts +3 -0
- package/build_bundles/esm/ch5-template/refresh-ch5-template.d.ts +3 -0
- package/build_bundles/esm/ch5-text/ch5-text.d.ts +63 -0
- package/build_bundles/esm/ch5-text/ch5-text.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-text/index.d.ts +1 -0
- package/build_bundles/esm/ch5-text/interfaces/i-ch5-text-attributes.d.ts +12 -0
- package/build_bundles/esm/ch5-text/interfaces/i-ch5-text-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-text/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-text/interfaces/t-ch5-text.d.ts +2 -0
- package/build_bundles/esm/ch5-textinput/ch5-textinput-mask.d.ts +69 -0
- package/build_bundles/esm/ch5-textinput/ch5-textinput.d.ts +135 -0
- package/build_bundles/esm/ch5-textinput/ch5-textinput.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-textinput/index.d.ts +1 -0
- package/build_bundles/esm/ch5-textinput/interfaces/i-ch5-text-input-attributes.d.ts +29 -0
- package/build_bundles/esm/ch5-textinput/interfaces/i-ch5-text-input-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-textinput/interfaces/i-ch5-text-input.d.ts +7 -0
- package/build_bundles/esm/ch5-textinput/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-textinput/interfaces/t-ch5-text-input.d.ts +5 -0
- package/build_bundles/esm/ch5-toggle/ch5-toggle.d.ts +95 -0
- package/build_bundles/esm/ch5-toggle/ch5-toggle.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-toggle/index.d.ts +1 -0
- package/build_bundles/esm/ch5-toggle/interfaces/i-ch5-toggle-attributes.d.ts +22 -0
- package/build_bundles/esm/ch5-toggle/interfaces/i-ch5-toggle-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-toggle/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-toggle/interfaces/t-ch5-toggle.d.ts +4 -0
- package/build_bundles/esm/ch5-touch/ch5-touch-activity.d.ts +30 -0
- package/build_bundles/esm/ch5-touch/index.d.ts +1 -0
- package/build_bundles/esm/ch5-triggerview/ch5-triggerview-child.d.ts +36 -0
- package/build_bundles/esm/ch5-triggerview/ch5-triggerview-slides-manager.d.ts +48 -0
- package/build_bundles/esm/ch5-triggerview/ch5-triggerview-swiper.d.ts +9 -0
- package/build_bundles/esm/ch5-triggerview/ch5-triggerview.d.ts +73 -0
- package/build_bundles/esm/ch5-triggerview/ch5-triggerview.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-triggerview/index.d.ts +2 -0
- package/build_bundles/esm/ch5-triggerview/interfaces/i-ch5-triggerview-attributes.d.ts +10 -0
- package/build_bundles/esm/ch5-triggerview/interfaces/i-ch5-triggerview-child-attributes.d.ts +5 -0
- package/build_bundles/esm/ch5-triggerview/interfaces/i-ch5-triggerview-child-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-triggerview/interfaces/i-ch5-triggerview-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-triggerview/interfaces/index.d.ts +2 -0
- package/build_bundles/esm/ch5-triggerview/utils.d.ts +13 -0
- package/build_bundles/esm/ch5-video/ch5-video-snapshot.d.ts +18 -0
- package/build_bundles/esm/ch5-video/ch5-video-touch-manager.d.ts +12 -0
- package/build_bundles/esm/ch5-video/ch5-video-utils.d.ts +17 -0
- package/build_bundles/esm/ch5-video/ch5-video.d.ts +185 -0
- package/build_bundles/esm/ch5-video/ch5-video.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-video/index.d.ts +1 -0
- package/build_bundles/esm/ch5-video/interfaces/i-ch5-video-attributes.d.ts +39 -0
- package/build_bundles/esm/ch5-video/interfaces/i-ch5-video-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-video/interfaces/i-ch5-video-helper.d.ts +96 -0
- package/build_bundles/esm/ch5-video/interfaces/index.d.ts +4 -0
- package/build_bundles/esm/ch5-video/interfaces/t-ch5-video.d.ts +3 -0
- package/build_bundles/esm/ch5-video-switcher/ch5-video-switcher-screen-label.d.ts +9 -0
- package/build_bundles/esm/ch5-video-switcher/ch5-video-switcher-screen.d.ts +24 -0
- package/build_bundles/esm/ch5-video-switcher/ch5-video-switcher-source-label.d.ts +9 -0
- package/build_bundles/esm/ch5-video-switcher/ch5-video-switcher-source.d.ts +25 -0
- package/build_bundles/esm/ch5-video-switcher/ch5-video-switcher.d.ts +159 -0
- package/build_bundles/esm/ch5-video-switcher/ch5-video-switcher.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-video-switcher/drag-drop-touch.d.ts +47 -0
- package/build_bundles/esm/ch5-video-switcher/index.d.ts +5 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/i-ch5-video-switcher-attributes.d.ts +29 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/i-ch5-video-switcher-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-attributes.d.ts +5 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-label-documentation.d.ts +2 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-attributes.d.ts +5 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-documentation.d.ts +3 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-label-documentation.d.ts +2 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/index.d.ts +9 -0
- package/build_bundles/esm/ch5-video-switcher/interfaces/t-ch5-video-switcher.d.ts +5 -0
- package/build_bundles/esm/ch5-wifi-signal-level-gauge/ch5-wifi-signal-level-gauge.d.ts +57 -0
- package/build_bundles/esm/ch5-wifi-signal-level-gauge/ch5-wifi-signal-level-gauge.spec.d.ts +1 -0
- package/build_bundles/esm/ch5-wifi-signal-level-gauge/index.d.ts +1 -0
- package/build_bundles/esm/ch5-wifi-signal-level-gauge/interfaces/i-ch5-wifi-signal-level-gauge-attributes.d.ts +11 -0
- package/build_bundles/esm/ch5-wifi-signal-level-gauge/interfaces/i-ch5-wifi-signal-level-gauge-documentation.d.ts +4 -0
- package/build_bundles/esm/ch5-wifi-signal-level-gauge/interfaces/index.d.ts +3 -0
- package/build_bundles/esm/ch5-wifi-signal-level-gauge/interfaces/t-ch5-wifi-signal-level-gauge.d.ts +3 -0
- package/build_bundles/esm/index.d.ts +45 -0
- package/build_bundles/esm/index.js +1 -0
- package/build_bundles/esm/utility-models/ch5-role-attribute-mapping.d.ts +52 -0
- package/build_bundles/esm/utility-models/index.d.ts +1 -0
- package/build_bundles/generate-metadata/icon-library.json +29566 -0
- package/build_bundles/generate-metadata/sass-metadata.json +85433 -0
- package/build_bundles/generate-metadata/sass-output.json +137182 -0
- package/build_bundles/generate-metadata/sass-schema.json +2892 -0
- package/build_bundles/generate-metadata/schema.json +27380 -0
- package/build_bundles/umd/@types/ch5-animation/ch5-animation.d.ts +53 -0
- package/build_bundles/umd/@types/ch5-animation/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-animation/interfaces/i-ch5-animation-attributes.d.ts +10 -0
- package/build_bundles/umd/@types/ch5-animation/interfaces/t-ch5-animation.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-background/ch5-background.d.ts +114 -0
- package/build_bundles/umd/@types/ch5-background/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-background/interfaces/i-ch5-background-attributes.d.ts +15 -0
- package/build_bundles/umd/@types/ch5-background/interfaces/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-background/interfaces/t-ch5-background.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-base/ch5-base-class.d.ts +138 -0
- package/build_bundles/umd/@types/ch5-base/ch5-base-log.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-button/ch5-button-base.d.ts +222 -0
- package/build_bundles/umd/@types/ch5-button/ch5-button-label.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-button/ch5-button-mode-state.d.ts +42 -0
- package/build_bundles/umd/@types/ch5-button/ch5-button-mode.d.ts +38 -0
- package/build_bundles/umd/@types/ch5-button/ch5-button-signal.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-button/ch5-button-utils.d.ts +22 -0
- package/build_bundles/umd/@types/ch5-button/ch5-button.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-button/index.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-button/interfaces/i-ch5-button-attributes.d.ts +40 -0
- package/build_bundles/umd/@types/ch5-button/interfaces/i-ch5-button-label-attributes.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-button/interfaces/i-ch5-button-mode-attributes.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-button/interfaces/i-ch5-button-mode-common.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-button/interfaces/i-ch5-button-mode-state-attributes.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-button/interfaces/index.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-button/interfaces/t-ch5-button.d.ts +20 -0
- package/build_bundles/umd/@types/ch5-button/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-button-list/base-classes/ch5-button-list-base.d.ts +213 -0
- package/build_bundles/umd/@types/ch5-button-list/base-classes/ch5-button-list-individual-button-base.d.ts +25 -0
- package/build_bundles/umd/@types/ch5-button-list/base-classes/ch5-button-list-label-base.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-button-list/base-classes/ch5-button-list-mode-base.d.ts +43 -0
- package/build_bundles/umd/@types/ch5-button-list/base-classes/ch5-button-list-mode-state-base.d.ts +47 -0
- package/build_bundles/umd/@types/ch5-button-list/ch5-button-list-individual-button.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-button-list/ch5-button-list-label.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-button-list/ch5-button-list-mode-state.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-button-list/ch5-button-list-mode.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-button-list/ch5-button-list.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-button-list/index.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-button-list/interfaces/i-ch5-button-list-attributes.d.ts +56 -0
- package/build_bundles/umd/@types/ch5-button-list/interfaces/i-ch5-button-list-individual-button-attributes.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-button-list/interfaces/i-ch5-button-list-label-documentation.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-button-list/interfaces/i-ch5-button-list-mode-attributes.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-button-list/interfaces/i-ch5-button-list-mode-state-attributes.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-button-list/interfaces/t-ch5-button-list.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-button-list/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-color-chip/ch5-color-chip.d.ts +51 -0
- package/build_bundles/umd/@types/ch5-color-chip/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-color-chip/interfaces/i-ch5-color-chip-attributes.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-color-picker/ch5-color-picker.d.ts +61 -0
- package/build_bundles/umd/@types/ch5-color-picker/color-picker.d.ts +10 -0
- package/build_bundles/umd/@types/ch5-color-picker/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-color-picker/interfaces/i-ch5-color-picker-attributes.d.ts +10 -0
- package/build_bundles/umd/@types/ch5-common/ch5-augment-var-signals-names.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-common/ch5-common-log.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-common/ch5-common.d.ts +183 -0
- package/build_bundles/umd/@types/ch5-common/ch5-config.d.ts +37 -0
- package/build_bundles/umd/@types/ch5-common/ch5-log.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-common/ch5-mutation-observer.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-common/ch5-pressable-slider.d.ts +61 -0
- package/build_bundles/umd/@types/ch5-common/ch5-pressable.d.ts +43 -0
- package/build_bundles/umd/@types/ch5-common/ch5-signal-attribute-registry.d.ts +41 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-appendclasswheninviewport.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-customclass.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-customstyle.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-dir.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-id.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-noshowtype.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatecustomclass.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatecustomstyle.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateenable.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestatehidepulse.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateshow.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-receivestateshowpulse.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-sendeventonshow.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-attributes-show.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-class.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-debug.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-disabled.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-role.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/common/i-ch5-common-style.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-button-list-attributes.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-animation.d.ts +10 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-color-chip.d.ts +10 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-datetime.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-dpad-child.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-media-player.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-set3.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-template.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-text.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-toggle.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-video-documentation.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-video-switcher.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes-video.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-attributes.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common-documentation-video-switcher.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-common.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-gestureable.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-subpage-reference-list-attributes.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/i-ch5-tab-button-attributes.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/index.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-common/interfaces/t-ch5-common.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-common/utils/ch5-color-utils.d.ts +15 -0
- package/build_bundles/umd/@types/ch5-common/utils/common-functions.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-common/utils/component-helper.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-common/utils/html-callback.d.ts +20 -0
- package/build_bundles/umd/@types/ch5-common/utils/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-common-input/ch5-common-input.d.ts +55 -0
- package/build_bundles/umd/@types/ch5-common-input/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-common-input/interfaces/i-ch5-common-input-attributes.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-common-input/interfaces/i-ch5-common-input.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-common-input/interfaces/t-ch5-common-input.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/ch5-component.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-core/ch5-core-intersection-observer.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-core/ch5-debug.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-core/ch5-heartbeat.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-core/ch5-platform.d.ts +15 -0
- package/build_bundles/umd/@types/ch5-core/ch5-properties.d.ts +18 -0
- package/build_bundles/umd/@types/ch5-core/ch5-property.d.ts +65 -0
- package/build_bundles/umd/@types/ch5-core/ch5-signal-behavior-subject.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-core/ch5-signal-bridge-receive.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-core/ch5-signal-bridge.d.ts +18 -0
- package/build_bundles/umd/@types/ch5-core/ch5-signal-factory.d.ts +17 -0
- package/build_bundles/umd/@types/ch5-core/ch5-signal.d.ts +32 -0
- package/build_bundles/umd/@types/ch5-core/ch5-translation-configuration.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-core/ch5-translation-factory.d.ts +10 -0
- package/build_bundles/umd/@types/ch5-core/ch5-translation-listeners.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-core/ch5-translation-utility.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-core/ch5-uid.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-core/ch5-version.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-core/index.d.ts +32 -0
- package/build_bundles/umd/@types/ch5-core/interfaces-sig-com.d.ts +53 -0
- package/build_bundles/umd/@types/ch5-core/resize-observer.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/types/callbacks.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-core/types/ch5-platform-info.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-core/types/core.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-core/types/signal.type.d.ts +20 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/animate.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/components.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/debounce.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/get-signal.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/is-crestron-device.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/is-crestron-touchscreen.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/is-ios-device.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/is-safari-mobile.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/publish-signal.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/signals.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/subscribe-in-view-port-change.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/subscribe-signal-script.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/subscribe-signal.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/textformat.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/translation-interface-register.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/trigger-translation.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-core/utility-functions/unsubscribe-signal.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-appendclass.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-appendstyle.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-enable.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-hidepulse.d.ts +18 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-i18n.d.ts +18 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-innerhtml.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-log.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-mutation-observer.d.ts +18 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-show.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-showpulse.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-attrs-text-content.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/ch5-custom-attributes.d.ts +22 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/index.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/helpers/custom-attribute.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/helpers/i-custom-attribute.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-appendclass.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-appendstyle.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-enable.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-hidepulse.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-i18n.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-innerhtml.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-keep-sig-subscription.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-noshow-type.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-show.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-showpulse.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/i-ch5-attrs-text-content.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/index.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/interfaces/t-ch5-attrs.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/utils/ch5-attrs-constants.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-custom-attrs/utils/ch5-attrs-utility.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-datetime/ch5-datetime.d.ts +66 -0
- package/build_bundles/umd/@types/ch5-datetime/date-time-util.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-datetime/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-datetime/interfaces/i-ch5-datetime-attributes.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-datetime/interfaces/t-ch5-datetime.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-dpad/ch5-dpad-button-base.d.ts +74 -0
- package/build_bundles/umd/@types/ch5-dpad/ch5-dpad-button.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-dpad/ch5-dpad-utils.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-dpad/ch5-dpad.d.ts +85 -0
- package/build_bundles/umd/@types/ch5-dpad/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-dpad/interfaces/i-ch5-dpad-attributes.d.ts +20 -0
- package/build_bundles/umd/@types/ch5-dpad/interfaces/i-ch5-dpad-button-base-attributes.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-dpad/interfaces/t-ch5-dpad.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-emulator/ch5-emulator.d.ts +44 -0
- package/build_bundles/umd/@types/ch5-emulator/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-form/ch5-form.d.ts +90 -0
- package/build_bundles/umd/@types/ch5-form/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-form/interfaces/i-ch5-form-attributes.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-image/ch5-image-mode.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-image/ch5-image-uri-model.d.ts +23 -0
- package/build_bundles/umd/@types/ch5-image/ch5-image.d.ts +140 -0
- package/build_bundles/umd/@types/ch5-image/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-image/interfaces/i-ch5-image-attributes.d.ts +23 -0
- package/build_bundles/umd/@types/ch5-image/interfaces/i-ch5-image-mode-attributes.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-import-htmlsnippet/ch5-import-htmlsnippet.d.ts +34 -0
- package/build_bundles/umd/@types/ch5-import-htmlsnippet/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-import-htmlsnippet/interfaces/i-ch5-import-htmlsnippet-attributes.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-jointotext-boolean/ch5-jointotext-boolean.d.ts +27 -0
- package/build_bundles/umd/@types/ch5-jointotext-boolean/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-jointotext-boolean/interfaces/i-ch5-jointotext-boolean-attributes.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-jointotext-boolean/interfaces/i-ch5-jointotext-boolean-documentation.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-jointotext-boolean/interfaces/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/ch5-jointotext-numeric.d.ts +47 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/float-format.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/hex-format.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/numeric-format-factory.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/numeric-format.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/percentage-format.d.ts +10 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/raw-format.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/signed-format.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/time-format.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/format/unsigned-format.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/interfaces/i-ch5-jointotext-numeric-attributes.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-jointotext-numeric/interfaces/t-ch5-jointotext-numeric.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-jointotext-string/ch5-jointotext-string.d.ts +25 -0
- package/build_bundles/umd/@types/ch5-jointotext-string/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-jointotext-string/interfaces/i-ch5-jointotext-string-attributes.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-keypad/ch5-keypad-btn.d.ts +53 -0
- package/build_bundles/umd/@types/ch5-keypad/ch5-keypad-utils.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-keypad/ch5-keypad.d.ts +98 -0
- package/build_bundles/umd/@types/ch5-keypad/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-keypad/interfaces/i-ch5-keypad-attributes.d.ts +25 -0
- package/build_bundles/umd/@types/ch5-keypad/interfaces/i-ch5-keypad-btn-attributes.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-keypad/interfaces/t-ch5-keypad.d.ts +15 -0
- package/build_bundles/umd/@types/ch5-label/ch5-label.d.ts +40 -0
- package/build_bundles/umd/@types/ch5-label/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-label/interfaces/i-ch5-label-attributes.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-list/animation/ch5-animation-factory.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-list/animation/ch5-animation.d.ts +18 -0
- package/build_bundles/umd/@types/ch5-list/animation/ch5-standard-animation.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-list/ch5-list-abstract-helper.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-list/ch5-list-animation.d.ts +39 -0
- package/build_bundles/umd/@types/ch5-list/ch5-list-buffered-items.d.ts +17 -0
- package/build_bundles/umd/@types/ch5-list/ch5-list-event-manager.d.ts +25 -0
- package/build_bundles/umd/@types/ch5-list/ch5-list-signal-manager.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-list/ch5-list-size-resolver.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-list/ch5-list-template.d.ts +53 -0
- package/build_bundles/umd/@types/ch5-list/ch5-list.d.ts +283 -0
- package/build_bundles/umd/@types/ch5-list/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-list/interfaces/i-ch5-list-attributes.d.ts +21 -0
- package/build_bundles/umd/@types/ch5-list/interfaces/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-list/interfaces/t-ch5-list.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-list/passiveEventListeners.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-logger/appender/AbstractAppender.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-logger/appender/AppenderFactory.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-logger/appender/RemoteAppender.d.ts +18 -0
- package/build_bundles/umd/@types/ch5-logger/enums/index.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-logger/helpers/LogMessage.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-logger/helpers/LogMessagesFilter.d.ts +17 -0
- package/build_bundles/umd/@types/ch5-logger/helpers/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-logger/index.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-logger/logger/Logger.d.ts +33 -0
- package/build_bundles/umd/@types/ch5-logger/logger/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-logger/services/RequestService.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-logger/services/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-logger/types/index.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-logger/utility/getLogger.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-logger/utility/getRemoteAppender.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-logger/utility/index.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-logger/utility/uriSchemaValidation.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-media-player/ch5-media-player-common.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-media-player/ch5-media-player-icon-button-base.d.ts +33 -0
- package/build_bundles/umd/@types/ch5-media-player/ch5-media-player-my-music.d.ts +38 -0
- package/build_bundles/umd/@types/ch5-media-player/ch5-media-player-now-playing.d.ts +68 -0
- package/build_bundles/umd/@types/ch5-media-player/ch5-media-player.d.ts +83 -0
- package/build_bundles/umd/@types/ch5-media-player/commonInterface.d.ts +133 -0
- package/build_bundles/umd/@types/ch5-media-player/index.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-media-player/interfaces/i-ch5-media-player-attributes.d.ts +15 -0
- package/build_bundles/umd/@types/ch5-media-player/interfaces/t-ch5-media-player.d.ts +27 -0
- package/build_bundles/umd/@types/ch5-media-player/music-player.d.ts +64 -0
- package/build_bundles/umd/@types/ch5-modal-dialog/ch5-modal-dialog.d.ts +103 -0
- package/build_bundles/umd/@types/ch5-modal-dialog/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-modal-dialog/interfaces/i-ch5-modal-dialog-attributes.d.ts +30 -0
- package/build_bundles/umd/@types/ch5-overlay-panel/ch5-overlay-panel.d.ts +93 -0
- package/build_bundles/umd/@types/ch5-overlay-panel/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-overlay-panel/interfaces/i-ch5-overlay-panel-attributes.d.ts +17 -0
- package/build_bundles/umd/@types/ch5-overlay-panel/interfaces/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-overlay-panel/interfaces/t-ch5-overlay-panel.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-qrcode/ch5-qrcode.d.ts +32 -0
- package/build_bundles/umd/@types/ch5-qrcode/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-qrcode/interfaces/i-ch5-qrcode-attributes.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-resync/ch5-resync.d.ts +27 -0
- package/build_bundles/umd/@types/ch5-resync/models/ch5-clear-range-data-model.d.ts +17 -0
- package/build_bundles/umd/@types/ch5-resync/models/ch5-exclude-prefixes-model.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-resync/models/ch5-resync-constants.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-resync/models/ch5-resync-reset-event-names-enum.d.ts +8 -0
- package/build_bundles/umd/@types/ch5-resync/models/ch5-states-at-default-value-model.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-resync/models/resynchronization-request-model.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-segmented-gauge/ch5-segmented-gauge.d.ts +86 -0
- package/build_bundles/umd/@types/ch5-segmented-gauge/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-segmented-gauge/interfaces/i-ch5-segmented-gauge-attributes.d.ts +17 -0
- package/build_bundles/umd/@types/ch5-segmented-gauge/interfaces/t-ch5-segmented-gauge.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-select/ch5-select.d.ts +203 -0
- package/build_bundles/umd/@types/ch5-select/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-select/interfaces/i-ch5-select-attributes.d.ts +27 -0
- package/build_bundles/umd/@types/ch5-select/interfaces/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-select/interfaces/t-ch5-select.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-select-option/ch5-select-option.d.ts +75 -0
- package/build_bundles/umd/@types/ch5-select-option/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-select-option/interfaces/i-ch5-select-option-attributes.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-select-option/interfaces/types/t-ch5-select-option-icon-position.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-signal-level-gauge/ch5-signal-level-gauge.d.ts +53 -0
- package/build_bundles/umd/@types/ch5-signal-level-gauge/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-signal-level-gauge/interfaces/i-ch5-signal-level-gauge-attributes.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-signal-level-gauge/interfaces/t-ch5-signal-level-gauge.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-slider/ch5-slider-button-label.d.ts +23 -0
- package/build_bundles/umd/@types/ch5-slider/ch5-slider-button.d.ts +37 -0
- package/build_bundles/umd/@types/ch5-slider/ch5-slider-title-label.d.ts +23 -0
- package/build_bundles/umd/@types/ch5-slider/ch5-slider.d.ts +225 -0
- package/build_bundles/umd/@types/ch5-slider/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/i-ch5-slider-attributes.d.ts +35 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/i-ch5-slider-button-attributes.d.ts +19 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/i-ch5-slider-button-documentation.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/i-ch5-slider-button-label-documentation.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/i-ch5-slider-documentation.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/i-ch5-slider-title-label-attributes.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/i-ch5-slider-title-label-documentation.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/index.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/t-ch5-slider-button.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-slider/interfaces/t-ch5-slider.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-spinner/ch5-mouse-velocity.d.ts +35 -0
- package/build_bundles/umd/@types/ch5-spinner/ch5-spinner-events.d.ts +16 -0
- package/build_bundles/umd/@types/ch5-spinner/ch5-spinner-mutation-observer.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-spinner/ch5-spinner-scroll.d.ts +44 -0
- package/build_bundles/umd/@types/ch5-spinner/ch5-spinner-template.d.ts +58 -0
- package/build_bundles/umd/@types/ch5-spinner/ch5-spinner.d.ts +145 -0
- package/build_bundles/umd/@types/ch5-spinner/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-spinner/interfaces/i-ch5-spinner-attributes.d.ts +27 -0
- package/build_bundles/umd/@types/ch5-spinner/interfaces/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-spinner/interfaces/t-ch5-spinner.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-subpage-reference-list/ch5-subpage-reference-list.d.ts +159 -0
- package/build_bundles/umd/@types/ch5-subpage-reference-list/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-subpage-reference-list/interfaces/i-ch5-subpage-reference-list-attributes.d.ts +31 -0
- package/build_bundles/umd/@types/ch5-subpage-reference-list/interfaces/t-ch5-subpage-reference-list.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-subpage-reference-list/refresh-ch5-subpage-reference-list.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-tab-button/ch5-tab-button-individual-button.d.ts +28 -0
- package/build_bundles/umd/@types/ch5-tab-button/ch5-tab-button-label.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-tab-button/ch5-tab-button.d.ts +109 -0
- package/build_bundles/umd/@types/ch5-tab-button/index.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-tab-button/interfaces/i-ch5-tab-button-attributes.d.ts +34 -0
- package/build_bundles/umd/@types/ch5-tab-button/interfaces/i-ch5-tab-button-individual-button-attributes.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-tab-button/interfaces/t-ch5-tab-button.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-tab-button/interfaces/t-for-ch5-button-list-contract.d.ts +6 -0
- package/build_bundles/umd/@types/ch5-template/ch5-template-structure.d.ts +20 -0
- package/build_bundles/umd/@types/ch5-template/ch5-template.d.ts +59 -0
- package/build_bundles/umd/@types/ch5-template/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-template/interfaces/i-ch5-template-attributes.d.ts +14 -0
- package/build_bundles/umd/@types/ch5-template/interfaces/t-ch5-template.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-template/refresh-ch5-template.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-text/ch5-text.d.ts +63 -0
- package/build_bundles/umd/@types/ch5-text/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-text/interfaces/i-ch5-text-attributes.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-text/interfaces/t-ch5-text.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-textinput/ch5-textinput-mask.d.ts +69 -0
- package/build_bundles/umd/@types/ch5-textinput/ch5-textinput.d.ts +135 -0
- package/build_bundles/umd/@types/ch5-textinput/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-textinput/interfaces/i-ch5-text-input-attributes.d.ts +29 -0
- package/build_bundles/umd/@types/ch5-textinput/interfaces/i-ch5-text-input.d.ts +7 -0
- package/build_bundles/umd/@types/ch5-textinput/interfaces/index.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-textinput/interfaces/t-ch5-text-input.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-toggle/ch5-toggle.d.ts +95 -0
- package/build_bundles/umd/@types/ch5-toggle/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-toggle/interfaces/i-ch5-toggle-attributes.d.ts +22 -0
- package/build_bundles/umd/@types/ch5-toggle/interfaces/t-ch5-toggle.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-touch/ch5-touch-activity.d.ts +30 -0
- package/build_bundles/umd/@types/ch5-touch/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-triggerview/ch5-triggerview-child.d.ts +36 -0
- package/build_bundles/umd/@types/ch5-triggerview/ch5-triggerview-slides-manager.d.ts +48 -0
- package/build_bundles/umd/@types/ch5-triggerview/ch5-triggerview-swiper.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-triggerview/ch5-triggerview.d.ts +73 -0
- package/build_bundles/umd/@types/ch5-triggerview/index.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-triggerview/interfaces/i-ch5-triggerview-attributes.d.ts +10 -0
- package/build_bundles/umd/@types/ch5-triggerview/interfaces/i-ch5-triggerview-child-attributes.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-triggerview/utils.d.ts +13 -0
- package/build_bundles/umd/@types/ch5-video/ch5-video-snapshot.d.ts +18 -0
- package/build_bundles/umd/@types/ch5-video/ch5-video-touch-manager.d.ts +12 -0
- package/build_bundles/umd/@types/ch5-video/ch5-video-utils.d.ts +17 -0
- package/build_bundles/umd/@types/ch5-video/ch5-video.d.ts +185 -0
- package/build_bundles/umd/@types/ch5-video/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-video/interfaces/i-ch5-video-attributes.d.ts +39 -0
- package/build_bundles/umd/@types/ch5-video/interfaces/i-ch5-video-documentation.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-video/interfaces/i-ch5-video-helper.d.ts +96 -0
- package/build_bundles/umd/@types/ch5-video/interfaces/index.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-video/interfaces/t-ch5-video.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-video-switcher/ch5-video-switcher-screen-label.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-video-switcher/ch5-video-switcher-screen.d.ts +24 -0
- package/build_bundles/umd/@types/ch5-video-switcher/ch5-video-switcher-source-label.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-video-switcher/ch5-video-switcher-source.d.ts +25 -0
- package/build_bundles/umd/@types/ch5-video-switcher/ch5-video-switcher.d.ts +159 -0
- package/build_bundles/umd/@types/ch5-video-switcher/drag-drop-touch.d.ts +47 -0
- package/build_bundles/umd/@types/ch5-video-switcher/index.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-attributes.d.ts +29 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-documentation.d.ts +4 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-attributes.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-documentation.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-screen-label-documentation.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-attributes.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-documentation.d.ts +3 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/i-ch5-video-switcher-source-label-documentation.d.ts +2 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/index.d.ts +9 -0
- package/build_bundles/umd/@types/ch5-video-switcher/interfaces/t-ch5-video-switcher.d.ts +5 -0
- package/build_bundles/umd/@types/ch5-wifi-signal-level-gauge/ch5-wifi-signal-level-gauge.d.ts +57 -0
- package/build_bundles/umd/@types/ch5-wifi-signal-level-gauge/index.d.ts +1 -0
- package/build_bundles/umd/@types/ch5-wifi-signal-level-gauge/interfaces/i-ch5-wifi-signal-level-gauge-attributes.d.ts +11 -0
- package/build_bundles/umd/@types/ch5-wifi-signal-level-gauge/interfaces/t-ch5-wifi-signal-level-gauge.d.ts +3 -0
- package/build_bundles/umd/@types/index.d.ts +45 -0
- package/build_bundles/umd/@types/utility-models/ch5-role-attribute-mapping.d.ts +52 -0
- package/build_bundles/umd/@types/utility-models/index.d.ts +1 -0
- package/build_bundles/umd/cr-com-lib.js +2 -0
- package/build_bundles/umd/cr-com-lib.js.LICENSE.txt +30 -0
- package/package.json +147 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __defProp=Object.defineProperty,__export=(e,t)=>{for(var i in t)__defProp(e,i,{get:t[i],enumerable:!0})},Ch5Uid=class e{static _id=0;static _prefix="cr-id-";static getUid(){return e._prefix+ ++e._id}},Ch5Debug=class e{static DEBUG_MESSAGE_FILTER_SOURCE_KEY="Logger.messagesFilter.source";static DEBUG_MESSAGE_FILTER_LEVEL_KEY="Logger.messagesFilter.defaultLevel";static CONSOLE_OVERRIDDEN=!1;static _defaultConfig={"Ch5SignalBridge.constructor":!1,"Ch5SignalBridge.subscribe":!1,"Ch5SignalBridge.unsubscribe":!1,"Ch5SignalBridge.publish":!1,"Ch5SignalBridge.sendBooleanToNative":!1,"Ch5SignalBridge.sendIntegerToNative":!1,"Ch5SignalBridge.sendStringToNative":!1,"Ch5SignalBridge.sendObjectToNative":!1,bridgeReceiveIntegerFromNative:!1,bridgeReceiveBooleanFromNative:!1,bridgeReceiveStringFromNative:!1,bridgeReceiveObjectFromNative:!1,"bridge.rcbTimerCallback":!1,"bridge.clearTimersForSignal":!1,"bridge.rcbIntervalTimerCallback":!1,Ch5Resync:!1,"Logger.messagesFilter.defaultLevel":2};static _config=e._defaultConfig;static shouldDisplay(t){return e._config.hasOwnProperty(t)&&!0===e._config[t]}static info(t,i,...s){e.shouldDisplay(t)&&console.log(t+":"+i,s)}static loadConfig(t){e._config=t}static setConfigKeyValue(t,i){e._config[t]=i}static getConfig(){return e._config}static getConfigKeyValue(t){return e._config[t]}static enableAll(){for(const t in e._config)e._config.hasOwnProperty(t)&&(e._config[t]=!0)}static disableAll(){for(const t in e._config)e._config.hasOwnProperty(t)&&(e._config[t]=!1)}};import{isFunction}from"lodash";var Ch5SignalBridge=class{static REPEAT_DIGITAL_KEY="repeatdigital";_subscriptions;_localPublishers;_isWebView=!1;_isWebKit=!1;constructor(){Ch5Debug.info("Ch5SignalBridge.constructor"," start "),this._subscriptions={boolean:new Set,number:new Set,object:new Set,string:new Set},this._localPublishers={boolean:new Set,number:new Set,object:new Set,string:new Set},this._isWebView="undefined"!=typeof JSInterface&&"function"==typeof JSInterface.bridgeSendBooleanToNative&&"function"==typeof JSInterface.bridgeSendIntegerToNative&&"function"==typeof JSInterface.bridgeSendStringToNative,this._isWebKit="undefined"!=typeof webkit&&void 0!==webkit.messageHandlers&&void 0!==webkit.messageHandlers.bridgeSendBooleanToNative&&void 0!==webkit.messageHandlers.bridgeSendIntegerToNative&&void 0!==webkit.messageHandlers.bridgeSendStringToNative&&void 0!==webkit.messageHandlers.bridgeSendObjectToNative}subscribe(e,t){if(Ch5Debug.info("Ch5SignalBridge.subscribe",'"'+e+'":"'+t+'"'),!this._subscriptions[t].has(e)&&!this._localPublishers[t].has(e))if(this._subscriptions[t].add(e),this._isWebView&&"function"==typeof JSInterface.bridgeSubscribeBooleanSignalFromNative&&"function"==typeof JSInterface.bridgeSubscribeIntegerSignalFromNative&&"function"==typeof JSInterface.bridgeSubscribeStringSignalFromNative&&"function"==typeof JSInterface.bridgeSubscribeObjectSignalFromNative)switch(t){case"boolean":JSInterface.bridgeSubscribeBooleanSignalFromNative(e);break;case"number":JSInterface.bridgeSubscribeIntegerSignalFromNative(e);break;case"string":JSInterface.bridgeSubscribeStringSignalFromNative(e);break;default:JSInterface.bridgeSubscribeObjectSignalFromNative(e)}else if(this._isWebKit&&void 0!==webkit.messageHandlers.bridgeSubscribeBooleanSignalFromNative&&void 0!==webkit.messageHandlers.bridgeSubscribeIntegerSignalFromNative&&void 0!==webkit.messageHandlers.bridgeSubscribeStringSignalFromNative&&void 0!==webkit.messageHandlers.bridgeSubscribeObjectSignalFromNative)switch(t){case"boolean":webkit.messageHandlers.bridgeSubscribeBooleanSignalFromNative.postMessage(this.createPMParam(e));break;case"number":webkit.messageHandlers.bridgeSubscribeIntegerSignalFromNative.postMessage(this.createPMParam(e));break;case"string":webkit.messageHandlers.bridgeSubscribeStringSignalFromNative.postMessage(this.createPMParam(e));break;default:webkit.messageHandlers.bridgeSubscribeObjectSignalFromNative.postMessage(this.createPMParam(e))}}unsubscribe(e,t){if(Ch5Debug.info("Ch5SignalBridge.unsubscribe",'"'+e+'":"'+t+'"'),this._subscriptions[t].has(e))if(this._subscriptions[t].delete(e),this._isWebView&&"function"==typeof JSInterface.bridgeUnsubscribeBooleanSignalFromNative&&"function"==typeof JSInterface.bridgeUnsubscribeIntegerSignalFromNative&&"function"==typeof JSInterface.bridgeUnsubscribeStringSignalFromNative&&"function"==typeof JSInterface.bridgeUnsubscribeObjectSignalFromNative)switch(t){case"boolean":JSInterface.bridgeUnsubscribeBooleanSignalFromNative(e);break;case"number":JSInterface.bridgeUnsubscribeIntegerSignalFromNative(e);break;case"string":JSInterface.bridgeUnsubscribeStringSignalFromNative(e);break;default:JSInterface.bridgeUnsubscribeObjectSignalFromNative(e)}else if(this._isWebKit&&void 0!==webkit.messageHandlers.bridgeUnsubscribeBooleanSignalFromNative&&void 0!==webkit.messageHandlers.bridgeUnsubscribeIntegerSignalFromNative&&void 0!==webkit.messageHandlers.bridgeUnsubscribeStringSignalFromNative)switch(t){case"boolean":webkit.messageHandlers.bridgeUnsubscribeBooleanSignalFromNative.postMessage(this.createPMParam(e));break;case"number":webkit.messageHandlers.bridgeUnsubscribeIntegerSignalFromNative.postMessage(this.createPMParam(e));break;default:webkit.messageHandlers.bridgeUnsubscribeStringSignalFromNative.postMessage(this.createPMParam(e))}}publish(e,t){Ch5Debug.info("Ch5SignalBridge.publish",'"'+e+'":'+t);const i=typeof t;switch(this.unsubscribe(e,i),this._localPublishers[i].add(e),i){case"boolean":this.sendBooleanToNative(e,t);break;case"number":this.sendIntegerToNative(e,t);break;case"string":this.sendStringToNative(e,t);break;default:this.sendObjectToNative(e,t)}}sendBooleanToNative(e,t){Ch5Debug.info("Ch5SignalBridge.sendBooleanToNative",'"'+e+'":'+t),this._isWebView?JSInterface.bridgeSendBooleanToNative(e,t):this._isWebKit?webkit.messageHandlers.bridgeSendBooleanToNative.postMessage(this.createPMParam(e,t)):this._isWebXPanel()&&CommunicationInterface.bridgeSendBooleanToNative(e,t)}sendIntegerToNative(e,t){Ch5Debug.info("Ch5SignalBridge.sendIntegerToNative",'"'+e+'":'+t),this._isWebView?JSInterface.bridgeSendIntegerToNative(e,t):this._isWebKit?webkit.messageHandlers.bridgeSendIntegerToNative.postMessage(this.createPMParam(e,t)):this._isWebXPanel()&&CommunicationInterface.bridgeSendIntegerToNative(e,t)}sendStringToNative(e,t){Ch5Debug.info("Ch5SignalBridge.sendStringToNative",'"'+e+'":"'+t+'"'),this._isWebView?JSInterface.bridgeSendStringToNative(e,t):this._isWebKit?webkit.messageHandlers.bridgeSendStringToNative.postMessage(this.createPMParam(e,t)):this._isWebXPanel()&&CommunicationInterface.bridgeSendStringToNative(e,t)}sendObjectToNative(e,t){const i="Ch5SignalBridge.sendObjectToNative";Ch5Debug.shouldDisplay(i)&&Ch5Debug.info(i,`"${e}": ${JSON.stringify(t)}`),this._isWebView?JSInterface.bridgeSendObjectToNative(e,JSON.stringify(t)):this._isWebKit?webkit.messageHandlers.bridgeSendObjectToNative.postMessage(this.createPMParam(e,t)):this._isWebXPanel()&&CommunicationInterface.bridgeSendObjectToNative(e,JSON.stringify(t))}_isWebXPanel(){const e="undefined"!=typeof CommunicationInterface&&isFunction(CommunicationInterface.bridgeSendBooleanToNative)&&isFunction(CommunicationInterface.bridgeSendIntegerToNative)&&isFunction(CommunicationInterface.bridgeSendStringToNative)&&isFunction(CommunicationInterface.bridgeSendObjectToNative);return e&&(this._isWebView=!1),e}createPMParam(e,t){let i;return i=void 0!==t?{signal:e,value:t}:{signal:e},JSON.stringify(i)}};import{BehaviorSubject}from"rxjs";var Ch5TranslationConfiguration=class{static translationTokenStartDelimiter="-+";static translationTokenEndDelimiter="+-"};import translateEngine from"i18next";var Ch5SignalFactory=class e{static _instance;_signals;static getInstance(){return void 0===e._instance&&(e._instance=new e),e._instance}static clear(){void 0!==e._instance&&(e._instance._signals=void 0,e._instance=void 0)}constructor(){this._signals={boolean:{},number:{},string:{},object:{}}}clearSignals(e){this._signals&&(this._signals=e?{boolean:{},number:{},string:{},object:this._signals.object}:{boolean:{},number:{},string:{},object:{}})}getStates(){return this._signals}getBooleanSignal(e,t=!0){return this.getState(e,!1,t)}getObjectAsBooleanSignal(e,t=!0){return this.getState(e,!1,t)}getNumberSignal(e,t=!0){return this.getState(e,0,t)}getStringSignal(e,t=!0){return this.getState(e,"",t)}getObjectSignal(e,t=!0){return this.getState(e,{},t)}getState(e,t,i=!0){if(void 0===e||void 0===this._signals)return null;const s=typeof t;if(void 0===this._signals[s])return null;if(void 0===this._signals[s][e]){if(!i)return null;const n=new Ch5Signal(e,t);return this._signals[s][e]=n,n}{const i=this._signals[s][e];return i.type===typeof t?i:null}}};function triggerTranslation(e){const t=Ch5SignalFactory.getInstance().getStringSignal(languageChangedSignalName);let i=translationFactory.translator.language;null==i&&""!==e&&(i=e),null!==t&&t.publish(i)}var Ch5TranslationListeners=class{translator={};constructor(e){this.translator=e,this.init()}init(){this.translator.on("initialized",this.onInitialized.bind(this)),this.translator.on("loaded",this.onLoaded.bind(this)),this.translator.on("added",this.onAdded.bind(this)),this.translator.on("languageChanged",this.onLanguageChanged.bind(this))}onInitialized(e){this.translate(e.language)}onLanguageChanged(e){this.translate(e)}onLoaded(e){this.translate()}onAdded(e,t){this.translate()}translate(e){triggerTranslation(e)}},Ch5TranslationFactory=class{receiveUpdateSub="";_translator={};get translator(){return this._translator}set translator(e){Object.keys(e).length>0&&(this._translator=e,this.runListeners())}runListeners(){return new Ch5TranslationListeners(this.translator)}},translationFactory=new Ch5TranslationFactory;translationFactory.translator=translateEngine;var languageChangedSignalName="language_changed",Ch5TranslationUtility=class e{static _instance;_translatorBeginKey="";_translatorEndKey="";static getInstance(){return void 0===e._instance&&(e._instance=new e),e._instance}constructor(){this.translatorBeginKey=Ch5TranslationConfiguration.translationTokenStartDelimiter,this.translatorEndKey=Ch5TranslationConfiguration.translationTokenEndDelimiter}getTranslator(){return translationFactory.translator}valuesToTranslation(e){const t=new RegExp(`^${this.translatorBeginKey}[a-zA-Z0-9][a-zA-Z0-9_.]*[^_.]${this.translatorEndKey}$`);return e.match(t)}hasMultipleIdentifiers(e){const t=new RegExp(`^${this.translatorBeginKey}[a-zA-Z0-9][a-zA-Z0-9_.]*[^_.]${this.translatorEndKey}$`);return!!(e.match(t)&&e.match(t).length>1)}isTranslationIdentifier(e){return new RegExp(`^${this.translatorBeginKey}[a-zA-Z0-9][a-zA-Z0-9_.]*[^_.]${this.translatorEndKey}$`).test(e)}stripDownTranslationCharacters(e){const t=new RegExp("^(\\"+this.translatorBeginKey+")([a-zA-Z0-9\\._]+)(\\"+this.translatorEndKey+")$");let i="";return t.exec(e)&&t.exec(e).length>0&&(i=t.exec(e)[2]),i}set translatorBeginKey(e){null!=e&&(this._translatorBeginKey=e.split("").join("\\"))}get translatorBeginKey(){return this._translatorBeginKey}set translatorEndKey(e){null!=e&&(this._translatorEndKey=e.split("").join("\\"))}get translatorEndKey(){return this._translatorEndKey}_t(e){let t=e;const i=this.valuesToTranslation(e);return i&&i.length>0&&i.forEach(e=>{if(this.isTranslationIdentifier(e)){const i=this.stripDownTranslationCharacters(e);if(this.getTranslator().exists(i)){const s=this.getTranslator().t(i);t=t.replace(e,s)}}}),t}translatedValue(e){let t=e;return t=this.isTranslationIdentifier(e)?this._t(e):e,t}},Ch5SignalBehaviorSubject=class extends BehaviorSubject{_prevValue;constructor(e,t){super(e),this._prevValue=t}get prevValue(){return this.getPrevValue()}getPrevValue(){return this._prevValue}next(e){if(this._prevValue=this.value,"string"==typeof e){let t=e;Ch5TranslationUtility.getInstance().isTranslationIdentifier(e)&&(t=Ch5TranslationUtility.getInstance().translatedValue(e)),super.next(t)}else super.next(e)}},Ch5ResyncConstants=class{static JOIN_NUMBER_SIGNAL_NAME_PREFIX="fb"},Ch5Resync=class e{static _instance;static START_OF_UPDATE_TIME_LIMIT=6e4;_statesAtDefaultValue;statesRef;ch5SignalFactory=Ch5SignalFactory.getInstance();LOG_KEY="Ch5Resync";startOfUpdateTimer;startOfUpdateCounter=0;static checkIfStateShouldBeIncluded(e,t){if("Csig.State_Synchronization"===t)return!1;for(const i of e.excludePrefixes)if(t&&t.toString().startsWith(i))return!1;return!0}static get Instance(){return this._instance||(this._instance=new this)}constructor(){this.statesRef=this.ch5SignalFactory.getStates(),this._statesAtDefaultValue={}}onReceiveStartOfUpdate(e){Ch5Debug.info(this.LOG_KEY,`Start of Update called with ${JSON.stringify(e)}`),this.initializeStartOfUpdateTimer(),this.startOfUpdateCounter+=1,this.setDefaultStatesOnStartOfUpdate(e)}onReceiveStartOfUpdateRange(e,t){Ch5Debug.shouldDisplay(this.LOG_KEY)&&Ch5Debug.info(this.LOG_KEY,`Start of Update Range called with ${JSON.stringify(t)}`),"StartOfUpdateRange"===e&&(this.initializeStartOfUpdateTimer(),this.startOfUpdateCounter+=1),this.addDefaultJoinsOnClearRange(t.boolean.joinLow,t.boolean.joinHigh,"boolean"),this.addDefaultJoinsOnClearRange(t.numeric.joinLow,t.numeric.joinHigh,"number"),this.addDefaultJoinsOnClearRange(t.string.joinLow,t.string.joinHigh,"string"),this.addDefaultStatesOnClearRange(t.boolean.stateNames,"boolean"),this.addDefaultStatesOnClearRange(t.numeric.stateNames,"number"),this.addDefaultStatesOnClearRange(t.string.stateNames,"string"),Ch5Debug.shouldDisplay(this.LOG_KEY)&&Ch5Debug.info(this.LOG_KEY,`Start Of Update Range:${JSON.stringify(this._statesAtDefaultValue)}`)}onReceiveUpdatedState(e,t,i){this.InUpdateState&&(Ch5Debug.info(this.LOG_KEY,`Updated ${i}:${e}`),void 0!==this._statesAtDefaultValue[i]&&void 0!==this._statesAtDefaultValue[i][e]&&delete this._statesAtDefaultValue[i][e])}onReceiveEndOfUpdate(){Ch5Debug.info(this.LOG_KEY,`End of Update called with counter ${this.startOfUpdateCounter}`),this.startOfUpdateCounter>0&&(this.startOfUpdateCounter-=1,0===this.startOfUpdateCounter&&this.resetRemainingStates())}resetRemainingStates(){this.startOfUpdateCounter=0,void 0!==this.startOfUpdateCounter&&(window.clearTimeout(this.startOfUpdateTimer),this.startOfUpdateTimer=void 0),this.setRemainingStatesToDefaultValue(),this._statesAtDefaultValue={}}addDefaultJoinsOnClearRange(e,t,i){if(0!==e||0!==t){void 0===this._statesAtDefaultValue[i]&&(this._statesAtDefaultValue[i]={});for(let s=e;s<=t;s++)this._statesAtDefaultValue[i][Ch5ResyncConstants.JOIN_NUMBER_SIGNAL_NAME_PREFIX+s.toString()]=!0}}addDefaultStatesOnClearRange(e,t){if(void 0!==e&&0!==e.length){void 0===this._statesAtDefaultValue[t]&&(this._statesAtDefaultValue[t]={});for(const i of e)this._statesAtDefaultValue[t][i]=!0}}setDefaultStatesOnStartOfUpdate(t){this._statesAtDefaultValue={};for(const i in this.statesRef)if(this.statesRef.hasOwnProperty(i)){void 0===this._statesAtDefaultValue[i]&&(this._statesAtDefaultValue[i]={});for(const s in this.statesRef[i])if(this.statesRef[i].hasOwnProperty(s)){const n=this.statesRef[i];e.checkIfStateShouldBeIncluded(t,n[s]._name)&&n[s].receivedFromSignalBridge&&(this._statesAtDefaultValue[i][n[s]._name]=!0)}}Ch5Debug.shouldDisplay(this.LOG_KEY)&&Ch5Debug.info(this.LOG_KEY,`Start of Update:${JSON.stringify(this._statesAtDefaultValue)}`)}setRemainingStatesToDefaultValue(){Ch5Debug.shouldDisplay(this.LOG_KEY)&&Ch5Debug.info(this.LOG_KEY,`End Of Update:${JSON.stringify(this._statesAtDefaultValue)}`);for(const e in this._statesAtDefaultValue)if(Object.prototype.hasOwnProperty.call(this._statesAtDefaultValue,e)){const t=this._statesAtDefaultValue[e];for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(!this.statesRef[e][i])continue;try{switch(e){case"boolean":this.statesRef[e][i].fromSignalBridge(!1);break;case"number":this.statesRef[e][i].fromSignalBridge(0),this.statesRef.object[i]&&this.statesRef.object[i].fromSignalBridge({rcb:{value:0,time:0}});break;case"string":this.statesRef[e][i].fromSignalBridge("")}}catch(t){console.log("[INFO] Failed to publish signal: "+i+" of type: "+e)}}}}initializeStartOfUpdateTimer(t=e.START_OF_UPDATE_TIME_LIMIT){window.clearTimeout(this.startOfUpdateTimer),this.startOfUpdateTimer=window.setTimeout(()=>{Ch5Debug.info(this.LOG_KEY,`Timeout waiting for EndOfUpdate remainingEOUs:${this.startOfUpdateCounter}`),this.resetRemainingStates()},t)}get InUpdateState(){return void 0!==this.startOfUpdateTimer}},Ch5Signal=class e{static _resetEventsInitialized=!1;static _initialSubscriptionToResyncEvents=!0;_name;_subject;_uninitializedValue;_lastSubId;_subscriptions;_signalBridge;_hasChangedSinceInit=!1;_receivedFromSignalBridge=!1;_ch5Resync;static isIntegerSignalName(e){const t=parseInt(e,10);return!isNaN(t)&&t.toString()===e}static getJoinNumberSignalName(e){return Ch5ResyncConstants.JOIN_NUMBER_SIGNAL_NAME_PREFIX+e}static getSubscriptionSignalName(t){return e.isIntegerSignalName(t)?e.getJoinNumberSignalName(t):t}static _resetEventsInitialization(){if(e._resetEventsInitialized)return;e._resetEventsInitialized=!0;const t=Ch5Resync.Instance;subscribeState("object","Csig.State_Synchronization",i=>{if(e._initialSubscriptionToResyncEvents)e._initialSubscriptionToResyncEvents=!1;else if("StartOfUpdate"===i.state){if(void 0===i.value||void 0===i.value.excludePrefixes)throw new Error("Invalid resyncRequest object");{const e={excludePrefixes:i.value.excludePrefixes};t.onReceiveStartOfUpdate(e)}}else if("StartOfUpdateRange"===i.state||"StartOfUpdateRangeSO"===i.state){if(void 0===i.value||void 0===i.value.range||void 0===i.value.excludePrefixes)throw new Error("Invalid resyncRequest object");t.onReceiveStartOfUpdateRange(i.state,i.value.range)}else"EndOfUpdate"===i.state&&t.onReceiveEndOfUpdate()})}constructor(t,i){this._name=t,this._uninitializedValue=this.uninitializedCreate(i),this._subject=new Ch5SignalBehaviorSubject(this._uninitializedValue,this._uninitializedValue),this._lastSubId=0,this._subscriptions={},this._signalBridge=new Ch5SignalBridge,this._ch5Resync=Ch5Resync.Instance,e._resetEventsInitialization(),this.subscribeToStates()}subscribeToStates(){this._subscriptions.stateSubscription=this._subject.subscribe(()=>{this._ch5Resync.onReceiveUpdatedState(this._name,this.value,this.type)})}uninitializedCreate(e){switch(typeof e){case"boolean":return!1;case"number":return 0;case"string":return"";default:return{}}}get name(){return this._name}get type(){return typeof this._uninitializedValue}get value(){return this._subject.value}get prevValue(){return this._subject.prevValue}hasChangedSinceInit(){return this._hasChangedSinceInit}get receivedFromSignalBridge(){return this._receivedFromSignalBridge}publish(e){this._hasChangedSinceInit=!0,this._subject.next(e),this._signalBridge.publish(this._name,e)}fromSignalBridge(e){this._receivedFromSignalBridge=!0,this._hasChangedSinceInit=!0,this._subject.getValue()!==e?this._subject.next(e):this._ch5Resync.onReceiveUpdatedState(this._name,this.value,this.type)}subscribe(e,t){this._lastSubId++;const i=this._name+"-"+("00000"+this._lastSubId).slice(-5);let s;return s=null!=t?this._subject.subscribe(e,t):this._subject.subscribe(e),this._subscriptions[i]=s,1===Object.keys(this._subscriptions).length&&this._signalBridge.subscribe(this._name,typeof this._uninitializedValue),i}unsubscribe(e){const t=this._subscriptions[e];void 0!==t&&(t.unsubscribe(),delete this._subscriptions[e],1===Object.keys(this._subscriptions).length&&this._signalBridge.unsubscribe(this._name,typeof this._uninitializedValue))}},rcbIntervalTimers={},rcbTimers={},RCB_INTERVAL_DURATION_MS=100;function bridgeReceiveIntegerFromNative(e,t){const i=Ch5Signal.getSubscriptionSignalName(e);Ch5Debug.info("bridgeReceiveIntegerFromNative",'"'+i+'":'+t),clearTimersForSignal(i);const s=Ch5SignalFactory.getInstance().getNumberSignal(i);null!==s&&s.fromSignalBridge(t);const n=Ch5SignalFactory.getInstance().getObjectSignal(i),r={rcb:{value:t,time:0}};null!==n&&n.fromSignalBridge(r)}function bridgeReceiveBooleanFromNative(e,t){const i=Ch5Signal.getSubscriptionSignalName(e);Ch5Debug.info("bridgeReceiveBooleanFromNative",'"'+i+'":'+t);const s=Ch5SignalFactory.getInstance().getBooleanSignal(i);null!==s&&s.fromSignalBridge(t)}function bridgeReceiveStringFromNative(e,t){const i=Ch5Signal.getSubscriptionSignalName(e);Ch5Debug.info("bridgeReceiveStringFromNative",'"'+i+'":"'+t+'"');const s=Ch5SignalFactory.getInstance().getStringSignal(i);null!==s&&s.fromSignalBridge(t)}function bridgeReceiveObjectFromNative(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s="bridgeReceiveObjectFromNative";Ch5Debug.shouldDisplay(s)&&Ch5Debug.info(s,'"'+i+"\":'"+JSON.stringify(t)+"'");const n=Ch5SignalFactory.getInstance().getObjectSignal(i);if(null!==n)if(isRcbObject(t)){let e=0;const s=Ch5SignalFactory.getInstance().getNumberSignal(i);null!==s&&(e=s.value),n.fromSignalBridge(processReceivedRcb(i,t,e))}else n.fromSignalBridge(t)}function isRcbObject(e){return e.hasOwnProperty("rcb")&&e.rcb.hasOwnProperty("value")&&e.rcb.hasOwnProperty("time")}function processReceivedRcb(e,t,i){Ch5Debug.info("bridge.processReceivedRcb"," process rcb ","signalName "+e," rcbObject ",t," current scalar value",i),clearTimersForSignal(e);const s={rcb:{value:t.rcb.value,time:t.rcb.time,startv:i,startt:Date.now()}},n=window.setTimeout(rcbTimerCallback,t.rcb.time,e,s);if(rcbTimers[e]=n,RCB_INTERVAL_DURATION_MS<t.rcb.time){const t=window.setInterval(rcbIntervalTimerCallback,RCB_INTERVAL_DURATION_MS,e,s);rcbIntervalTimers[e]=t}return s}function rcbIntervalTimerCallback(e,t){if(Ch5Debug.info("bridge.rcbIntervalTimerCallback"," start ","signalName "+e," rcbObject ",t),0===t.rcb.time)return;const i=(t.rcb.value-t.rcb.startv)/t.rcb.time;let s=i*(Date.now()-t.rcb.startt)+t.rcb.startv;const n=Ch5SignalFactory.getInstance().getNumberSignal(e);s=i>0?Math.floor(s):i<0?Math.ceil(s):Math.round(s),null!==n&&n.value!==s&&n.fromSignalBridge(s)}function rcbTimerCallback(e,t){Ch5Debug.info("bridge.rcbTimerCallback"," start ","signalName "+e," rcbObject ",t);const i=t.rcb.value,s=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==s&&s.fromSignalBridge(i);const n=Ch5SignalFactory.getInstance().getObjectSignal(e),r={rcb:{value:i,time:0}};null!==n&&n.fromSignalBridge(r),clearTimersForSignal(e)}function clearTimersForSignal(e){Ch5Debug.info("bridge.clearTimersForSignal"," start ","signalName "+e),rcbIntervalTimers.hasOwnProperty(e)&&(window.clearInterval(rcbIntervalTimers[e]),delete rcbIntervalTimers[e]),rcbTimers.hasOwnProperty(e)&&(window.clearTimeout(rcbTimers[e]),delete rcbTimers[e])}function getSubscriptionsCount(){return Ch5SignalFactory.getInstance().getStates()}function countNumberOfCh5Components(e){const t={parent:e.tagName,total:0},i=e.getElementsByTagName("*");for(const e of i){const i=e.tagName;if(i.startsWith("CH5-")){t.total++;const e=t[i];t[i]=void 0===e?1:e+1}else if(e.hasAttributes()){const i=e.attributes;for(let e=i.length-1;e>=0;e--){const s=i[e].name;if(s.startsWith("data-ch5")&&"data-ch5-id"!==s&&!s.endsWith("subs-key")&&!s.endsWith("sub-key")){t.total++;const e=t[s];t[s]=void 0===e?1:e+1}}}}return t}function getState(e,t,i){let s=null;switch(e.toLowerCase()){case"b":case"boolean":s=void 0!==i?getBooleanSignalValue(t,i):getBooleanSignalValue(t);break;case"n":case"number":case"numeric":s=void 0!==i?getNumericSignalValue(t,i):getNumericSignalValue(t);break;case"s":case"string":s=void 0!==i?getStringSignalValue(t,i):getStringSignalValue(t);break;case"o":case"object":s=void 0!==i?getObjectSignalValue(t,i):getObjectSignalValue(t)}return s}function getBooleanSignalValue(e,t){const i=Ch5SignalFactory.getInstance();let s=null;null!=t&&(s=t),e=Ch5Signal.getSubscriptionSignalName(e);const n=i.getBooleanSignal(e,!1);return null!==n&&n.hasChangedSinceInit()&&(s=n.value),s}function getNumericSignalValue(e,t){const i=Ch5SignalFactory.getInstance();let s=null;null!=t&&(s=t),e=Ch5Signal.getSubscriptionSignalName(e);const n=i.getNumberSignal(e,!1);return null!==n&&n.hasChangedSinceInit()&&(s=n.value),s}function getStringSignalValue(e,t){const i=Ch5SignalFactory.getInstance();let s=null;null!=t&&(s=t),e=Ch5Signal.getSubscriptionSignalName(e);const n=i.getStringSignal(e,!1);return null!==n&&n.hasChangedSinceInit()&&(s=n.value),s}function getObjectSignalValue(e,t){const i=Ch5SignalFactory.getInstance();let s=null;null!=t&&(s=t),e=Ch5Signal.getSubscriptionSignalName(e);const n=i.getObjectSignal(e,!1);return null!==n&&n.hasChangedSinceInit()&&(s=n.value),s}function publishEvent(e,t,i){const s=Ch5SignalFactory.getInstance();switch(e.toLowerCase()){case"b":case"boolean":const e=s.getBooleanSignal(t);null!==e&&e.publish(i);break;case"n":case"number":case"numeric":const n=s.getNumberSignal(t);null!==n&&n.publish(i);break;case"s":case"string":const r=s.getStringSignal(t);null!==r&&r.publish(i);break;case"o":case"object":const a=s.getObjectSignal(t);null!==a&&a.publish(i)}}import{isNil}from"lodash";function subscribeState(e,t,i,s){const n=Ch5SignalFactory.getInstance();let r="";switch(t=Ch5Signal.getSubscriptionSignalName(t),e.toLowerCase()){case"b":case"boolean":const a=n.getBooleanSignal(t);isNil(a)||(r=a.subscribe(i,s));break;case"n":case"number":case"numeric":const l=n.getNumberSignal(t);isNil(l)||(r=l.subscribe(i,s));break;case"s":case"string":const o=n.getStringSignal(t);isNil(o)||(r=o.subscribe(i,s));break;case"o":case"object":const h=n.getObjectSignal(t);isNil(h)||(r=h.subscribe(i,s));break;default:isNil(s)||s(`Signal: ${t}, has unsupported type: ${e}`)}return r}function unsubscribeState(e,t,i){const s=Ch5SignalFactory.getInstance();switch(t=Ch5Signal.getSubscriptionSignalName(t),e.toLowerCase()){case"b":case"boolean":const e=s.getBooleanSignal(t);null!==e&&e.unsubscribe(i);break;case"n":case"number":case"numeric":const n=s.getNumberSignal(t);null!==n&&n.unsubscribe(i);break;case"s":case"string":const r=s.getStringSignal(t);null!==r&&r.unsubscribe(i);break;case"o":case"object":const a=s.getObjectSignal(t);null!==a&&a.unsubscribe(i)}}function textformat(e,...t){let i=e;for(let e=0,s=t.length;e<s;e++)i=i.replace(new RegExp("\\{"+(+e+1)+"\\}","g"),t[e]);return i}var subscribeStateScriptSigSubs={},subSigScriptIndex=0;function generateSubSigScriptKey(){return"ch5SubSigScript-"+ ++subSigScriptIndex}function unsubscribeStateScript(e){subscribeStateScriptSigSubs.hasOwnProperty(e)&&subscribeStateScriptSigSubs[e].forEach(e=>{unsubscribeState(e.sigType,e.sigName,e.sigSub)})}function subscribeStateScript(e,t,i){const s=new Set;null==i&&(i="undefined"),e.replace(/{{([bns]\.([A-Za-z]|[0-9])([A-Za-z0-9_.])*)}}/g,(e,...t)=>(void 0===t[0]||s.add(t[0]),""));let n="",r="";const a=s.values();let l=a.next();const o=[];for(;void 0!==l.value;){r=l.value.split(".")[0];n=l.value.split(".").slice(1).join("."),n=Ch5Signal.getSubscriptionSignalName(n);const h={sigName:n,sigType:r,sigSub:subscribeState(r,n,()=>{const n=_callbackForSignalScriptOnSignalUpdate(s,e,i);"function"==typeof t&&t.bind(null,n)()})};o.push(h),l=a.next()}const h=generateSubSigScriptKey();subscribeStateScriptSigSubs[h]=o;const c=_callbackForSignalScriptOnSignalUpdate(s,e,i);return"function"==typeof t&&t.bind(null,c)(),h}function _callbackForSignalScriptOnSignalUpdate(e,t,i){let s=t;const n=e.values();let r=n.next(),a="",l="";for(;void 0!==r.value;){l=r.value.split(".")[0];a=r.value.split(".").slice(1).join(".");const e=getState(l,a);if(null===e){s=i;break}s=s.replace(new RegExp("\\{\\{"+r.value+"\\}\\}","g"),e),r=n.next()}return i!==s&&(s=new Function("return "+s)()),s}function registerTranslationInterface(e,t,i){void 0!==t&&void 0!==i&&""!==t.trim()&&""!==i.trim()&&(t=t.trim(),i=i.trim(),Ch5TranslationConfiguration.translationTokenStartDelimiter=Ch5TranslationUtility.getInstance().translatorBeginKey=t,Ch5TranslationConfiguration.translationTokenEndDelimiter=Ch5TranslationUtility.getInstance().translatorEndKey=i),translationFactory.translator=e}import _ from"lodash";var Ch5CoreIntersectionObserver=class e{static observerThreshold=[.2,.3,.4,.5,.6,.7,.8,.9,.91,.92,.93,1];static observerRootMargin="0px";static _instance;_intersectionObserverConfig;_intersectionObserver;constructor(t){this._intersectionObserverConfig={root:null,rootMargin:t&&t.length>0?t:e.observerRootMargin,threshold:e.observerThreshold},this._intersectionObserver=new IntersectionObserver(this.intersectionObserverCallback,this._intersectionObserverConfig)}static getInstance(t){if(e._instance instanceof e)return e._instance;{const i=t&&t.length>0?t:"";e._instance=new e(i)}return e._instance}intersectionObserverCallback(e,t){e.forEach(e=>{const t=e.target;t.elementIntersectionEntry=e,t.elementIsInViewPort=e.isIntersecting,e.target.viewportCallBack(e.target,e.isIntersecting)})}observe(e,t){_.isNil(e)||(e.viewportCallBack=t,this._intersectionObserver.observe(e))}unobserve(e){_.isNil(e)||(delete e.viewportCallBack,this._intersectionObserver.unobserve(e))}disconnect(){this._intersectionObserver instanceof IntersectionObserver&&this._intersectionObserver.disconnect()}};function subscribeInViewPortChange(e,t){Ch5CoreIntersectionObserver.getInstance().observe(e,t)}function unSubscribeInViewPortChange(e){Ch5CoreIntersectionObserver.getInstance()instanceof Ch5CoreIntersectionObserver&&Ch5CoreIntersectionObserver.getInstance().unobserve(e)}var debounce=(e,t,i=0)=>{const s=Date.now();e.start||(e.start=s);const n=s-e.start>i;e.timeoutIdentifier&&!n||(clearTimeout(e.timeoutIdentifier),e.timeoutIdentifier=setTimeout(()=>t(),i),e.start=n?s:e.start)};function isCrestronTouchscreen(){return!!window.navigator.userAgent.toLowerCase().includes("crestron")||("undefined"!=typeof JSInterface&&void 0!==JSInterface.bridgeSendBooleanToNative||("undefined"!=typeof webkit&&void 0!==webkit.messageHandlers&&void 0!==webkit.messageHandlers.bridgeSendBooleanToNative||"undefined"!=typeof CommunicationInterface&&void 0!==CommunicationInterface.bridgeSendBooleanToNative))}import isUndefined from"lodash/isUndefined";var version="2.17.2",buildDate="2026-04-05",signalNameForLibraryVersion="Csig.library.ver",signalNameForLibraryBuildDate="Csig.library.date",Ch5Version=class e{static init(){e.displayVersionMessage(),e.initVersionSignals()}static displayVersionMessage(){const e=`Crestron Component Library version ${version} build date ${buildDate}`;console.log(e)}static initVersionSignals(){const e=Ch5SignalFactory.getInstance(),t=e.getStringSignal(signalNameForLibraryVersion),i=e.getStringSignal(signalNameForLibraryBuildDate);null===t||isUndefined(version)?console.log("Error: unable to create signal containing library version"):t.publish(version),null===i||isUndefined(buildDate)?console.log("Error: unable to create signal containing library build date"):i.publish(buildDate)}};Ch5Version.init();import{isNil as isNil2}from"lodash";var Ch5Heartbeats=class e{static _instance;_heartbeatRequestSub;constructor(){this._heartbeatRequestSub=subscribeState("object","Csig.HeartbeatRequest",e=>{publishEvent("object","Csig.HeartbeatResponse",e)})}static getInstance(){return isNil2(this._instance)&&(this._instance=new e),this._instance}};Ch5Heartbeats.getInstance();import{isNil as isNil3}from"lodash";var Ch5Platform=class e{static CSIG_PLATFORM_INFO="Csig.Platform_Info";static _instance;_ch5PlatformInfoSignal;_ch5PlatformInfo;_updateCallbacks;constructor(t){this._ch5PlatformInfoSignal=t.getObjectSignal(e.CSIG_PLATFORM_INFO,!0),this._ch5PlatformInfo={capabilities:{supportsTouchActivity:!0,supportCredentialIntercept:{http:"",https:""}},version:"",name:""},this._updateCallbacks=new Array}static getInstance(t){return isNil3(this._instance)&&(isNil3(t)&&(t=Ch5SignalFactory.getInstance()),this._instance=new e(t)),this._instance}init(){isNil3(this._ch5PlatformInfoSignal)||this._ch5PlatformInfoSignal.subscribe(e=>{if(!isNil3(e)&&0!==Object.keys(e).length){if(!Object.isFrozen(this._ch5PlatformInfo)){const t=e;this._ch5PlatformInfo=Object.freeze(t)}this._updateCallbacks.forEach(e=>{e(this._ch5PlatformInfo)})}})}registerUpdateCallback(e){e(this._ch5PlatformInfo),this._updateCallbacks.push(e)}getPlatformInfo(){return this._ch5PlatformInfo}};function isIosDevice(){if(("iPad"===window.navigator.platform||"iPhone"===window.navigator.platform)&&navigator.maxTouchPoints>=1){if(/iPad|iPhone/.test(window.navigator.userAgent))return!0}else if("MacIntel"===window.navigator.platform&&/Macintosh/.test(window.navigator.userAgent))return!0;return!1}Ch5Platform.getInstance().init();var Ch5SignalAttributeRegistry=class e{static BOOLEAN_JOIN="booleanJoin";static NUMERIC_JOIN="numericJoin";static STRING_JOIN="stringJoin";static CONTRACT_NAME="contractName";static CUSTOM_ATTRIBUTE_PSUEDO_ELEMENT_NAME="*";static _instance;static get instance(){return void 0===e._instance&&(e._instance=new e),e._instance}_registry;constructor(){this._registry={}}addElementAttributeEntries(e,t){this._registry[e.toUpperCase()]?this._registry[e.toUpperCase()].attributes=t:this._registry[e.toUpperCase()]={attributes:t}}addCustomAttributeEntry(t,i){this._registry[e.CUSTOM_ATTRIBUTE_PSUEDO_ELEMENT_NAME]||(this._registry[e.CUSTOM_ATTRIBUTE_PSUEDO_ELEMENT_NAME]={attributes:{}}),this._registry[e.CUSTOM_ATTRIBUTE_PSUEDO_ELEMENT_NAME].attributes[t]=i}addElementDefaultAttributeEntries(e,t){this._registry[e.toUpperCase()]||(this._registry[e.toUpperCase()]={attributes:{}}),this._registry[e.toUpperCase()].addAttributeWhen=t}getElementAttributeEntry(t,i){return void 0!==this._registry[t]?this._registry[t].attributes[i]:void 0!==this._registry[e.CUSTOM_ATTRIBUTE_PSUEDO_ELEMENT_NAME]?this._registry[e.CUSTOM_ATTRIBUTE_PSUEDO_ELEMENT_NAME].attributes[i]:void 0}getElementDefaultAttributeEntries(e){if(void 0!==this._registry[e])return this._registry[e].addAttributeWhen}},Ch5ComponentLibrary=class{static ROLES={Ch5Animation:"animation",Ch5Background:"region",Ch5Button:"button",Ch5ButtonLabel:"label",Ch5ButtonMode:"template",Ch5ButtonModeState:"template",Ch5ButtonList:"button-list",Ch5ButtonListMode:"template",Ch5ButtonListModeState:"template",Ch5ButtonListLabel:"label",Ch5ButtonListIndividualButton:"template",Ch5ColorChip:"color-chip",Ch5ColorPicker:"color-picker",Ch5Dpad:"dpad",Ch5DateTime:"datetime",Ch5DpadChild:"dpad-child",Ch5Keypad:"keypad",Ch5KeypadChild:"keypad-child",Ch5Label:"label",Ch5List:"list",Ch5Form:"form",Ch5Image:"img",Ch5ImportHtmlSnippet:"template",Ch5ModalDialog:"dialog",Ch5OverlayPanel:"dialog",Ch5QrCode:"qrcode",Ch5SegmentedGauge:"segmented-gauge",Ch5SignalLevelGauge:"signal-level-gauge",Ch5Select:"listbox",Ch5SelectOption:"option",Ch5Slider:"slider",Ch5SliderButton:"slider-button",Ch5Spinner:"listbox",Ch5SubpageReferenceList:"subpage-reference-list",Ch5TabButton:"tab-button",Ch5TabButtonIndividualButton:"template",Ch5Template:"template",Ch5Text:"label",Ch5TextInput:"textbox",Ch5Toggle:"switch",Ch5TriggerView:"listbox",Ch5TriggerViewChild:"listbox",Ch5Video:"video",Ch5VideoSwitcher:"video-switcher",Ch5VideoSwitcherScreen:"video-switcher-screen",Ch5VideoSwitcherScreenLabel:"video-switcher-screen-label",Ch5VideoSwitcherSource:"video-switcher-source",Ch5VideoSwitcherSourceLabel:"video-switcher-source-label",Ch5WifiSignalLevelGauge:"wifi-signal-level-gauge"};static registerComponent(e){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.getSignalElementAttributeRegistryEntries(e.COMPONENT_PROPERTIES)),"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}},transitionIneffects={bounceIn:["animated","bounceIn"],bounceInDown:["animated","bounceInDown"],bounceInLeft:["animated","bounceInLeft"],bounceInRight:["animated","bounceInRight"],bounceInUp:["animated","bounceInUp"],fadeIn:["animated","fadeIn"],fadeInDown:["animated","fadeInDown"],fadeInDownBig:["animated","fadeInDownBig"],fadeInLeft:["animated","fadeInLeft"],fadeInLeftBig:["animated","fadeInLeftBig"],fadeInRight:["animated","fadeInRight"],fadeInRightBig:["animated","fadeInRightBig"],fadeInUp:["animated","fadeInUp"],fadeInUpBig:["animated","fadeInUpBig"],flipInX:["animated","flipInX"],flipInY:["animated","flipInY"],lightSpeedIn:["animated","lightSpeedIn"],rotateIn:["animated","rotateIn"],rotateInDownLeft:["animated","rotateInDownLeft"],rotateInDownRight:["animated","rotateInDownRight"],rotateInUpLeft:["animated","rotateInUpLeft"],rotateInUpRight:["animated","rotateInUpRight"],rollIn:["animated","rollIn"],zoomIn:["animated","zoomIn"],zoomInDown:["animated","zoomInDown"],zoomInLeft:["animated","zoomInLeft"],zoomInRight:["animated","zoomInRight"],zoomInUp:["animated","zoomInUp"],slideInDown:["animated","slideInDown"],slideInLeft:["animated","slideInLeft"],slideInRight:["animated","slideInRight"],slideInUp:["animated","slideInUp"]},transitionOuteffects={bounceOut:["animated","bounceOut"],bounceOutDown:["animated","bounceOutDown"],bounceOutLeft:["animated","bounceOutLeft"],bounceOutRight:["animated","bounceOutRight"],bounceOutUp:["animated","bounceOutUp"],fadeOut:["animated","fadeOut"],fadeOutDown:["animated","fadeOutDown"],fadeOutDownBig:["animated","fadeOutDownBig"],fadeOutLeft:["animated","fadeOutLeft"],fadeOutLeftBig:["animated","fadeOutLeftBig"],fadeOutRight:["animated","fadeOutRight"],fadeOutRightBig:["animated","fadeOutRightBig"],fadeOutUp:["animated","fadeOutUp"],fadeOutUpBig:["animated","fadeOutUpBig"],flipOutX:["animated","flipOutX"],flipOutY:["animated","flipOutY"],lightSpeedOut:["animated","lightSpeedOut"],rotateOut:["animated","rotateOut"],rotateOutDownLeft:["animated","rotateOutDownLeft"],rotateOutDownRight:["animated","rotateOutDownRight"],rotateOutUpLeft:["animated","rotateOutUpLeft"],rotateOutUpRight:["animated","rotateOutUpRight"],rollOut:["animated","rollOut"],zoomOut:["animated","zoomOut"],zoomOutDown:["animated","zoomOutDown"],zoomOutLeft:["animated","zoomOutLeft"],zoomOutRight:["animated","zoomOutRight"],zoomOutUp:["animated","zoomOutUp"],slideOutDown:["animated","slideOutDown"],slideOutLeft:["animated","slideOutLeft"],slideOutRight:["animated","slideOutRight"],slideOutUp:["animated","slideOutUp"]};function setTransition(e,t,i){if("IN"===i&&t&&"null"!==t&&t in transitionIneffects){const i=transitionIneffects[t];for(let t=0;t<i.length;t++)e.classList.add(i[t])}else if("OUT"===i&&t&&"null"!==t&&t in transitionOuteffects){const i=transitionOuteffects[t];for(let t=0;t<i.length;t++)e.classList.add(i[t])}}function removeTransition(e,t,i){if("IN"===i&&t&&"null"!==t&&t in transitionIneffects){const i=transitionIneffects[t];for(let t=0;t<i.length;t++)e.classList.remove(i[t])}else if("OUT"===i&&t&&"null"!==t&&t in transitionOuteffects){const i=transitionOuteffects[t];for(let t=0;t<i.length;t++)e.classList.remove(i[t])}}import{Subject}from"rxjs";var Ch5Config=class e{static _defaultConfig={attributes:{id:{},component:{}},templatevariables:{id:{}}};static _config=e._defaultConfig;static loadConfig(t){const i=this._defaultConfig;t.hasOwnProperty("attributes")&&(t.attributes.hasOwnProperty("id")&&(i.attributes.id=t.attributes.id),t.attributes.hasOwnProperty("component")&&(i.attributes.component=t.attributes.component)),t.hasOwnProperty("templatevariables")&&t.templatevariables.hasOwnProperty("id")&&(i.templatevariables.id=t.templatevariables.id),e._config=i}static setAttributeForId(t,i,s){e._config.attributes.id.hasOwnProperty(t)||(e._config.attributes.id[t]={}),e._config.attributes.id[t][i.toLowerCase()]=s}static setAttributeForComponent(t,i,s){const n=t.toLowerCase();e._config.attributes.component.hasOwnProperty(n)||(e._config.attributes.component[n]={}),e._config.attributes.component[n][i.toLowerCase()]=s}static setTemplateVarsForId(t,i){e._config.templatevariables.id.hasOwnProperty(t)||(e._config.templatevariables.id[t]=[]),e._config.templatevariables.id[t]=i}static getConfig(){return e._config}static getAttributesForId(t){const i=e._config.attributes.id;return i.hasOwnProperty(t)?i[t]:{}}static getAttributesForComponent(t){const i=e._config.attributes.component;return t=t.toLowerCase(),i.hasOwnProperty(t)?i[t]:{}}static getAttributesForElement(t){let i={};const s=t.tagName.toLowerCase(),n=e.getAttributesForComponent(s);if(t.hasAttribute("id")){const s=t.getAttribute("id");null!==s&&(i=e.getAttributesForId(s))}return{...n,...i}}static getTemplateVarsForElementById(t){const i=e._config.templatevariables.id;return i.hasOwnProperty(t)?i[t]:[]}static getTemplateVarsForElement(t){let i=[];if(t.hasAttribute("id")){const s=t.getAttribute("id");null!==s&&(i=e.getTemplateVarsForElementById(s))}return i}};import _2 from"lodash";var Ch5MutationObserver=class e{static ELEMENTS_MO_EXCEPTION=["swiper-wrapper"];isConnected=!1;_mutationsObserver;_mutationsObserverConfig;_element={};static checkElementValidity(t){return!_2.isNil(t)&&"BODY"!==t.nodeName&&(void 0===t.classList||t.classList.length<=0||e.ELEMENTS_MO_EXCEPTION.indexOf(t.classList[0])<0)}constructor(e){this._element=e,this._mutationsObserver=new MutationObserver(e=>{e.forEach(e=>{"attributes"!==e.type||"style"!==e.attributeName&&"inert"!==e.attributeName||this._updateComponentVisibility(e.target)})}),this._mutationsObserverConfig={attributes:!0,attributeOldValue:!0,childList:!1,subtree:!1,attributeFilter:["style","inert"]}}observe(e){this._mutationsObserver.observe(e,this._mutationsObserverConfig)}disconnectObserver(){this._mutationsObserver instanceof MutationObserver&&(this.isConnected=!1,this._mutationsObserver.disconnect())}_updateComponentVisibility(e){const t=e;_2.isNil(t.offsetParent)||!1===this._shouldUpdateComponentVisibility(e)?this._element.updateElementVisibility(!1):this._element.updateElementVisibility(!0)}_shouldUpdateComponentVisibility(e){let t={};return!(document&&document.defaultView&&(t=document.defaultView.getComputedStyle(e),"0"===t.opacity||"hidden"===t.visibility||e.hasAttribute("inert")))}};import{isNil as isNil4,isEmpty}from"lodash";var Ch5ImageUriModel=class{_schemas={};_user="";_password="";_location="";_protocol="";constructor(e,t,i,s){this.schemas=e,this._protocol=this.getProtocol(s),this.user=t,this.password=i,this.location=s}set schemas(e){isNil4(e)||isEmpty(e)||(this._schemas=e)}get schemas(){return this._schemas}set user(e){isNil4(e)||isEmpty(e)||(this._user=e)}get user(){return this._user}set password(e){isNil4(e)||isEmpty(e)||(this._password=e)}get password(){return this._password}set location(e){if(isNil4(e)||isEmpty(e))return;const t=new RegExp("http(s?)[://]+(www.)*"),i=e.match(t);!isNil4(i)&&i.length>0&&(e=e.replace(i[0],"")),this._location=e}get location(){return this._location}toString(){return this.isValidAuthenticationUri()?`${this._protocol}://${this.user}:${this.password}@${this.location}`:""}isValidAuthenticationUri(){return!(isNil4(this.password)||isEmpty(this.password)||isNil4(this.user)||isEmpty(this.user)||isNil4(this.schemas)||isEmpty(this.schemas)&&this.schemas.http)}getProtocol(e){const t=new RegExp("^http(?:s?)"),i=e.match(t);return i&&"https"===i[0]&&this.schemas.https?this.schemas.https:this.schemas.http}};import isEmpty2 from"lodash/isEmpty";var Ch5CommonLog=class{constructor(e,t=!1,i="",s=""){this.isDebugEnabled=e,this.isTraceEnabled=t,this.crId=i,this.componentId=s}isDebugEnabled;isTraceEnabled;crId;componentId;start(e,t=""){if(!0===this.isTraceEnabled){let i="";!1===Ch5Debug.CONSOLE_OVERRIDDEN&&(i=(new Date).toISOString()),console.group((""!==t?t+" ":"")+i+": "+this.componentId+": "+this.crId+": "+e)}else!0===this.isDebugEnabled&&this.info(e,t)}log(...e){if(!0===this.isTraceEnabled)console.log(...e);else if(!0===this.isDebugEnabled){let t="";!1===Ch5Debug.CONSOLE_OVERRIDDEN&&(t=(new Date).toISOString());try{let i=String((new Error).stack).trim();null!==i&&(i&&(i=i.replace(/^Error\s+/,"")),i&&(i=i.split("\n")[1]),i&&(i=i.replace(/^\s+at Object./,"")),i&&(i=i.replace(/^\s+at HTMLElement./,"")),i&&(i=i.replace(/^\s+at /,"")),i&&(i=i.replace(/ \(.+\)$/,"")),i&&(i=i.replace(/\@.+/,"")),i&&""!==i&&(i="Method is "+i+":")),console.log(t+":"+this.crId+":"+this.componentId+":"+i+":",e)}catch(i){console.log(t+":"+this.crId+":",e)}}}info(e,...t){if(!0===this.isDebugEnabled){let i="";!1===Ch5Debug.CONSOLE_OVERRIDDEN&&(i=(new Date).toISOString());try{let s=String((new Error).stack).trim();null!==s&&(s&&(s=s.replace(/^Error\s+/,"")),s&&(s=s.split("\n")[1]),s&&(s=s.replace(/^\s+at Object./,"")),s&&(s=s.replace(/^\s+at HTMLElement./,"")),s&&(s=s.replace(/^\s+at /,"")),s&&(s=s.replace(/ \(.+\)$/,"")),s&&(s=s.replace(/\@.+/,"")),s&&""!==s&&(s="Method is "+s+":")),console.info(i+":"+this.crId+":"+s+e+":"+t)}catch(s){console.info(i+":"+this.crId+":"+e+":"+t)}}}error(e,...t){if(!0===this.isDebugEnabled){let i="";!1===Ch5Debug.CONSOLE_OVERRIDDEN&&(i=(new Date).toISOString());try{let s=String((new Error).stack).trim();null!==s&&(s&&(s=s.replace(/^Error\s+/,"")),s&&(s=s.split("\n")[1]),s&&(s=s.replace(/^\s+at Object./,"")),s&&(s=s.replace(/^\s+at HTMLElement./,"")),s&&(s=s.replace(/^\s+at /,"")),s&&(s=s.replace(/ \(.+\)$/,"")),s&&(s=s.replace(/\@.+/,"")),s&&""!==s&&(s="Method is "+s+":")),console.error(i+":"+this.crId+":"+s+e+":"+t)}catch(s){console.error(i+":"+this.crId+":"+e+":"+t)}}}stop(){!0===this.isTraceEnabled&&console.groupEnd()}};import _3 from"lodash";var Ch5Common=class e extends HTMLElement{static DIRECTION=["ltr","rtl"];static registerSignalAttributeDefaults(e){Ch5SignalAttributeRegistry.instance.addElementDefaultAttributeEntries(e,{contractName:{attributes:["contractname"],defaultValue:""},booleanJoin:{attributes:["booleanjoinoffset"],defaultValue:"0"},numericJoin:{attributes:["numericjoinoffset"],defaultValue:"0"},stringJoin:{attributes:["stringjoinoffset"],defaultValue:"0"}})}static registerSignalAttributeTypes(e){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e,{contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}})}static SIGNAL_ATTRIBUTE_TYPES={receivestatecustomclass:{direction:"state",stringJoin:1,contractName:!0},receivestatecustomstyle:{direction:"state",stringJoin:1,contractName:!0},receivestateshow:{direction:"state",booleanJoin:1,contractName:!0},receivestateshowpulse:{direction:"state",booleanJoin:1,contractName:!0},receivestatehidepulse:{direction:"state",booleanJoin:1,contractName:!0},receivestateenable:{direction:"state",booleanJoin:1,contractName:!0},sendeventonshow:{direction:"event",booleanJoin:1,contractName:!0}};COMMON_PROPERTIES={SWIPE_GESTURE_ENABLED:{default:!1,valueOnAttributeEmpty:!0,variableName:"_swipeGestureEnabled",attributeName:"swipeGestureEnabled",propertyName:"swipeGestureEnabled",type:"boolean",removeAttributeOnNull:!0,enumeratedValues:["true","false","",!0,!1],componentReference:this,callback:this.updateSwipeGesture.bind(this)},SHOW:{default:!0,valueOnAttributeEmpty:!0,variableName:"_show",attributeName:"show",propertyName:"show",type:"boolean",removeAttributeOnNull:!0,enumeratedValues:["true","false","",!0,!1],componentReference:this,callback:this.updateForChangeInShowStatus.bind(this)},DISABLED:{default:!1,valueOnAttributeEmpty:!0,variableName:"_disabled",attributeName:"disabled",propertyName:"disabled",type:"boolean",removeAttributeOnNull:!0,enumeratedValues:["true","false","",!0,!1],componentReference:this,callback:this.updateForChangeInDisabledStatus.bind(this)}};showTypes=["display","visibility","remove"];_ignoreAttributes=[];primaryCssClass="ch5-common";currentLanguage="";translatableObjects={};childrenOfCurrentNode=null;_customClass="";_prevAddedCustomClasses=[];_customStyle="";_prevAddedStyle="";_show=!0;_noshowType="display";_disabled=!1;_gestureable=!1;_swipeGestureEnabled=!1;_receiveStateCustomClass="";_subKeySigReceiveCustomClass="";_receiveStateCustomStyle="";_subKeySigReceiveCustomStyle="";_receiveStateShow="";_subKeySigReceiveShow="";_receiveStateShowPulse="";_subKeySigReceiveShowPulse="";_receiveStateHidePulse="";_nextSiblingIndexInParentChildNodes=0;_subKeySigReceiveHidePulse="";_receiveStateEnable="";_subKeySigReceiveEnable="";_sigNameSendOnShow="";_sigSendOnShow=null;_onrelease={};_onpress={};_isDebugEnabled=!1;_isTraceEnabled=!1;_listOfAllPossibleComponentCssClasses=[];_crId="";_cssClassHideVisibility="ch5-hide-vis";_cssClassHideDisplay="ch5-hide-dis";_cachedParentEl=null;_cachedNextSibling=null;_isDetachedFromDom=!1;_keepListeningOnSignalsAfterRemoval=!1;observableGestureableProperty;_wasInstatiated=!1;wasInstantiatedInViewport=!1;_appendClassWhenInViewPort="";elementIsInViewPort=!0;elementIntersectionEntry={};elementIsVisible=!0;logger;_commonMutationObserver={};set ignoreAttributes(e){this._ignoreAttributes=e.map(e=>e.toLowerCase())}get ignoreAttributes(){return this._ignoreAttributes}set customClass(e){this.logger.log("set customClass('"+e+"')"),(e=this._checkAndSetStringValue(e))!==this._customClass&&(this._customClass=e,this.setAttribute("customclass",e))}get customClass(){return this._customClass}set customStyle(e){this.logger.log("set customStyle('"+e+"')"),(e=this._checkAndSetStringValue(e))!==this._customStyle&&(this._prevAddedStyle=this._customStyle,this._customStyle=e,this.setAttribute("customstyle",e))}get customStyle(){return this._customStyle}set show(e){this.logger.log("set show('"+e+"')"),(_3.isNil(this.receiveStateShow)||""===this.receiveStateShow)&&this.setAttributeAndProperty(this.COMMON_PROPERTIES.SHOW,e)}get show(){return this._show}set noshowType(e){this.logger.log("set noshowType('"+e+"')"),(e=this._checkAndSetStringValue(e,"none"))!==this._noshowType&&(this.showTypes.indexOf(e)>0?this._noshowType=e:this._noshowType=this.showTypes[0],this.setAttribute("noshowtype",this._noshowType))}get noshowType(){return this._noshowType}set disabled(e){this.logger.log("set disabled('"+e+"')"),(_3.isNil(this.receiveStateEnable)||""===this.receiveStateEnable)&&this.setAttributeAndProperty(this.COMMON_PROPERTIES.DISABLED,e)}get disabled(){return this._disabled}set gestureable(e){this.logger.log("set gestureable('"+e+"')");const t=this.toBoolean(e);e!==this._gestureable&&(this.observableGestureableProperty.next(t),this._gestureable=t,this.setAttribute("gestureable",t.toString()))}get gestureable(){return this._gestureable}set swipeGestureEnabled(e){this.logger.log("set swipeGestureEnabled('"+e+"')"),this.setAttributeAndProperty(this.COMMON_PROPERTIES.SWIPE_GESTURE_ENABLED,e)}get swipeGestureEnabled(){return this._swipeGestureEnabled}set receiveStateCustomClass(e){if(this.logger.log("set receiveStateCustomClass('"+e+"')"),""===(e=this._checkAndSetStringValue(e))||e===this._receiveStateCustomClass)return;this.customClass="",this.clearStringSignalSubscription(this._receiveStateCustomClass,this._subKeySigReceiveCustomClass),this._receiveStateCustomClass=e,this.setAttribute("receivestatecustomclass",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateCustomClass),i=Ch5SignalFactory.getInstance().getStringSignal(t);if(null===i)return;let s=!1;this._subKeySigReceiveCustomClass=i.subscribe(e=>{this.logger.log("subs callback for signalReceiveCustomClass: ",this._receiveStateCustomClass," Signal has value ",e),""!==e&&(s=!0),e!==this.customClass&&s&&(this.customClass=e)})}get receiveStateCustomClass(){return this._attributeValueAsString("receivestatecustomclass")}set receiveStateCustomStyle(e){if(this.logger.log("set receiveStateCustomStyle('"+e+"')"),""===(e=this._checkAndSetStringValue(e))||e===this._receiveStateCustomStyle)return;this.customStyle="",this.clearStringSignalSubscription(this._receiveStateCustomStyle,this._subKeySigReceiveCustomStyle),this._receiveStateCustomStyle=e,this.setAttribute("receivestatecustomstyle",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateCustomStyle),i=Ch5SignalFactory.getInstance().getStringSignal(t);if(null===i)return;let s=!1;this._subKeySigReceiveCustomStyle=i.subscribe(e=>{this.logger.log(" subs callback for signalReceiveCustomStyle: ",this._subKeySigReceiveCustomStyle," Signal has value ",e),""!==e&&(s=!0),e!==this.customStyle&&s&&this.setAttribute("customStyle",e)})}get receiveStateCustomStyle(){return this._attributeValueAsString("receivestatecustomstyle")}set receiveStateEnable(e){if(this.logger.log("set receiveStateEnable('"+e+"')"),""===(e=this._checkAndSetStringValue(e))||e===this._receiveStateEnable)return;this.clearBooleanSignalSubscription(this._receiveStateEnable,this._subKeySigReceiveEnable),this._receiveStateEnable=e,this.setAttribute("receivestateenable",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateEnable),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);null!==i&&(this._subKeySigReceiveEnable=i.subscribe(e=>{this.logger.log(" subs callback for signalReceiveEnable: ",this._subKeySigReceiveEnable," Signal has value ",e),!this.disabled!==e&&this.setAttributeAndProperty(this.COMMON_PROPERTIES.DISABLED,!e,!0)}))}get receiveStateEnable(){return this._attributeValueAsString("receivestateenable")}set receiveStateHidePulse(e){if(this.logger.log("set receiveStateHidePulse('"+e+"')"),""===(e=this._checkAndSetStringValue(e))||e===this._receiveStateHidePulse)return;this.clearBooleanSignalSubscription(this._receiveStateHidePulse,this._subKeySigReceiveHidePulse),this._receiveStateHidePulse=e,this.setAttribute("receivestatehidepulse",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateHidePulse),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);null!==i&&(this._subKeySigReceiveHidePulse=i.subscribe(e=>{this.logger.log(" subs callback for signalReceiveHidePulse: ",this._subKeySigReceiveHidePulse," Signal has value ",e),null!==i?!1===i.prevValue&&!0===e&&this.setAttribute("show","false"):this.logger.log(" subs callback for signalReceiveHidePulse: ",this._subKeySigReceiveHidePulse," recSig is null")}))}get receiveStateHidePulse(){return this._attributeValueAsString("receivestatehidepulse")}set receiveStateShowPulse(e){if(this.logger.log("set receiveStateShowPulse('"+e+"')"),""===(e=this._checkAndSetStringValue(e))||e===this._receiveStateShowPulse)return;this.clearBooleanSignalSubscription(this._receiveStateShowPulse,this._subKeySigReceiveShowPulse),this._receiveStateShowPulse=e,this.setAttribute("receivestateshowpulse",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateShowPulse),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);null!==i&&(this._subKeySigReceiveShowPulse=i.subscribe(e=>{if(this.logger.log(" subs callback for signalReceiveShowPulse: ",this._subKeySigReceiveShowPulse," Signal has value ",e),null!==i){const t=void 0!==e.repeatdigital?e.repeatdigital:e;if(void 0!==i.prevValue.repeatdigital)return void(!1===i.prevValue.repeatdigital&&!0===t&&this.setAttribute("show","true"));!1===i.prevValue&&!0===t&&this.setAttribute("show","true")}}))}get receiveStateShowPulse(){return this._attributeValueAsString("receivestateshowpulse")}set receiveStateShow(e){if(this.logger.log("set receiveStateShow('"+e+"')"),""===(e=this._checkAndSetStringValue(e))||e===this._receiveStateShow)return;this.clearBooleanSignalSubscription(this._receiveStateShow,this._subKeySigReceiveShow),this._receiveStateShow=e,this.setAttribute("receivestateshow",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateShow),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);null!==i?this._subKeySigReceiveShow=i.subscribe(e=>{this.logger.log("subs callback for signalReceiveShow: ",this._subKeySigReceiveShow," Signal has value ",e," this.show",this.show),e!==this.show&&this.setAttributeAndProperty(this.COMMON_PROPERTIES.SHOW,e,!0)}):this.logger.log("recSig for signalReceiveShow is null")}get receiveStateShow(){return this._attributeValueAsString("receivestateshow")}set sendEventOnShow(e){this.sigNameSendOnShow=e}get sendEventOnShow(){return this.sigNameSendOnShow}set sigNameSendOnShow(e){this.logger.log("set sigNameSendOnShow('"+e+"')"),""!==(e=this._checkAndSetStringValue(e))&&e!==this._sigNameSendOnShow&&(this._sigNameSendOnShow=e,this.setAttribute("sendeventonshow",e),this._sigSendOnShow=Ch5SignalFactory.getInstance().getBooleanSignal(this._sigNameSendOnShow))}get sigNameSendOnShow(){return this._sigNameSendOnShow}set onrelease(e){this._onrelease=e}get onrelease(){return this._onrelease}set onpress(e){this.logger.log("set onpress"),this._onpress=e}get onpress(){return this.logger.log("get onpress"),this._onpress}set appendClassWhenInViewPort(e){e!==this._appendClassWhenInViewPort&&(this._appendClassWhenInViewPort=e,this.setAttribute("appendClassWhenInViewPort",e.toString()))}get appendClassWhenInViewPort(){return this._appendClassWhenInViewPort}constructor(){super(),this._crId=Ch5Uid.getUid(),this.logger=new Ch5CommonLog(!1,!1,this._crId,this.id);const e=[];e.push(this.primaryCssClass+"--disabled"),this._listOfAllPossibleComponentCssClasses=e,this.observableGestureableProperty=new Subject;const t=Ch5SignalFactory.getInstance().getStringSignal(languageChangedSignalName);null!==t&&t.subscribe(e=>{""!==e&&e!==this.currentLanguage&&(this.currentLanguage=e,Object.keys(this.translatableObjects).forEach(e=>{let t=this;void 0===t[e]&&void 0!==t.attrModel&&(t=t.attrModel),void 0!==t[e.toString()]&&void 0!==this.translatableObjects[e.toString()]&&(t[e.toString()]=this.translatableObjects[e],this.translateCallback(e.toString()))}))})}static getMeasurementUnitFromSizeValue(t){const i=new RegExp("^(?:[0-9]+)(\\w*|%)$");let s="px";if(!_3.isNil(t)){const n=t.match(i);null!==n&&e.isNotNil(n[1])&&(s=n[1])}return s}static extractMeasurementNumber(e){const t=new RegExp("^-?\\d+\\.?\\d*");let i=0;if(null!=e){const s=e.match(t);null!==s&&void 0!==s[0]&&(i=Number(s[0]))}return i}static getMeasurementPxNumber(t){return"px"!==e.getMeasurementUnitFromSizeValue(t)?e.convertAltUnitsToPx(t):Math.round(e.extractMeasurementNumber(t))}static convertAltUnitsToPx(t){const i=e.getMeasurementUnitFromSizeValue(t),s=parseFloat(t);let n=s;switch(i){case"vh":n=e.convertVhUnitsToPx(s);break;case"vw":n=e.convertVwUnitsToPx(s)}return Math.round(n)}static convertPxUnitToAlt(t,i){let s=t;switch(i){case"vw":s=e.convertPxUnitToVw(t);break;case"vh":s=e.convertPxUnitToVh(t)}return Math.ceil(s)}static convertVhUnitsToPx(e){return e*(window.innerHeight||document.documentElement.clientHeight)/100}static convertVwUnitsToPx(e){return e*(window.innerWidth||document.documentElement.clientWidth)/100}static convertPxUnitToVh(e){return e/(window.innerHeight||document.documentElement.clientHeight)*100}static convertPxUnitToVw(e){return e/(window.innerWidth||document.documentElement.clientWidth)*100}static handlingTextTransformValue(e,t){let i=e;if(null==e)return"";switch(t){case"capitalize":i=i.replace(/\b\w/g,e=>e.toUpperCase());break;case"uppercase":i=i.toUpperCase();break;case"lowercase":i=i.toLowerCase()}return i}static processUri(e){let t="";return Ch5Platform.getInstance().registerUpdateCallback(i=>{if(e.protocol)return;const{http:s,https:n}=i.capabilities.supportCredentialIntercept,r={http:s,https:n};if(!s&&!n)return;e.protocol=n||s;const a=new Ch5ImageUriModel(r,e.user,e.password,e.url);a.isValidAuthenticationUri()&&(t=a.toString())}),t}static isNil(e,t=!0){return!0===t?_3.isNil(e)||""===e||""===e.toString().trim():_3.isNil(e)||""===e}static isNotNil(t,i=!0){return!e.isNil(t,i)}_t(e){let t=e;const i=Ch5TranslationUtility.getInstance(),s=i.valuesToTranslation(e);return s&&s.length>0&&s.forEach(e=>{if(i.isTranslationIdentifier(e)){const s=i.stripDownTranslationCharacters(e);if(i.getTranslator().exists(s)){const n=i.getTranslator().t(s);t=t.replace(e,n)}}}),t}resolveTemplateChildren(t){t&&!e.isNil(t.content)&&0===t.content.childElementCount&&t.children.length>0&&Array.from(t.children).forEach(e=>{t.content.appendChild(e)})}_getTranslatedValue(e,t){const i=Ch5TranslationUtility.getInstance();let s=t,n=t,r=this.translatableObjects[e];r===t&&(s=r);if(!i.isTranslationIdentifier(s))return t;if(void 0===r)r=t,n=this._t(t);else{i.isTranslationIdentifier(r)?(this._t(r)!==t&&i.hasMultipleIdentifiers(r)&&(r=t),n=this._t(r)):(r!==t&&(r=t),n=this._t(t))}return this.translatableObjects[e]=r,n}static get observedAttributes(){return["customclass","customstyle","show","noshowtype","disabled","gestureable","swipegestureenabled","receivestatecustomclass","receivestatecustomstyle","receivestateshow","receivestateshowpulse","receivestatehidepulse","receivestateenable","sendeventonshow","debug","trace","dir","appendclasswheninviewport"]}getCrId(){return this._crId}info(e,...t){this.logger.info(e,t)}error(e,...t){this.logger.error(e,t)}isDebug(){return this._isDebugEnabled}isTrace(){return this._isTraceEnabled}attributeChangedCallback(e,t,i){if(t!==i&&!this.ignoreAttributes.includes(e.toLowerCase()))switch(this.logger.log('ch5-common attributeChangedCallback("'+e+'","'+t+'","'+i+')"'),e){case"customclass":this.logger.log("CustomClass Set in Common"),this.hasAttribute("customclass")?this.customClass=this.getAttribute("customclass"):this.customClass="",this.updateForChangeInCustomCssClass();break;case"customstyle":this.hasAttribute("customstyle")?this.customStyle=this.getAttribute("customstyle"):this.customStyle="",this.updateForChangeInStyleCss();break;case"show":this.show=i;break;case"swipegestureenabled":this.swipeGestureEnabled=i;break;case"noshowtype":this.updateForChangeInShowStatus();break;case"receivestatecustomclass":this.hasAttribute("receivestatecustomclass")?this.receiveStateCustomClass=this.getAttribute("receivestatecustomclass"):(this.clearStringSignalSubscription(this._receiveStateCustomClass,this._subKeySigReceiveCustomClass),this._receiveStateCustomClass="");break;case"receivestatecustomstyle":this.hasAttribute("receivestatecustomstyle")?this.receiveStateCustomStyle=this.getAttribute("receivestatecustomstyle"):(this.clearStringSignalSubscription(this._receiveStateCustomStyle,this._subKeySigReceiveCustomStyle),this._receiveStateCustomStyle="");break;case"receivestateshow":this.hasAttribute("receivestateshow")?this.receiveStateShow=this.getAttribute("receivestateshow"):(this.clearBooleanSignalSubscription(this._receiveStateShow,this._subKeySigReceiveShow),this._sigNameSendOnShow="");break;case"receivestateshowpulse":this.hasAttribute("receivestateshowpulse")?this.receiveStateShowPulse=this.getAttribute("receivestateshowpulse"):(this.clearBooleanSignalSubscription(this._receiveStateShowPulse,this._subKeySigReceiveShowPulse),this._receiveStateShowPulse="");break;case"receivestatehidepulse":this.hasAttribute("receivestatehidepulse")?this.receiveStateHidePulse=this.getAttribute("receivestatehidepulse"):(this.clearBooleanSignalSubscription(this._receiveStateHidePulse,this._subKeySigReceiveHidePulse),this._receiveStateHidePulse="");break;case"receivestateenable":this.hasAttribute("receivestateenable")?this.receiveStateEnable=this.getAttribute("receivestateenable"):(this.clearBooleanSignalSubscription(this._receiveStateEnable,this._subKeySigReceiveEnable),this._receiveStateEnable="");break;case"sendeventonshow":this.hasAttribute("sendeventonshow")?this.sigNameSendOnShow=this.getAttribute("sendeventonshow"):(this._sigSendOnShow=null,this._sigNameSendOnShow="");break;case"disabled":this.hasAttribute("customclassdisabled")||(this.disabled=i);break;case"gestureable":this.hasAttribute("gestureable")?this.gestureable=this.toBoolean(i):this.gestureable=!1;break;case"debug":this.hasAttribute("debug")?this._isDebugEnabled=!0:this._isDebugEnabled=!1,this.logger.isDebugEnabled=this._isDebugEnabled;break;case"trace":let e=!1;e=!!this.hasAttribute("trace"),this.logger.isTraceEnabled=e;break;case"dir":const t=this.getAttribute("dir")||"";t!==this.dir&&(this.dir=t);break;case"appendclasswheninviewport":this.hasAttribute("appendclasswheninviewport")&&(this.appendClassWhenInViewPort=this.getAttribute("appendClassWhenInViewPort"))}}cacheComponentChildrens(){this.childrenOfCurrentNode=Array.from(this.children).filter(e=>e.isConnected)}repaint(){try{const e=this.parentNode;if(this._wasInstatiated=!1,!0===this.hasChildNodes()){for(let e=this.childNodes.length;e--;){let t=!0;this.childrenOfCurrentNode&&this.childrenOfCurrentNode.length>0&&Array.from(this.childrenOfCurrentNode).filter(i=>{null!==i&&Object.is(i,this.childNodes[e])&&(t=!1)}),!0===t&&this.removeChild(this.childNodes[e])}const t=document.createElement("div");null!==e&&(e.insertBefore(t,this.nextSibling),this.remove(),t.parentNode.insertBefore(this,t.nextSibling),t.remove())}}catch(e){console.log("Error encountered during repaint crId: "+this.getCrId()+" error ",e)}}updateCssClasses(){this.logger.log("from common - updateCssClasses()")}updateForChangeInCustomCssClass(){const e=this.getTargetElementForCssClassesAndStyle();this.logger.start("updateForChangeInCustomCssClass()"),this.logger.log("updateForChangeInCustomCssClass()",this._prevAddedCustomClasses),this.logger.log("from common - updateForChangeInCustomCssClass()",this.customClass),this._prevAddedCustomClasses.forEach(t=>{""!==t&&e.classList.remove(t)}),this._prevAddedCustomClasses=[],this.customClass.split(" ").forEach(t=>{""!==t&&(this._prevAddedCustomClasses.push(t),e.classList.add(t))}),this.logger.stop()}updateForChangeInStyleCss(){const e=this.getTargetElementForCssClassesAndStyle();this.logger.log("from common - updateForChangeInStyleCss()"),e.style.cssText=this.customStyle}updateForChangeInShowStatusOld(){const e=this;this.logger.log("from common - updateForChangeInShowStatus()"),!1===this._show?this.handleHide(e):this.handleShow(e)}updateSwipeGesture(){}updateForChangeInShowStatus(){const e=this;this.logger.log("from common - updateForChangeInShowStatus()"),this.hasAttribute("noshowtype")?this.noshowType=this.getAttribute("noshowtype"):this.noshowType="display",!1===this._show?this.handleHide(e):this.handleShow(e)}handleHide(e){var t,i;switch(this.beforeHandlingHide(),this.logger.log("handleHide"),this.sendShowSignal(!1),this._noshowType){case"visibility":e.classList.add(this._cssClassHideVisibility),e.classList.remove(this._cssClassHideDisplay);break;case"display":e.classList.add(this._cssClassHideDisplay),e.classList.remove(this._cssClassHideVisibility);break;case"remove":e.classList.remove(this._cssClassHideDisplay),e.classList.remove(this._cssClassHideVisibility),"ch5-modal-dialog"===(null==(t=this.parentElement)?void 0:t.tagName.toLowerCase())||"ch5-overlay-panel"===(null==(i=this.parentElement)?void 0:i.tagName.toLowerCase())?setTimeout(()=>{null!==this.parentElement&&void 0!==this.parentElement&&(this._cachedParentEl=this.parentElement,this.logger.log(" removes element from DOM due to change in show signal, cached parent element"),null!==this.nextElementSibling&&void 0!==this.nextElementSibling&&(this._nextSiblingIndexInParentChildNodes=Array.from(this.parentElement.childNodes).findIndex(e=>e===this.nextElementSibling),this._cachedNextSibling=this.nextElementSibling,this.logger.log(" cached sibling element")),this._keepListeningOnSignalsAfterRemoval=!0,this._isDetachedFromDom=!0,this.parentElement.removeChild(this))}):null!==this.parentElement&&void 0!==this.parentElement&&(this._cachedParentEl=this.parentElement,this.logger.log(" removes element from DOM due to change in show signal, cached parent element"),null!==this.nextElementSibling&&void 0!==this.nextElementSibling&&(this._nextSiblingIndexInParentChildNodes=Array.from(this.parentElement.childNodes).findIndex(e=>e===this.nextElementSibling),this._cachedNextSibling=this.nextElementSibling,this.logger.log(" cached sibling element")),this._keepListeningOnSignalsAfterRemoval=!0,this._isDetachedFromDom=!0,this.parentElement.removeChild(this))}this.afterHandlingHide()}handleShow(e){if(this.beforeHandlingShow(),this.logger.log("handleShow"),e.classList.remove(this._cssClassHideDisplay),e.classList.remove(this._cssClassHideVisibility),null!==this._cachedParentEl&&void 0!==this._cachedParentEl){const e=this._cachedParentEl;if(this._cachedParentEl=null,null!==this._cachedNextSibling&&void 0!==this._cachedNextSibling&&e===this._cachedNextSibling.parentElement){const t=this._cachedNextSibling;this._cachedNextSibling=null,e.insertBefore(this,t),this.logger.log(" inserted element before cached sibling due to change in show signal"),this._keepListeningOnSignalsAfterRemoval=!1}else{if(this._nextSiblingIndexInParentChildNodes){const t=e.childNodes[this._nextSiblingIndexInParentChildNodes];e.insertBefore(this,t)}else e.appendChild(this);this.logger.log(" appended element to parent due to change in show signal"),this._keepListeningOnSignalsAfterRemoval=!1}this._isDetachedFromDom=!1}this.sendShowSignal(!0),this.afterHandlingShow()}beforeHandlingShow(){}afterHandlingShow(){}beforeHandlingHide(){}afterHandlingHide(){}updateForChangeInDisabledStatus(){const e=this.getTargetElementForCssClassesAndStyle();this.logger.log("from common - updateForChangeInDisabledStatus()"),!0===this._disabled?e.classList.add(this.getCssClassDisabled()):e.classList.remove(this.getCssClassDisabled())}getTargetElementForCssClassesAndStyle(){return this}initAttributes(){this.applyPreConfiguredAttributes(),this.hasAttribute("disabled")&&!this.hasAttribute("customclassdisabled")&&!1===this.ignoreAttributes.includes("disabled")&&(this.disabled=this.getAttribute("disabled")),this.hasAttribute("debug")&&!1===this.ignoreAttributes.includes("debug")&&(this._isDebugEnabled=!0),this.hasAttribute("show")&&!1===this.ignoreAttributes.includes("show")&&(this.show=this.getAttribute("show")),this.hasAttribute("swipegestureenabled")&&!1===this.ignoreAttributes.includes("swipegestureenabled")&&(this.swipeGestureEnabled=this.getAttribute("swipegestureenabled")),this.hasAttribute("customclass")&&!1===this.ignoreAttributes.includes("customclass")&&(this.customClass=this.getAttribute("customclass"),this.updateForChangeInCustomCssClass()),this.hasAttribute("customstyle")&&!1===this.ignoreAttributes.includes("customstyle")&&(this.customStyle=this.getAttribute("customstyle"),this.updateForChangeInStyleCss()),this.hasAttribute("noshowtype")&&!1===this.ignoreAttributes.includes("noshowtype")&&(this.noshowType=this.getAttribute("noshowtype")),this.hasAttribute("receivestatecustomclass")&&!1===this.ignoreAttributes.includes("receivestatecustomclass")&&(this.receiveStateCustomClass=this.getAttribute("receivestatecustomclass")),this.hasAttribute("receivestatecustomstyle")&&!1===this.ignoreAttributes.includes("receivestatecustomstyle")&&(this.receiveStateCustomStyle=this.getAttribute("receivestatecustomstyle")),this.hasAttribute("receivestateshow")&&!1===this.ignoreAttributes.includes("receivestateshow")&&(this.receiveStateShow=this.getAttribute("receivestateshow")),this.hasAttribute("receivestateshowpulse")&&!1===this.ignoreAttributes.includes("receivestateshowpulse")&&(this.receiveStateShowPulse=this.getAttribute("receivestateshowpulse")),this.hasAttribute("receivestatehidepulse")&&!1===this.ignoreAttributes.includes("receivestatehidepulse")&&(this.receiveStateHidePulse=this.getAttribute("receivestatehidepulse")),this.hasAttribute("receivestateenable")&&!1===this.ignoreAttributes.includes("receivestateenable")&&(this.receiveStateEnable=this.getAttribute("receivestateenable")),this.hasAttribute("sendeventonshow")&&!1===this.ignoreAttributes.includes("sendeventonshow")&&(this.sigNameSendOnShow=this.getAttribute("sendeventonshow")),this.hasAttribute("gestureable")&&!1===this.ignoreAttributes.includes("gestureable")&&(this.gestureable=this.toBoolean(this.getAttribute("gestureable"))),this.dir=this.getAttribute("dir")||e.DIRECTION[0],this.hasAttribute("appendclasswheninviewport")&&!1===this.ignoreAttributes.includes("appendclasswheninviewport")&&(this.appendClassWhenInViewPort=this.getAttribute("appendclasswheninviewport"),subscribeInViewPortChange(this,e=>{this.updateElementVisibility(e),this.updateInViewPortClass()}))}attachEventListeners(){}removeEventListeners(){}_checkAndSetStringValue(t,i=""){return e.isNil(t)&&(t=i),t}clearStringSignalSubscription(e,t){let i=null;if(e){const t=Ch5Signal.getSubscriptionSignalName(e);i=Ch5SignalFactory.getInstance().getStringSignal(t)}null!==i&&""!==t&&i.unsubscribe(t)}clearBooleanSignalSubscription(e,t){let i=null;if(e){const t=Ch5Signal.getSubscriptionSignalName(e);i=Ch5SignalFactory.getInstance().getBooleanSignal(t)}null!==i&&""!==t&&i.unsubscribe(t)}clearNumberSignalSubscription(t,i){let s=null;if(e.isNotNil(t)){const e=Ch5Signal.getSubscriptionSignalName(t);s=Ch5SignalFactory.getInstance().getNumberSignal(e)}null!==s&&""!==i&&s.unsubscribe(i)}sendShowSignal(e){if(this.logger.log("sendShowSignal "+e+" "+this._sigNameSendOnShow),""!==this._sigNameSendOnShow){const t=Ch5SignalFactory.getInstance().getBooleanSignal(this._sigNameSendOnShow);null!==t&&t.publish(e)}}attributeChangeHandler(e,t,i){let s="";return this.hasAttribute(e)&&(s=t!==i?i:t),s}applyPreConfiguredAttributes(){const e=Ch5Config.getAttributesForElement(this);for(const t in e)e.hasOwnProperty(t)&&(this.hasAttribute(t)||this.setAttribute(t,e[t]))}_attributeValueAsString(e){let t="";return e=e.toLowerCase(),this.hasAttribute(e)&&(t=""+this.getAttribute(e)),t}contentCleanUp(){if(this.children.length){Array.from(this.children).forEach(e=>"TEMPLATE"!==e.nodeName&&e.remove())}}getCssClassDisabled(){return"ch5-disabled"}unsubscribeFromSignals(){!1===this._keepListeningOnSignalsAfterRemoval&&(this.clearBooleanSignalSubscription(this._receiveStateEnable,this._subKeySigReceiveEnable),this._receiveStateEnable="",this.clearBooleanSignalSubscription(this._receiveStateShow,this._subKeySigReceiveShow),this._receiveStateShow="",this.clearBooleanSignalSubscription(this._receiveStateShowPulse,this._subKeySigReceiveShowPulse),this._receiveStateShowPulse="",this.clearBooleanSignalSubscription(this._receiveStateHidePulse,this._subKeySigReceiveHidePulse),this._receiveStateHidePulse="",this.clearStringSignalSubscription(this._receiveStateCustomStyle,this._subKeySigReceiveCustomStyle),this._receiveStateCustomStyle="",this.clearStringSignalSubscription(this._receiveStateCustomClass,this._subKeySigReceiveCustomClass),this._receiveStateCustomClass="")}debounce=(e,t)=>{let i;return function(...s){window.clearTimeout(i),i=window.setTimeout(()=>{window.clearTimeout(i),e(...s)},t)}};toBoolean(e,t=!1){switch(String(e).toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1;case"":case null:case void 0:case"null":case"undefined":return!0===t;default:return!1}}translateCallback(e){}componentLoadedEvent(e,t){publishEvent("object",e,{loaded:!0,id:t})}updateInViewPortClass(){const e=this.getTargetElementForCssClassesAndStyle();this.logger.log("from common - updateInViewPortClass()"),""!==this._appendClassWhenInViewPort&&(this.elementIsInViewPort?e.classList.add(this._appendClassWhenInViewPort):e.classList.remove(this._appendClassWhenInViewPort))}updateElementVisibility(e){this.elementIsVisible=e}initCommonMutationObserver(e){this._commonMutationObserver=new Ch5MutationObserver(this),this._commonMutationObserver.isConnected=!0;let t=e;for(;Ch5MutationObserver.checkElementValidity(t);)this._commonMutationObserver.observe(t),t=t.parentNode}updateElementVisibilityInViewport(e){this.elementIsInViewPort=e,this.updateInViewPortClass()}disconnectCommonMutationObserver(){e.isNil(this._commonMutationObserver)||isEmpty2(this._commonMutationObserver)||this._commonMutationObserver.disconnectObserver()}checkIfValueIsTruey(e=""){return!!e&&e.length>0&&"false"!==e&&"0"!==e&&null!==e}convertAnalogValueBasedOnSignalResponse(e){const t=65535,i=-65535;let s=e;return s>32767?(s=s>t?t:s,s-=65536):s<-32768&&(s=s>i?s:i,s+=65536),s}setAttributeAndProperty(e,t,i=!1){this.logger.log("setAttributeAndProperty: "+e.attributeName+' - "'+t+'"');const s=e.attributeName.toLowerCase(),n=e.componentReference;if("boolean"===e.type){let r=!1;if(typeof t===e.type)r=t;else if(this.hasAttribute(s)){let i=t;[!0,!1,"true","false","0","1",0,1,"",null].indexOf(i)<0&&(i=e.default),r=this.toBoolean(i,e.valueOnAttributeEmpty)}else r=e.default;n[e.propertyName]===r&&!0!==i&&!0===n[e.variableName+"Initialized"]&&String(t)===String(r)||(n[e.variableName]=r,n[e.variableName+"Initialized"]=!0,e.enumeratedValues&&e.enumeratedValues.length>0&&e.enumeratedValues.indexOf(String(n.getAttribute(t)))<0&&!0===e.removeAttributeOnNull?this.hasAttribute(s)||!0===i?n.setAttribute(s,r.toString()):n.removeAttribute(s):n.setAttribute(s,r.toString()),_3.isNil(e.callback)||e.callback())}else"enum"===e.type?n[s]!==t&&(e.enumeratedValues.indexOf(t)>=0?(n.setAttribute(s,String(t)),n[e.variableName]=String(t)):_3.isNil(e.default)?(n.removeAttribute(s),n[e.variableName]=String(e.default)):(n.setAttribute(s,String(e.default)),n[e.variableName]=String(e.default)),_3.isNil(e.callback)||e.callback()):"string"===e.type&&n[s]!==t&&(_3.isNil(t)||""===String(t).trim()?(n.removeAttribute(s),n[e.variableName]=String(e.default)):(n.setAttribute(s,String(t)),n[e.variableName]=String(t)),_3.isNil(e.callback)||e.callback())}},Ch5RoleAttributeMapping=class{static ch5Animation="animation";static ch5Background="region";static ch5Button="button";static ch5ButtonLabel="label";static ch5ButtonMode="template";static ch5ButtonModeState="template";static ch5ButtonList="button-list";static ch5ButtonListMode="template";static ch5ButtonListModeState="template";static ch5ButtonListLabel="label";static ch5ButtonListIndividualButton="template";static ch5ColorChip="color-chip";static ch5ColorPicker="color-picker";static ch5Dpad="dpad";static ch5DateTime="datetime";static ch5DpadChild="dpad-child";static ch5Keypad="keypad";static ch5KeypadChild="keypad-child";static ch5Label="label";static ch5List="list";static ch5Form="form";static ch5Image="img";static ch5ImportHtmlSnippet="template";static ch5MediaPlayer="media-player";static ch5ModalDialog="dialog";static ch5OverlayPanel="dialog";static ch5QrCode="QR code";static ch5SegmentedGauge="segmented-gauge";static ch5SignalLevelGauge="signal-level-gauge";static ch5Select="listbox";static ch5SelectOption="option";static ch5Slider="slider";static ch5SliderButton="slider-button";static ch5Spinner="listbox";static ch5SubpageReferenceList="subpage-reference-list";static ch5TabButton="tab-button";static ch5TabButtonIndividualButton="template";static ch5Template="template";static ch5Text="label";static ch5TextInput="textbox";static ch5Toggle="switch";static ch5TriggerView="listbox";static ch5TriggerViewChild="listbox";static ch5Video="video";static ch5VideoSwitcher="video-switcher";static ch5VideoSwitcherScreen="video-switcher-screen";static ch5VideoSwitcherScreenLabel="video-switcher-screen-label";static ch5VideoSwitcherSource="video-switcher-source";static ch5VideoSwitcherSourceLabel="video-switcher-source-label";static ch5WifiSignalLevelGauge="wifi-signal-level-gauge"};import _5 from"lodash";import _4 from"lodash";var Ch5Property=class{constructor(e,t){this.ch5Component=e,this.property=t,this._attributeName=t.name.toLowerCase(),this._propertyName=t.name,this._propertyPreviousValue=null,this._propertyValue=t.default,t.signalType&&(this._propertySignalType=t.signalType)}ch5Component;property;_attributeName="";_signalName="";_signalValue="";_signalState="";_propertyName="";_propertyPreviousValue=null;_propertyValue;_propertySignalValue=null;initializedValue=!1;_propertySignalType="";get signalType(){return this._propertySignalType}get previousValue(){return this._propertyPreviousValue}get value(){return this._propertyValue}set value(e){this.processValue(e,!1)}get name(){return this._propertyName}get attributeName(){return this._attributeName}get signalName(){return this._signalName}set signalName(e){this._signalName=e}get signalValue(){return this._signalValue}set signalValue(e){this._signalValue=e}get signalState(){return this._signalState}set signalState(e){this._signalState=e}setValue(e,t,i){this.processValue(e,!1,t,i)}setValueFromSignal(e,t,i){this.processValue(e,!0,t,i)}clearProperty(){this._signalName="",this._signalValue="",this._signalState="",this._propertyPreviousValue=null,this._propertyValue=this.property.default,this._propertySignalValue=null,this.initializedValue=!1}processValue(e,t,i,s){if(_4.isNil(e)&&this.property.isNullable&&!0===this.property.isNullable)return this._propertyPreviousValue=this._propertyValue,this._propertyValue=null,this.ch5Component.removeAttribute(this._attributeName),_4.isNil(i)||i(),!0;if("boolean"===this.property.type){let s;if(typeof e===this.property.type)s=e;else if(this.ch5Component.hasAttribute(this._attributeName)){let t=e;[!0,!1,"true","false","0","1",0,1,"",null].indexOf(t)<0&&(t=this.property.default),s=this.toBoolean(t,this.property.valueOnAttributeEmpty)}else s=this.property.default;if(this._propertyValue!==s||!0===t||!1===this.initializedValue||e!==s)return this._propertyPreviousValue=this._propertyValue,this._propertyValue=s,this.initializedValue=!0,["true","false",""].indexOf(String(this.ch5Component.getAttribute(this._attributeName)))<0&&!0===this.property.removeAttributeOnNull?this.ch5Component.hasAttribute(this._attributeName)||!0===t?this.ch5Component.setAttribute(this._attributeName,String(s)):this.ch5Component.removeAttribute(this._attributeName):this.ch5Component.setAttribute(this._attributeName,String(s)),_4.isNil(i)||i(),!0}else if("enum"===this.property.type){if(this._propertyValue!==e)return this.property.enumeratedValues&&this.property.enumeratedValues.length>0&&this.property.enumeratedValues.indexOf(e)>=0?(this._propertyPreviousValue=this._propertyValue,this._propertyValue=String(e),this.ch5Component.setAttribute(this._attributeName,String(e))):_4.isNil(this.property.default)?(this.ch5Component.removeAttribute(this._attributeName),this._propertyPreviousValue=this._propertyValue,this._propertyValue=String(this.property.default)):(this._propertyPreviousValue=this._propertyValue,this._propertyValue=String(this.property.default),this.ch5Component.setAttribute(this._attributeName,String(this.property.default))),_4.isNil(i)||i(),!0}else if("number"===this.property.type){if(!isNaN(e)&&Number.isInteger(parseInt(e,10))||(e=this.property.default,this.ch5Component.setAttribute(this._attributeName,String(e))),e=Number(e),this._propertyValue!==e)return this.property.numberProperties?((e<this.property.numberProperties.min||e>this.property.numberProperties.max)&&(e>this.property.numberProperties.conditionalMax?e=this.property.numberProperties.conditionalMaxValue:e<this.property.numberProperties.conditionalMin&&(e=this.property.numberProperties.conditionalMinValue)),this._propertyPreviousValue=this._propertyValue,this._propertyValue=e,this.ch5Component.setAttribute(this._attributeName,String(e))):(this._propertyPreviousValue=this._propertyValue,this._propertyValue=this.property.default,this.ch5Component.setAttribute(this._attributeName,String(this.property.default))),_4.isNil(i)||i(),!0}else if("string"===this.property.type&&this._propertyValue!==String(e).trim()&&(_4.isNil(e)||""===String(e).trim()?(this._propertyPreviousValue=this._propertyValue,this._propertyValue=String(this.property.default),this.ch5Component.removeAttribute(this._attributeName)):(this._propertyPreviousValue=this._propertyValue,this._propertyValue=String(e).trim(),this.ch5Component.setAttribute(this._attributeName,String(e).trim())),_4.isNil(i)||i(),!0===this.property.isSignal))if("number"===this.property.signalType){const t=this.setSignalByNumber(e);_4.isNil(t)||(this.signalState=t.subscribe(e=>(_4.isNil(s)||e!==this._propertySignalValue&&(this._propertySignalValue=e,s(e)),!0)))}else if("string"===this.property.signalType){const t=this.setSignalByString(e);_4.isNil(t)||(this.signalState=t.subscribe(e=>(_4.isNil(s)||e!==this._propertySignalValue&&(this._propertySignalValue=e,s(e)),!0)))}else if("boolean"===this.property.signalType){const t=this.setSignalByBoolean(e);_4.isNil(t)||(this.signalState=t.subscribe(e=>(_4.isNil(s)||e!==this._propertySignalValue&&(this._propertySignalValue=e,s(e)),!0)))}return!1}setSignalByNumber(e){if(this.signalValue===e||null===e)return null;if(this.signalValue){const e=Ch5Signal.getSubscriptionSignalName(this.signalValue),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&t.unsubscribe(this.signalState)}this.signalValue=e;const t=Ch5Signal.getSubscriptionSignalName(this.signalValue),i=Ch5SignalFactory.getInstance().getNumberSignal(t);return null===i?null:i}setSignalByString(e){if(this.signalValue===e||null===e)return null;if(this.signalValue){const e=Ch5Signal.getSubscriptionSignalName(this.signalValue),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&t.unsubscribe(this.signalState)}this.signalValue=e;const t=Ch5Signal.getSubscriptionSignalName(this.signalValue),i=Ch5SignalFactory.getInstance().getStringSignal(t);return null===i?null:i}setSignalByBoolean(e){if(this.signalValue===e||null===e)return null;if(this.signalValue){const e=Ch5Signal.getSubscriptionSignalName(this.signalValue),t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&t.unsubscribe(this.signalState)}this.signalValue=e;const t=Ch5Signal.getSubscriptionSignalName(this.signalValue),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);return null===i?null:i}toBoolean(e,t=!1){switch(String(e).toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1;case"":case null:case void 0:case"null":case"undefined":return!0===t;default:return!1}}},Ch5Properties=class{constructor(e,t){this.ch5Component=e,this.propertiesArray=t;for(let i=0;i<t.length;i++){const s=new Ch5Property(e,t[i]);this._properties.push(s)}}ch5Component;propertiesArray;_properties=[];addProperty(e){const t=new Ch5Property(this.ch5Component,e);this._properties.push(t)}unsubscribe(){const e=Ch5SignalFactory.getInstance();for(const t of this._properties){if(""!==t.signalState&&""!==t.signalValue){const i=Ch5Signal.getSubscriptionSignalName(t.signalValue);if("string"===t.signalType){const s=e.getStringSignal(i);null!==s&&(s.unsubscribe(t.signalState),t.signalValue="",t.signalState="")}else if("number"===t.signalType){const s=e.getNumberSignal(i);null!==s&&(s.unsubscribe(t.signalState),t.signalValue="",t.signalState="")}else if("boolean"===t.signalType){const s=e.getBooleanSignal(i);null!==s&&(s.unsubscribe(t.signalState),t.signalValue="",t.signalState="")}}t.clearProperty()}}getPrevious(e){var t;return null==(t=this.getPropertyByName(e))?void 0:t.previousValue}get(e){var t;return null==(t=this.getPropertyByName(e))?void 0:t.value}set(e,t,i,s){const n=this.getPropertyByName(e);n&&(_5.isNil(n.property.nameForSignal)||""===n.property.nameForSignal||!1===this.isAttributeAvailableInComponent(n.property.nameForSignal))&&n.setValue(t,i,s)}setForSignalResponse(e,t,i,s){const n=this.getPropertyByName(e);n&&n.setValueFromSignal(t,i,s)}isAttributeAvailableInComponent(e){var t;return this.ch5Component.hasAttribute(e)&&""!==(null==(t=this.ch5Component.getAttribute(e))?void 0:t.trim())}getPropertyByName(e){const t=this._properties.find(t=>t.name===e);return t||null}},Ch5Animation=class e extends Ch5Common{static SIZES=["regular","small","large","x-large"];static ANIMATION_STYLES=["ring","spinner","roller"];static ANIMATION_STYLES_CLASS=["fa-circle-notch","fa-spinner","fa-sync"];static COMPONENT_DATA={SIZE:{default:e.SIZES[0],values:e.SIZES,key:"size",attribute:"size",classListPrefix:"--size-"},ANIMATION_STYLE:{default:e.ANIMATION_STYLES[0],values:e.ANIMATION_STYLES,key:"animationstyle",attribute:"animationstyle",classListPrefix:"--style-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateanimate:{direction:"state",booleanJoin:1,contractName:!0},receivestateframespersecond:{direction:"state",numericJoin:1,contractName:!0},receivestateanimationstyle:{direction:"state",stringJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:!0,name:"startAnimating",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.SIZES[0],enumeratedValues:e.SIZES,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZES[0],isObservableProperty:!0},{default:e.ANIMATION_STYLES[0],enumeratedValues:e.ANIMATION_STYLES,name:"animationStyle",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ANIMATION_STYLES[0],isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateAnimate",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateFramesPerSecond",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateAnimationStyle",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-animation";static DEFAULT_FRAMES_PER_SECOND=1500;static MAX_FRAMES_PER_SECOND=1;static FRAMES_PER_SECOND_MIN=3;static FRAMES_PER_SECOND_MAX=100;primaryCssClass="ch5-animation";_ch5Properties;_elContainer={};_iconContainer={};set startAnimating(e){this._ch5Properties.set("startAnimating",e,()=>{this.handleStartAnimating()})}get startAnimating(){return this._ch5Properties.get("startAnimating")}set size(e){this._ch5Properties.set("size",e,()=>{this.handleSize()})}get size(){return this._ch5Properties.get("size")}set animationStyle(e){this._ch5Properties.set("animationStyle",e,()=>{this.handleAnimationStyle(e)})}get animationStyle(){return this._ch5Properties.get("animationStyle")}set receiveStateAnimate(e){this._ch5Properties.set("receiveStateAnimate",e,null,e=>{this._ch5Properties.setForSignalResponse("startAnimating",e,()=>{this.handleStartAnimating()})})}get receiveStateAnimate(){return this._ch5Properties.get("receiveStateAnimate")}set receiveStateFramesPerSecond(e){this._ch5Properties.set("receiveStateFramesPerSecond",e,null,e=>{this.handleFramesPerSecond(e)})}get receiveStateFramesPerSecond(){return this._ch5Properties.get("receiveStateFramesPerSecond")}set receiveStateAnimationStyle(e){this._ch5Properties.set("receiveStateAnimationStyle",e,null,e=>{this._ch5Properties.setForSignalResponse("animationStyle",e,()=>{this.handleAnimationStyle(e)})})}get receiveStateAnimationStyle(){return this._ch5Properties.get("receiveStateAnimationStyle")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.ignoreAttributes=["receivestatecustomclass","receivestatecustomstyle","receivestateenable","receivestateshowpulse","receivestatehidepulse","sendeventonshow"],this.logger.start("constructor()",e.ELEMENT_NAME),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-animation attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Animation),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),customElements.whenDefined("ch5-animation").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this._elContainer=document.createElement("div"),this._iconContainer=document.createElement("i"),this._iconContainer.classList.add("fas"),this._iconContainer.classList.add(e.ANIMATION_STYLES_CLASS[0]),this._iconContainer.classList.add("fa-spin"),this._elContainer.appendChild(this._iconContainer),this._elContainer.classList.add("ch5-animation"),this.appendChild(this._elContainer),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners()}removeEventListeners(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}handleStartAnimating(){["true","false"].forEach(e=>{this._iconContainer.classList.remove("ch5-animation--start-animating-"+e)}),this._iconContainer.classList.add("ch5-animation--start-animating-"+this.startAnimating.toString())}handleFramesPerSecond(t){t<=e.FRAMES_PER_SECOND_MIN?this._iconContainer.setAttribute("style",`animation-duration:${e.DEFAULT_FRAMES_PER_SECOND}ms;`):t>=e.FRAMES_PER_SECOND_MAX?this._iconContainer.setAttribute("style",`animation-duration:${e.MAX_FRAMES_PER_SECOND}ms;`):t>e.FRAMES_PER_SECOND_MIN&&t<e.FRAMES_PER_SECOND_MAX&&this._iconContainer.setAttribute("style",`animation-duration:${15*(e.FRAMES_PER_SECOND_MAX-t)}ms;`)}handleSize(){Array.from(e.COMPONENT_DATA.SIZE.values).forEach(t=>{this._iconContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+t)}),this._iconContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+this.size)}handleAnimationStyle(t){e.ANIMATION_STYLES_CLASS.forEach(e=>{this._iconContainer.classList.remove(e)}),this._iconContainer.classList.add("spinner"===t?e.ANIMATION_STYLES_CLASS[1]:"ring"===t?e.ANIMATION_STYLES_CLASS[0]:"roller"===t?e.ANIMATION_STYLES_CLASS[2]:e.ANIMATION_STYLES_CLASS[0])}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this._iconContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this._iconContainer.classList.add("ch5-animation--start-animating-"+this.startAnimating.toString()),this._iconContainer.setAttribute("style",`animation-duration:${e.DEFAULT_FRAMES_PER_SECOND}ms;`),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};function resizeObserver(e,t){new ResizeObserver(t).observe(e)}Ch5Animation.registerCustomElement(),Ch5Animation.registerSignalAttributeTypes();import _6 from"lodash";var Ch5Background=class e extends Ch5Common{static ELEMENT_NAME="ch5-background";static SCALE=["stretch","fill","fit"];static REPEAT=["no-repeat","repeat","repeat-x","repeat-y"];static REFRESHRATE=600;static IMGBGCOLOR="black";static COMPONENT_DATA={SCALE:{default:e.SCALE[0],values:e.SCALE,key:"scale",classListPrefix:"--"},REPEAT:{default:null,values:e.REPEAT,key:"repeat",classListPrefix:"--"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestaterefreshrate:{direction:"state",numericJoin:1,contractName:!0},receivestateurl:{direction:"state",stringJoin:1,contractName:!0},receivestatebackgroundcolor:{direction:"state",stringJoin:1,contractName:!0}};primaryCssClass="ch5-background";parentCssClassPrefix="--parent";canvasCssClassPrefix="--canvas";isCanvasCreated=!1;_elCanvas={};_canvasList;_prevCanvasList=[];_imgUrls=[];_elImages=[];_elBackupImages=[];_bgColors=[];_bgIdx=0;_interval;_videoRes={};_isVisible=!1;_videoDimensions=[];_isRefilled=!0;isInitialized=!1;VIDEO_ACTION={STARTED:"started",STOP:"stop",STOPPED:"stopped",RESIZE:"resize",REFILL:"refill",SNAPSHOT:"snapshot",MARK:"mark",NOURL:"nourl",ERROR:"error"};MARK_COLORS=new Map;_url="";_backgroundColor=e.IMGBGCOLOR;_repeat=null;_scale=e.SCALE[0];_refreshRate=e.REFRESHRATE;_videoCrop="";_imgBackgroundColor="";_transitionEffect="ease";_transitionDuration="";_receiveStateRefreshRate="";_subReceiveRefreshRate="";_receiveStateUrl="";_sigNameReceiveUrl="";_subReceiveUrl="";_receiveStateBackgroundColor="";_subReceiveBackgroundColor="";_videoSubscriptionId="";_canvasSubscriptionId="";static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}get url(){return this._url}set url(e){this._url===e||_6.isNil(e)||""===e||(this._url=e,this.getBackgroundUrl(this._url),this.setAttribute("url",this._url))}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this.hasAttribute("url")||this.hasAttribute("receivestateurl")||(this._backgroundColor=""!==e.trim()?this.imgBackgroundColor:"value",this._backgroundColor=e,this.getBackgroundColor(this._backgroundColor),this.setAttribute("backgroundcolor",this._backgroundColor))}get repeat(){return this._repeat}set repeat(t){_6.isNil(t)?(this._repeat=null,this.removeAttribute("repeat")):this._repeat!==t&&(e.REPEAT.indexOf(t)>=0?(this._repeat=t,this.setAttribute("repeat",this._repeat)):(this._repeat=null,this.removeAttribute("repeat"))),this.updateBackground()}get scale(){return this._scale}set scale(t){this._scale!==t&&(e.SCALE.indexOf(t)>=0?this._scale=t:this._scale=e.SCALE[0],this.setAttribute("scale",this._scale))}get refreshRate(){return this._refreshRate}set refreshRate(t){(t=isNaN(t)?e.REFRESHRATE:Number(t))<10?t=10:t>604800&&(t=604800),this._refreshRate!==t&&(this._refreshRate=t,this.setAttribute("refreshrate",this._refreshRate.toString()))}get videoCrop(){return this._videoCrop}set videoCrop(e){this._videoCrop!==e&&(this._videoCrop=e,this.setAttribute("videocrop",this._videoCrop))}get imgBackgroundColor(){return this._imgBackgroundColor}set imgBackgroundColor(t){this._imgBackgroundColor!==t&&(e.IMGBGCOLOR?this._imgBackgroundColor=t:this._imgBackgroundColor=e.IMGBGCOLOR,this.setAttribute("imgbackgroundcolor",this._imgBackgroundColor))}get transitionEffect(){return this._transitionEffect}set transitionEffect(e){this._transitionEffect!==e&&(this._transitionEffect=e,this.setAttribute("transitioneffect",this._transitionEffect))}get transitionDuration(){return this._transitionDuration}set transitionDuration(e){this._transitionDuration!==e&&(this._transitionDuration=e,this.setAttribute("transitionduration",this._transitionDuration));let t=0;Array.from(this._transitionDuration).forEach(e=>{e.toUpperCase()!==e.toLowerCase()&&t++}),t>1&&this.setAttribute("transitionduration","1s");!0===new RegExp(/[`!@#$%^&*()_+\-=\[\]{};':"\\|,<>\/?~]/).test(this._transitionDuration)&&(this._transitionDuration="1s",this.setAttribute("transitionduration",this._transitionDuration)),""===this._transitionDuration&&this.setAttribute("transitionduration","1s")}set receiveStateRefreshRate(e){if(this.info("set receiveStateRefreshRate('"+e+"')"),!e||this._receiveStateRefreshRate===e)return;if(this._receiveStateRefreshRate){const e=Ch5Signal.getSubscriptionSignalName(this._receiveStateRefreshRate),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&t.unsubscribe(this._subReceiveRefreshRate)}this._receiveStateRefreshRate=e,this.setAttribute("receivestaterefreshrate",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateRefreshRate),i=Ch5SignalFactory.getInstance().getNumberSignal(t);null!==i&&(this._subReceiveRefreshRate=i.subscribe(e=>{Number(e)!==this.refreshRate&&this.setAttribute("refreshrate",String(e))}))}get receiveStateRefreshRate(){return this._attributeValueAsString("receivestaterefreshrate")}set receiveStateUrl(e){if(this.info("set receiveStateUrl('"+e+"')"),""===e||this._sigNameReceiveUrl===e||null==e)return;if(""!==this._sigNameReceiveUrl&&void 0!==this._sigNameReceiveUrl&&null!==this._sigNameReceiveUrl){const e=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveUrl),t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&t.unsubscribe(this._subReceiveUrl)}this._sigNameReceiveUrl=e,this.setAttribute("receivestateurl",e);const t=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveUrl),i=Ch5SignalFactory.getInstance().getStringSignal(t);null!==i&&(this._subReceiveUrl=i.subscribe(e=>{e!==this._url&&this.setAttribute("url",e)}))}get receiveStateUrl(){return this._attributeValueAsString("receivestateurl")}set receiveStateBackgroundColor(e){if(this.info("set receivestatebackgroundcolor('"+e+"')"),!e||this._receiveStateBackgroundColor===e)return;if(this._receiveStateBackgroundColor){const e=Ch5Signal.getSubscriptionSignalName(this._receiveStateBackgroundColor),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&t.unsubscribe(this._subReceiveBackgroundColor)}this._receiveStateBackgroundColor=e,this.setAttribute("receivestatebackgroundcolor",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateBackgroundColor),i=Ch5SignalFactory.getInstance().getStringSignal(t);null!==i&&(this._subReceiveBackgroundColor=i.subscribe(e=>{e!==this.backgroundColor&&this.setAttribute("backgroundcolor",e)}))}get receiveStateBackgroundColor(){return this._attributeValueAsString("receivestatebackgroundcolor")}constructor(){super(),customElements.whenDefined("ch5-background").then(()=>{this.classList.add(this.primaryCssClass),this.parentElement&&!this._isVisible&&this.parentElement.classList.add(this.primaryCssClass+this.parentCssClassPrefix),this.MARK_COLORS.set("mark","#FFBF00"),this.MARK_COLORS.set("error","#CF142B"),this.MARK_COLORS.set("nourl","#828282"),this.MARK_COLORS.set("stop","#828282"),this.parentElement&&resizeObserver(this.parentElement,this.updateCanvasDimensions.bind(this)),this.info("From connectedCallback of ch5-background")})}connectedCallback(){this.initAttributes(),this.setAttribute("data-ch5-id",this.getCrId()),customElements.whenDefined("ch5-background").then(()=>{Ch5CoreIntersectionObserver.getInstance().observe(this,()=>{this.elementIsInViewPort?this._isVisible||(this.parentElement&&this.parentElement.classList.add(this.primaryCssClass+this.parentCssClassPrefix),this.updateCanvasDimensions(),this._isVisible=!0):this._isVisible=!1,this.isInitialized=!0})})}isInViewport(e){const t=document.querySelector(`[data-ch5-id="${e}"]`);if(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}return!1}videoBGRequest(e){if(this.info("In videoBGRequest(): Video Tag Id -> "+e.id+" action: "+e.action),this.isInitialized&&this.elementIsInViewPort&&""!==e.id&&e&&Object.keys(e).length){const t=Object.assign({},e);this.setAttribute("videocrop",JSON.stringify(t)),e.action!==this.VIDEO_ACTION.REFILL||this._isRefilled?e.action===this.VIDEO_ACTION.STOP?this.manageVideoInfo(e):e.action===this.VIDEO_ACTION.STARTED?(this.manageVideoInfo(e),this.videoBGAction()):e.action===this.VIDEO_ACTION.RESIZE&&(this.manageVideoInfo(e),this.refillBackground(),this.videoBGAction()):this.isInViewport(e.id)||this.refillBackground()}}disconnectedCallback(){this.info("called disconnectedCallback()"),Ch5CoreIntersectionObserver.getInstance()instanceof Ch5CoreIntersectionObserver&&Ch5CoreIntersectionObserver.getInstance().unobserve(this),unsubscribeState("o","ch5.video.background",this._videoSubscriptionId),unsubscribeState("b","canvas.created",this._canvasSubscriptionId),this.unsubscribeFromSignals()}static get observedAttributes(){return Ch5Common.observedAttributes.concat(["url","backgroundcolor","repeat","scale","refreshrate","videocrop","imgbackgroundcolor","transitioneffect","transitionduration","receivestaterefreshrate","receivestateurl","receivestatebackgroundcolor"])}attributeChangedCallback(t,i,s){if(i!==s)switch(t){case"url":this.hasAttribute("url")?this.url=s:this.url="",this.createCanvas(),this.updateBackground();break;case"backgroundcolor":this.hasAttribute("url")||this.hasAttribute("receivestateurl")||(this.hasAttribute("backgroundcolor")?this.backgroundColor=s:this.backgroundColor="",this.createCanvas(),this.updateBackground());break;case"repeat":this.repeat=this.getAttribute("repeat");break;case"scale":this.hasAttribute("scale")?this.scale=s:this.scale=e.SCALE[0],this.updateBackground();break;case"refreshrate":this.hasAttribute("refreshrate")?this.refreshRate=Number(s):this.refreshRate=e.REFRESHRATE,this.updateBackground();break;case"videocrop":this.hasAttribute("videocrop")?this.videoCrop=s:this.videoCrop="";break;case"imgbackgroundcolor":this.hasAttribute("imgbackgroundcolor")?this.imgBackgroundColor=s:this.imgBackgroundColor=e.IMGBGCOLOR,this.updateBackground();break;case"transitioneffect":this.hasAttribute("transitioneffect")?this.transitionEffect=s:this.transitionEffect="ease",this.setBgTransition();break;case"transitionduration":this.hasAttribute("transitionduration")?this.transitionDuration=s:this.transitionDuration="",this.setBgTransition();break;case"receivestaterefreshrate":this.hasAttribute("receivestaterefreshrate")?this.receiveStateRefreshRate=s:this.receiveStateRefreshRate="";break;case"receivestateurl":this.hasAttribute("receivestateurl")?this.receiveStateUrl=s:this.receiveStateUrl="";break;case"receivestatebackgroundcolor":this.hasAttribute("url")||this.hasAttribute("receivestateurl")||(this.hasAttribute("receivestatebackgroundcolor")?this.receiveStateBackgroundColor=s:this.receiveStateBackgroundColor="");break;default:super.attributeChangedCallback(t,i,s)}}unsubscribeFromSignals(){this.info("unsubscribeFromSignals()"),super.unsubscribeFromSignals();const e=Ch5SignalFactory.getInstance();if(""!==this._subReceiveRefreshRate&&""!==this._receiveStateRefreshRate){const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateRefreshRate),i=e.getStringSignal(t);null!==i&&(i.unsubscribe(this._subReceiveRefreshRate),this._receiveStateRefreshRate="")}if(""!==this._subReceiveUrl&&""!==this._receiveStateUrl){const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateUrl),i=e.getStringSignal(t);null!==i&&(i.unsubscribe(this._subReceiveUrl),this._receiveStateUrl="")}if(""!==this._subReceiveBackgroundColor&&""!==this._receiveStateBackgroundColor){const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateBackgroundColor),i=e.getStringSignal(t);null!==i&&(i.unsubscribe(this._subReceiveBackgroundColor),this._receiveStateBackgroundColor="")}this.info("unsubscribeFromSignals() end")}initAttributes(){super.initAttributes(),this.hasAttribute("url")&&(this.url=this.getAttribute("url")),!this.hasAttribute("backgroundcolor")||this.hasAttribute("url")||this.hasAttribute("receivestateurl")||(this.backgroundColor=this.getAttribute("backgroundcolor")),this.repeat=this.getAttribute("repeat"),this.hasAttribute("scale")&&(this.scale=this.getAttribute("scale")),this.hasAttribute("refreshrate")&&(this.refreshRate=Number(this.getAttribute("refreshrate"))),this.hasAttribute("videocrop")&&(this.videoCrop=this.getAttribute("videocrop")),this.hasAttribute("imgbackgroundcolor")&&(this.imgBackgroundColor=this.getAttribute("imgbackgroundcolor")),this.hasAttribute("transitioneffect")&&(this.transitionEffect=this.getAttribute("transitioneffect")),this.hasAttribute("transitionduration")&&(this.transitionDuration=this.getAttribute("transitionduration")),this.hasAttribute("receivestaterefreshrate")&&(this.receiveStateRefreshRate=this.getAttribute("receivestaterefreshrate")),this.hasAttribute("receivestateurl")&&(this.receiveStateUrl=this.getAttribute("receivestateurl")),!this.hasAttribute("receivestatebackgroundcolor")||this.hasAttribute("url")||this.hasAttribute("receivestateurl")||(this.receiveStateBackgroundColor=this.getAttribute("receivestatebackgroundcolor"))}updateBackground(){this._imgUrls.length?this.setBgImage():this._bgColors.length?this.setBgColor():this.info("Something went wrong. One attribute is mandatory - either URL or backgroundColor.")}updateBackgroundForEachCanvas(e,t){this._imgUrls.length?this.setBgImageByCanvas(e,t):this._bgColors.length?this.setBgColorByCanvas(e,t):this.info("Something went wrong. One attribute is mandatory - either URL or backgroundColor.")}getBackgroundUrl(e){this._imgUrls=e.split("|"),this._imgUrls=this._imgUrls.map(e=>e.trim())}getBackgroundColor(e){this._bgColors=e.split("|"),this._bgColors=this._bgColors.map(e=>e.trim())}scaleToFill(e,t,i){const s=Math.max(t.width/e.width,t.height/e.height),n=t.width/2-e.width/2*s,r=t.height/2-e.height/2*s;i.drawImage(e,n,r,e.width*s,e.height*s),setTimeout(()=>{1===this._videoDimensions.length&&"started"===this._videoDimensions[0].action&&i.clearRect(this._videoDimensions[0].left,this._videoDimensions[0].top,this._videoDimensions[0].width,this._videoDimensions[0].height)},100),publishEvent("b","canvas.created",!0)}scaleToFit(e,t,i){const s=Math.min(t.width/e.width,t.height/e.height),n=t.width/2-e.width/2*s,r=t.height/2-e.height/2*s;i.drawImage(e,n,r,e.width*s,e.height*s),setTimeout(()=>{1===this._videoDimensions.length&&"started"===this._videoDimensions[0].action&&i.clearRect(this._videoDimensions[0].left,this._videoDimensions[0].top,this._videoDimensions[0].width,this._videoDimensions[0].height)},100),publishEvent("b","canvas.created",!0)}scaleToStretch(e,t,i){i.drawImage(e,0,0,t.width,t.height),setTimeout(()=>{1===this._videoDimensions.length&&"started"===this._videoDimensions[0].action&&i.clearRect(this._videoDimensions[0].left,this._videoDimensions[0].top,this._videoDimensions[0].width,this._videoDimensions[0].height)},100),publishEvent("b","canvas.created",!0)}updateBgImageScale(e,t,i){switch(this._scale){case"fill":this.scaleToFill(e,t,i);break;case"fit":this.scaleToFit(e,t,i);break;case"stretch":this.scaleToStretch(e,t,i);break;default:this.info("Scale value is wrong. it should be fill, fit or stretch(default)")}}updateBgImageRepeat(e,t,i){switch(this._repeat){case"repeat":case"repeat-x":case"repeat-y":case"no-repeat":i.fillStyle=i.createPattern(e,this._repeat),i.fillRect(0,0,t.width,t.height),setTimeout(()=>{1===this._videoDimensions.length&&"started"===this._videoDimensions[0].action&&i.clearRect(this._videoDimensions[0].left,this._videoDimensions[0].top,this._videoDimensions[0].width,this._videoDimensions[0].height)},100),publishEvent("b","canvas.created",!0)}}canvasTemplate(e){this.innerHTML="";for(let t=0;t<e;++t)this._elCanvas=document.createElement("canvas"),this._elCanvas.classList.add(this.primaryCssClass+this.canvasCssClassPrefix),this.appendChild(this._elCanvas),this.setCanvasDimensions(this._elCanvas),t===e-1&&(this._canvasList=this.querySelectorAll("canvas"));this.isCanvasCreated=!0}manageVideoInfo(e){const t=this._videoDimensions.findIndex(t=>t.id===e.id);if(e.action===this.VIDEO_ACTION.STARTED||e.action===this.VIDEO_ACTION.RESIZE)t>-1?(this._videoDimensions[t]=e,this.refillBackground()):(this._videoDimensions.push(e),this.refillBackground());else if(e.action===this.VIDEO_ACTION.STOP&&t>=0){const e=this._videoDimensions[t];this._videoDimensions.splice(t,1),this.refillBackgroundforOneVideo(e)}}isScrollBar(e,t){let i=!!e[t="vertical"===t?"scrollTop":"scrollLeft"];return i||(e[t]=1,i=!!e[t],e[t]=0),i}setCanvasDimensions(e){e.width=0,e.height=0,this.parentElement&&(e.width=this.isScrollBar(this.parentElement,"horizontal")?this.parentElement.scrollWidth:this.parentElement.clientWidth,e.height=this.isScrollBar(this.parentElement,"vertical")?this.parentElement.scrollHeight:this.parentElement.clientHeight)}updateCanvasDimensions(){this.isCanvasListValid()&&this._canvasList.forEach((e,t)=>{let i=!0;if(this._prevCanvasList&&this._prevCanvasList.length>0){let s=e.width,n=e.height;this.parentElement&&(s=this.isScrollBar(this.parentElement,"horizontal")?this.parentElement.scrollWidth:this.parentElement.clientWidth,n=this.isScrollBar(this.parentElement,"vertical")?this.parentElement.scrollHeight:this.parentElement.clientHeight),(this._prevCanvasList[t]&&this._prevCanvasList[t].width===s&&this._prevCanvasList[t].height===n||0===s&&0===n)&&(i=!1)}if(!0===i){e.width=0,e.height=0,this.parentElement&&(e.width=this.isScrollBar(this.parentElement,"horizontal")?this.parentElement.scrollWidth:this.parentElement.clientWidth,e.height=this.isScrollBar(this.parentElement,"vertical")?this.parentElement.scrollHeight:this.parentElement.clientHeight),this.updateBackgroundForEachCanvas(e,t);this._prevCanvasList.find(e=>e.id===t)?(this._prevCanvasList[t].width=e.width,this._prevCanvasList[t].height=e.height):this._prevCanvasList.push({id:t,width:e.width,height:e.height})}})}createCanvas(){this._imgUrls.length?this.canvasTemplate(this._imgUrls.length):this._bgColors.length?this.canvasTemplate(this._bgColors.length):this.info("Something went wrong. One attribute is mandatory either URL or backgroundColor.")}setBgTransition(){setTimeout(()=>{this.isCanvasListValid()&&this._canvasList.forEach(e=>{this._transitionEffect&&(e.style.transitionTimingFunction=this._transitionEffect),this._transitionDuration&&(e.style.transitionDuration=this._transitionDuration)})})}setBgImage(){this._canvasList&&this._canvasList.length&&this.isCanvasListValid()&&(this._canvasList.forEach((e,t)=>{this.setBgImageByCanvas(e,t)}),this._elBackupImages=[...this._elImages])}setBgImageByCanvas(e,t){const i=e.getContext("2d");this._elImages[t]=new Image,this._elImages[t].src=this._imgUrls[t],this._elImages[t].onload=()=>{this.updateBgImage(this._elImages[t],i),this._imgUrls.length===t+1&&this.changeBackground(this._imgUrls.length),this.videoBGUpdateAction(),this._elImages[t].onload=null},i.fillStyle=this._imgBackgroundColor,i.fillRect(0,0,e.width,e.height)}setBgColor(){this.isCanvasListValid()&&this._canvasList.forEach((e,t)=>{this.setBgColorByCanvas(e,t)})}setBgColorByCanvas(e,t){const i=e.getContext("2d");this.updateBgColor(this._bgColors[t],i),this._bgColors.length===t+1&&this.changeBackground(this._bgColors.length),this.videoBGUpdateAction()}videoBGUpdateAction(){""!==this._videoCrop&&this._videoDimensions.forEach(e=>{this.isCanvasListValid()&&this._canvasList.forEach(t=>{const i=t.getContext("2d");e.action===this.VIDEO_ACTION.STARTED&&(i.clearRect(e.left,e.top,e.width,e.height),this._isRefilled=!1)})})}updateBgColor(e,t,i=null){t.fillStyle=e,i&&i.left&&i.top?t.fillRect(i.left,i.top,i.width,i.height):t.fillRect(0,0,this._elCanvas.width,this._elCanvas.height),publishEvent("b","canvas.created",!0)}changeBackground(e){if(clearInterval(this._interval),e>1){let t=!1;this._canvasList.forEach(e=>{e.classList&&e.classList.contains("ch5bg-fadein")&&(t=!0)}),!1===t&&this._canvasList[0].classList.add("ch5bg-fadein"),this._interval=setInterval(()=>{this.isCanvasListValid()&&(this._canvasList.forEach(e=>e.classList.remove("ch5bg-fadein")),this._canvasList[this._bgIdx].classList.add("ch5bg-fadein"),this._bgIdx++,this._bgIdx===e&&(this._bgIdx=0))},1e3*this._refreshRate)}else this._canvasList[0].classList.add("ch5bg-fadein")}updateBgImage(e,t){_6.isNil(this._repeat)?this.updateBgImageScale(e,this._elCanvas,t):this.updateBgImageRepeat(e,this._elCanvas,t)}refillBackground(){this.isCanvasListValid()&&this._canvasList.forEach((e,t)=>{const i=e.getContext("2d");switch(this._canvasList.length){case this._imgUrls.length:this._elImages=[...this._elBackupImages],this.updateBgImage(this._elImages[t],i);break;case this._bgColors.length:this.updateBgColor(this._bgColors[t],i)}this._isRefilled=!0})}refillBackgroundforOneVideo(e){this.isCanvasListValid()&&this._canvasList.forEach((t,i)=>{const s=t.getContext("2d");switch(this._canvasList.length){case this._imgUrls.length:this._elImages=[...this._elBackupImages],this.updateBgImage(this._elImages[i],s);break;case this._bgColors.length:this.updateBgColor(this._bgColors[i],s,e),publishEvent("b","canvas.created",!0)}this._isRefilled=!0})}videoBGAction(){if((!this._elCanvas||0!==Object.keys(this._elCanvas).length||this._elCanvas.constructor!==Object)&&(this._videoCrop&&"string"==typeof this._videoCrop&&(this._videoRes=JSON.parse(this._videoCrop)),this._videoRes&&this._videoRes.action!==this.VIDEO_ACTION.REFILL)){const t=this._elCanvas.getBoundingClientRect().top,i=this._elCanvas.getBoundingClientRect().left;this._videoRes.left=this._videoRes.left-i,this._videoRes.top=this._videoRes.top-t,this._videoRes.left=Math.ceil(this._videoRes.left),this._videoRes.top=Math.ceil(this._videoRes.top),this.manageVideoInfo(this._videoRes),this._videoDimensions.length&&this._videoDimensions.map(t=>{this.info("\nvideoBGAction() -> Video Tag Id "+t.id+" is in Viewport: "+this.isInViewport(t.id)),this.isInViewport(t.id)&&this.isCanvasListValid()&&this._canvasList.forEach(i=>{const s=i.getContext("2d");if(t.action===this.VIDEO_ACTION.STARTED||t.action===this.VIDEO_ACTION.RESIZE)s.clearRect(t.left,t.top,t.width,t.height),this._isRefilled=!1;else if(t.action===this.VIDEO_ACTION.STOP||t.action===this.VIDEO_ACTION.MARK||t.action===this.VIDEO_ACTION.ERROR||t.action===this.VIDEO_ACTION.NOURL){s.fillStyle=e.IMGBGCOLOR,s.fillRect(t.left,t.top,t.width,t.height),s.beginPath();const i=Math.ceil(.04*t.height);s.lineWidth=i,s.moveTo(t.left,t.top+t.height-Math.ceil(i/2)),s.lineTo(t.width+t.left,t.top+t.height-Math.ceil(i/2)),s.strokeStyle=this.MARK_COLORS.get(t.action),s.setLineDash([]),t.action===this.VIDEO_ACTION.STOP&&s.setLineDash([Math.ceil(t.width/2),4,6,4]),s.stroke(),this._isRefilled=!1}})})}}isCanvasListValid(){return!!this._canvasList&&null!=this._canvasList&&this._canvasList.length>0}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5Background.ELEMENT_NAME,Ch5Background),Ch5Background.registerSignalAttributeTypes();import isNil5 from"lodash/isNil";import{Subject as Subject2}from"rxjs";function isSafariMobile(){const e=window.navigator.userAgent.toLowerCase(),t=e.indexOf("ipad")>-1||e.indexOf("macintosh")>-1&&"ontouchend"in document||!!e.match(/iPhone/i),i=!!e.match(/WebKit/i);return!(!t||!i||e.match(/CriOS/i))}var Ch5PressableFingerStateMode=(e=>(e[e.Idle=0]="Idle",e[e.Start=1]="Start",e[e.FingerDown=2]="FingerDown",e))(Ch5PressableFingerStateMode||{}),Ch5Pressable=class _Ch5Pressable{static FingerState=class{mode=0;touchHoldTimer=null;touchStartLocationX=0;touchStartLocationY=0;touchPointId=-1;constructor(){}reset(){this.mode=0,this.touchStartLocationX=0,this.touchStartLocationY=0,this.touchPointId=-1,null!==this.touchHoldTimer&&(window.clearTimeout(this.touchHoldTimer),this.touchHoldTimer=null)}};_fingerState=new _Ch5Pressable.FingerState;_ch5Component;_options;_pressEvent;_releaseEvent;_pressed=!1;_released=!0;observablePressed;TOUCH_TIMEOUT=250;CLICK_MOVE_THRESHOLD=10;constructor(e,t){var i;this._ch5Component=e,this._options=t||null,this.observablePressed=new Subject2,this._pressEvent=new CustomEvent("press",{bubbles:!0,cancelable:!1}),this._releaseEvent=new CustomEvent("release",{bubbles:!0,cancelable:!1}),this._onClick=this._onClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerLeave=this._onPointerLeave.bind(this),this._onPointerMove=this._onPointerMove.bind(this),(null==(i=this._options)?void 0:i.touchMove)&&(this._onTouchMove=this._onTouchMove.bind(this)),this._onTouchHoldTimer=this._onTouchHoldTimer.bind(this),this._onHold=this._onHold.bind(this),this._onRelease=this._onRelease.bind(this)}get ch5Component(){return this._ch5Component}get options(){return this._options}init(){this._attachEvents()}setPressed(e){!0===this._pressed?!1===e&&this._onRelease():!0===e&&this._onHold()}destroy(){var e;!0===this._pressed&&this.setPressed(!1),null==(e=this.observablePressed)||e.complete(),this.resetPressAndReleaseActions(),this._removeEvents()}_attachEvents(){var e;this._ch5Component.addEventListener("click",this._onClick),this._ch5Component.addEventListener("pointerdown",this._onPointerDown,{passive:!0}),this._ch5Component.addEventListener("pointerup",this._onPointerUp),this._ch5Component.addEventListener("pointermove",this._onPointerMove),this._ch5Component.addEventListener("pointerleave",this._onPointerLeave),isSafariMobile()&&this._ch5Component.addEventListener("pointerout",this._onPointerLeave),(null==(e=this._options)?void 0:e.touchMove)&&(this._ch5Component.addEventListener("touchmove",this._onTouchMove),this._ch5Component.addEventListener("touchcancel",this._onTouchMove))}_removeEvents(){var e;this._ch5Component.removeEventListener("click",this._onClick),this._ch5Component.removeEventListener("pointerdown",this._onPointerDown),this._ch5Component.removeEventListener("pointerup",this._onPointerUp),this._ch5Component.removeEventListener("pointermove",this._onPointerMove),this._ch5Component.removeEventListener("pointerleave",this._onPointerLeave),isSafariMobile()&&this._ch5Component.removeEventListener("pointerout",this._onPointerLeave),(null==(e=this._options)?void 0:e.touchMove)&&(this._ch5Component.removeEventListener("touchmove",this._onTouchMove),this._ch5Component.removeEventListener("touchcancel",this._onTouchMove))}_onClick(){this._ch5Component.elementIsInViewPort}_onPointerDown(e){this._ch5Component.elementIsInViewPort&&0===this._fingerState.mode&&(this._fingerState.mode=1,this._fingerState.touchHoldTimer=window.setTimeout(this._onTouchHoldTimer,this.TOUCH_TIMEOUT),this._fingerState.touchStartLocationX=e.clientX,this._fingerState.touchStartLocationY=e.clientY)}_onPointerMove(e){var t;if(1===this._fingerState.mode&&(this._ch5Component.logger.log("this._options?.enableSwipe",null==(t=this._options)?void 0:t.enableSwipe),this._options&&!0===this._options.enableSwipe&&null!==e)){const t=e.clientX-this._fingerState.touchStartLocationX,i=e.clientY-this._fingerState.touchStartLocationY,s=Math.sqrt(t**2+i**2);this._ch5Component.info(`DELETE ME Ch5Pressable.onMouseMove() , ${e.clientX}, ${e.clientY}, ${s}`),s>this.CLICK_MOVE_THRESHOLD&&(this._ch5Component.logger.log("Swipe is true"),this._ch5Component.info(`Ch5Pressable.onMouseMove() cancelling press, ${e.clientX}, ${e.clientY}, ${s}`),this._fingerState.reset())}if(2===this._fingerState.mode){const t=this._ch5Component.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&this.resetPressAndReleaseActions()}}_onPointerUp(e){this._ch5Component.logger.log("_onPointerUp: ",this._ch5Component.getCrId()),this._ch5Component.elementIsInViewPort&&null!==e&&this.resetPressAndReleaseActions()}resetPressAndReleaseActions(){1===this._fingerState.mode&&this._fingerIsDownActions(),2===this._fingerState.mode&&this._onRelease(),this._fingerState.reset()}_onPointerLeave(e){this._ch5Component.elementIsInViewPort&&null!==e&&this.resetPressAndReleaseActions()}_onTouchMove(e){e.preventDefault()}_onTouchHoldTimer(e){this._ch5Component.elementIsInViewPort&&(this._fingerState.touchHoldTimer=null,this._fingerIsDownActions())}_fingerIsDownActions(){this._fingerState.mode=2,this._onHold(),null!==this._fingerState.touchHoldTimer&&(window.clearTimeout(this._fingerState.touchHoldTimer),this._fingerState.touchHoldTimer=null)}_onHold(){var _a;if(this._ch5Component.info(`Ch5Pressable._onHold() alreadyPressed:${this._pressed}`),!this._pressed){this._addCssPressClass(),(null==(_a=this._options)?void 0:_a.touchMove)&&this._setTouchAction("none"),this._pressed=!0,this._released=!1,this.observablePressed.next(this._pressed),this._ch5Component.setAttribute("pressed","true"),this._ch5Component.dispatchEvent(this._pressEvent);const onPressAttrib=this._ch5Component.getAttribute("onpress");if(null!==onPressAttrib)try{eval(onPressAttrib)}catch(e){}}}_onRelease(){var _a;if(this._ch5Component.info(`Ch5Pressable._onRelease() alreadyReleased:${this._released}`),!this._released){setTimeout(()=>{this._removeCssPressClass()},this.TOUCH_TIMEOUT),"ch5-button--pressed ch5-button-list--pressed"!==(null==(_a=this._options)?void 0:_a.cssPressedClass)&&this._setTouchAction(""),this._pressed=!1,this._released=!0,this.observablePressed.next(this._pressed),this._ch5Component.removeAttribute("pressed"),this._ch5Component.dispatchEvent(this._releaseEvent);const onReleaseAttrib=this._ch5Component.getAttribute("onrelease");if(null!==onReleaseAttrib)try{eval(onReleaseAttrib)}catch(e){}}}_addCssPressClass(){null!==this._options&&void 0!==this._options.cssTargetElement.classList&&this._options.cssPressedClass.split(" ").forEach(e=>{var t;null==(t=this._options)||t.cssTargetElement.classList.add(e)})}_removeCssPressClass(){null!==this._options&&void 0!==this._options.cssTargetElement.classList&&this._options.cssPressedClass.split(" ").forEach(e=>{var t;null==(t=this._options)||t.cssTargetElement.classList.remove(e)})}_setTouchAction(e){try{this._ch5Component.style.touchAction=e,this._options&&this._options.cssTargetElement&&(this._options.cssTargetElement.style.touchAction=e)}catch{console.info("touchAction update failed")}}},Ch5ButtonUtils=class{static getAttributeValue(e,t,i,s){return e.hasAttribute(t.toString().toLowerCase())?i:s}static getValidInputValue(e,t){return e.indexOf(t)>=0?t:e[0]}},Ch5ButtonSignal=class{signals=[];constructor(){const e=["receiveStateType","receiveStateCustomClass","receiveStateCustomStyle","receiveStateIconClass","receiveStateIconUrl","receiveStateLabel","receiveStateScriptLabelHtml"];for(const t of e)this.signals.push({signalName:t,signalValue:"",signalState:"",currentValue:""})}setSignal(e,t){const i=this.signals.find(t=>t.signalName.toLowerCase()===e.toLowerCase());if(i.signalValue===t||null===t)return null;if(i.signalValue){const e=Ch5Signal.getSubscriptionSignalName(i.signalValue),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&t.unsubscribe(i.signalState)}i.signalValue=t;const s=Ch5Signal.getSubscriptionSignalName(i.signalValue),n=Ch5SignalFactory.getInstance().getStringSignal(s);return null===n?null:n}getSignal(e){return this.signals.find(t=>t.signalName.toLowerCase()===e.toLowerCase())}setVariable(e,t){this.getSignal(e).currentValue=t}getVariable(e){return this.getSignal(e).currentValue}unsubscribeAll(){const e=Ch5SignalFactory.getInstance();for(const t of this.signals)if(""!==t.signalState&&""!==t.signalValue){const i=Ch5Signal.getSubscriptionSignalName(t.signalValue),s=e.getStringSignal(i);null!==s&&(s.unsubscribe(t.signalState),t.signalValue="",t.signalState="")}}};import _7 from"lodash";var Ch5AugmentVarSignalsNames=class e{static getUpdatedAttrIdxPlaceholderValue(e,t,i){const s=new RegExp(t,"g");if(!s.test(e))return e;const n=e.replace(s,"").trim(),r=/\s*(\d+)\s*\+{1}\s*(\d+)\s*\*{1}\s*/.exec(n);if(null!==r&&r[0]===n){const e=parseInt(r[1],10);return(parseInt(r[2],10)*i+e).toString()}const a=/\s*(\d+)\s*\+{0,1}\s*/.exec(n);if(null!==a&&a[0]===n){return(i+parseInt(a[1],10)).toString()}return e.replace(s,String(i)).trim()}static replaceAttrIdxPlaceholder(t,i,s,n,r){const a=`{{${r}}}`;if(s.indexOf(a)>-1)if("context"===i){const r=s.split(";");for(let t=0;t<r.length;t++){const i=r[t],s=i.indexOf(":");if(s>0&&i.length>s+1){const l=i.substr(s+1);l.indexOf(a)>-1&&(r[t]=i.substring(0,s+1)+e.getUpdatedAttrIdxPlaceholderValue(l,a,n))}}t.setAttribute(i,String(r.join(";")))}else t.setAttribute(i,e.getUpdatedAttrIdxPlaceholderValue(s,a,n))}static iterateAttributesInTemplate(e,t,i){const s=e.querySelectorAll("*");if(0!==s.length)for(let e=0;e<s.length;e++){const n=s[e];void 0!==i&&i(n),Array.from(n.attributes).forEach(e=>{const i=e.value.trim();t(n,e.name,i)})}}static incrementOrPrependAttrValue(e,t,i,s,n){const r=/({{[\w\-]+}})/g,a=i.replace(r,"");if(Ch5Signal.isIntegerSignalName(a)){if(s>0){const n=parseInt(a,10)+s,l=i.match(r),o=null!==l?`${n}${l.join("")}`:`${n}`;e.setAttribute(t,o)}}else e.setAttribute(t,`${n}${i}`)}static customIncrementOrPrependAttrValue(e,t,i,s,n){const r=/({{[\w\-]+}})/g,a=i.replace(r,"");if(Ch5Signal.isIntegerSignalName(a)){if(s>0){const n=parseInt(a,10)+s,l=i.match(r),o=null!==l?`${n}${l.join("")}`:`${n}`;e.setAttribute(t,o)}}else i.startsWith(n)?e.setAttribute(t,`${i}`):e.setAttribute(t,`${n}${i}`)}static differentiateTmplElemsAttrs(t,i,s,n,r){e.iterateAttributesInTemplate(t,(t,a,l)=>{const o=Ch5SignalAttributeRegistry.instance.getElementAttributeEntry(t.tagName,a);if(void 0!==o){const h=o[Ch5SignalAttributeRegistry.CONTRACT_NAME]?i:"";let c=0;void 0!==o[Ch5SignalAttributeRegistry.BOOLEAN_JOIN]?c=s:void 0!==o[Ch5SignalAttributeRegistry.NUMERIC_JOIN]?c=n:void 0!==o[Ch5SignalAttributeRegistry.STRING_JOIN]&&(c=r),e.incrementOrPrependAttrValue(t,a,l,c,h)}},t=>{const a=Ch5SignalAttributeRegistry.instance.getElementDefaultAttributeEntries(t.tagName);void 0!==a&&(i.length>0&&e.addDefaultEntriesForDifferentiation(t,a.contractName),s>0&&e.addDefaultEntriesForDifferentiation(t,a.booleanJoin),n>0&&e.addDefaultEntriesForDifferentiation(t,a.numericJoin),r>0&&e.addDefaultEntriesForDifferentiation(t,a.stringJoin))})}static addDefaultEntriesForDifferentiation(e,t){void 0!==t&&t.attributes.forEach(i=>{null===e.getAttribute(i)&&e.setAttribute(i,t.defaultValue)})}static customDifferentiateTmplElemsAttrs(t,i,s,n,r){e.iterateAttributesInTemplate(t,(t,a,l)=>{const o=Ch5SignalAttributeRegistry.instance.getElementAttributeEntry(t.tagName,a);if(void 0!==o){const h=o[Ch5SignalAttributeRegistry.CONTRACT_NAME]?i:"";let c=0;void 0!==o[Ch5SignalAttributeRegistry.BOOLEAN_JOIN]?c=s:void 0!==o[Ch5SignalAttributeRegistry.NUMERIC_JOIN]?c=n:void 0!==o[Ch5SignalAttributeRegistry.STRING_JOIN]&&(c=r),e.customIncrementOrPrependAttrValue(t,a,l,c,h)}},t=>{const a=Ch5SignalAttributeRegistry.instance.getElementDefaultAttributeEntries(t.tagName);void 0!==a&&(i.length>0&&e.addDefaultEntriesForDifferentiation(t,a.contractName),s>0&&e.addDefaultEntriesForDifferentiation(t,a.booleanJoin),n>0&&e.addDefaultEntriesForDifferentiation(t,a.numericJoin),r>0&&e.addDefaultEntriesForDifferentiation(t,a.stringJoin))})}static replaceIndexIdInTmplElemsAttrs(t,i,s){e.iterateAttributesInTemplate(t.content,(t,n,r)=>{e.replaceAttrIdxPlaceholder(t,n,r,i,s)},t=>{"TEMPLATE"===t.tagName&&e.replaceIndexIdInTmplElemsAttrs(t,i,s)})}static replaceIndexIdInTmplElemsContent(e,t,i){let s=e.innerHTML;const n=`{{${i}}}`;s.indexOf(n)>-1&&(s=s.replace(new RegExp(n,"g"),String(t)),e.innerHTML=s)}},Ch5ButtonBase=class e extends Ch5Common{constructor(t){super(),this.buttonListContractObj=t,this.logger.start("constructor()",this.primaryCssClass),this._wasInstatiated||this.createInternalHtml(),t&&(this.buttonListContract=t),this._wasInstatiated=!0,this._ch5ButtonSignal=new Ch5ButtonSignal,this._onBlur=this._onBlur.bind(this),this._onFocus=this._onFocus.bind(this),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClasses(),this.logger.stop()}buttonListContractObj;static TYPES=["default","primary","info","text","danger","warning","success","secondary"];static SHAPES=["rounded-rectangle","rectangle","tab","circle","oval"];static SIZES=["regular","x-small","small","large","x-large"];static STRETCHES=["both","width","height"];static BACKGROUND_IMAGE_FILL_TYPE=["stretch-aspect","stretch","center","tile"];static ICON_URL_FILL_TYPE=["stretch","stretch-aspect","center","tile","initial"];static ICON_POSITIONS=["first","last","top","bottom"];static CHECKBOX_POSITIONS=["left","right"];static HORIZONTAL_LABEL_ALIGNMENTS=["center","left","right"];static VERTICAL_LABEL_ALIGNMENTS=["middle","top","bottom"];static ORIENTATIONS=["horizontal","vertical"];static SG_ICON_THEME=["icons-lg","icons-sm","media-transports-accents","media-transports-light","media-transports-dark"];static MODES={MIN_LENGTH:0,MAX_LENGTH:99};static MAX_SG_NUMERIC=214;static COMPONENT_DATA={TYPES:{default:e.TYPES[0],values:e.TYPES,key:"type",attribute:"type",classListPrefix:"--"},SHAPES:{default:e.SHAPES[0],values:e.SHAPES,key:"shape",attribute:"shape",classListPrefix:"--"},SIZES:{default:e.SIZES[0],values:e.SIZES,key:"size",attribute:"size",classListPrefix:"--size-"},STRETCH:{default:null,values:e.STRETCHES,key:"stretch",attribute:"stretch",classListPrefix:"--stretch-"},ICON_POSITIONS:{default:e.ICON_POSITIONS[0],values:e.ICON_POSITIONS,key:"iconposition",attribute:"iconPosition",classListPrefix:"--iconposition-"},CHECKBOX_POSITIONS:{default:e.CHECKBOX_POSITIONS[0],values:e.CHECKBOX_POSITIONS,key:"checkboxposition",attribute:"checkboxPosition",classListPrefix:"cx-button-checkbox-pos-"},HORIZONTAL_LABEL_ALIGNMENTS:{default:e.HORIZONTAL_LABEL_ALIGNMENTS[0],values:e.HORIZONTAL_LABEL_ALIGNMENTS,key:"halignlabel",attribute:"hAlignLabel",classListPrefix:"--horizontal-"},VERTICAL_LABEL_ALIGNMENTS:{default:e.VERTICAL_LABEL_ALIGNMENTS[0],values:e.VERTICAL_LABEL_ALIGNMENTS,key:"valignlabel",attribute:"vAlignLabel",classListPrefix:"--vertical-"},ORIENTATIONS:{default:e.ORIENTATIONS[0],values:e.ORIENTATIONS,key:"orientation",classListPrefix:"--"},BACKGROUND_IMAGE_FILL_TYPE:{default:e.BACKGROUND_IMAGE_FILL_TYPE[0],values:e.BACKGROUND_IMAGE_FILL_TYPE,key:"backgroundImageFillType",attribute:"backgroundImageFillType",classListPrefix:"--background-image-fill-type-"},ICON_URL_FILL_TYPE:{default:e.ICON_URL_FILL_TYPE[0],values:e.ICON_URL_FILL_TYPE,key:"iconUrlFillType",attribute:"iconUrlFillType",classListPrefix:"--icon-url-fill-type-"},SG_ICON_THEME:{default:e.SG_ICON_THEME[0],values:e.SG_ICON_THEME,key:"sgIconTheme",attribute:"sgIconTheme",classListPrefix:"--sg-icon-theme-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatemode:{direction:"state",numericJoin:1,contractName:!0},receivestateselected:{direction:"state",booleanJoin:1,contractName:!0},receivestatelabel:{direction:"state",stringJoin:1,contractName:!0},receivestatescriptlabelhtml:{direction:"state",stringJoin:1,contractName:!0},receivestateiconclass:{direction:"state",stringJoin:1,contractName:!0},receivestateiconurl:{direction:"state",stringJoin:1,contractName:!0},receivestatetype:{direction:"state",stringJoin:1,contractName:!0},receivestatesgiconnumeric:{direction:"state",numericJoin:1,contractName:!0},receivestatesgiconstring:{direction:"state",stringJoin:1,contractName:!0},sendeventonclick:{direction:"event",booleanJoin:1,contractName:!0},sendeventontouch:{direction:"event",booleanJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1},receivestatebackgroundimageurl:{direction:"state",stringJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:"",name:"backgroundImageUrl",nameForSignal:"receiveStateBackgroundImageUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.BACKGROUND_IMAGE_FILL_TYPE[0],enumeratedValues:e.BACKGROUND_IMAGE_FILL_TYPE,name:"backgroundImageFillType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BACKGROUND_IMAGE_FILL_TYPE[0],isObservableProperty:!0},{default:null,enumeratedValues:e.ICON_URL_FILL_TYPE,name:"iconUrlFillType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:"",isSignal:!0,name:"receiveStateBackgroundImageUrl",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.SG_ICON_THEME[0],enumeratedValues:e.SG_ICON_THEME,name:"sgIconTheme",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SG_ICON_THEME[0],isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSGIconNumeric",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSGIconString",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];BUTTON_PROPERTIES={CHECKBOX_SHOW:{default:!1,valueOnAttributeEmpty:!0,variableName:"_checkboxShow",attributeName:"checkboxShow",propertyName:"checkboxShow",type:"boolean",removeAttributeOnNull:!0,enumeratedValues:["true","false","",!0,!1],componentReference:this,callback:this.checkboxDisplay.bind(this)},SELECTED:{default:!1,valueOnAttributeEmpty:!0,variableName:"_selected",attributeName:"selected",propertyName:"selected",removeAttributeOnNull:!0,type:"boolean",enumeratedValues:["true","false","",!0,!1],componentReference:this,callback:this.setSelectionMethods.bind(this)},VALIGN_LABEL:{default:e.VERTICAL_LABEL_ALIGNMENTS[0],valueOnAttributeEmpty:e.VERTICAL_LABEL_ALIGNMENTS[0],variableName:"_vAlignLabel",attributeName:"vAlignLabel",propertyName:"vAlignLabel",removeAttributeOnNull:!1,type:"enum",enumeratedValues:e.VERTICAL_LABEL_ALIGNMENTS,componentReference:this,callback:this.setButtonDisplay.bind(this)},PRESSED:{default:!1,valueOnAttributeEmpty:!0,variableName:"_pressed",attributeName:"pressed",propertyName:"pressed",removeAttributeOnNull:!0,type:"boolean",enumeratedValues:["true","false","",!0,!1],componentReference:this}};STATE_CHANGE_TIMEOUTS=500;BUTTON_PRIMARY_CLASS="cb-btn";pressedCssClassPostfix="--pressed";selectedCssClassPostfix="--selected";isResizeInProgress=!1;RESIZE_DEBOUNCE=500;ELEMENT_NAME="ch5-button";primaryCssClass="ch5-button";DEBOUNCE_BUTTON_DISPLAY=25;_elContainer={};_elButton={};_elSpanForLabelOnly={};_elSpanForLabelIconImg={};_elIcon={};_elCheckboxIcon={};_ch5Properties;_isPressedSubscription=null;_mode=0;isModeSetUsingJavascript=!1;_label="";_labelInnerHTML="";isLabelSetUsingJavascript=!1;labelSetByJavascriptValue="";_iconClass="";_previousIconClass="";_previousSgIconNumeric=-1;_previousSgIconString="";_iconPosition="first";_checkboxPosition="left";_checkboxShow=!1;isButtonInitiated=!1;_hAlignLabel="center";_vAlignLabel="middle";_orientation="horizontal";_shape="rounded-rectangle";_size="regular";_formType=null;_stretch=null;_type="default";_iconUrlFillType=null;_selected=!1;_customClassState="";_sigNameReceiveSelected="";_subReceiveSelected="";_sigNameSendOnTouch="";_sigNameSendOnClick="";_sigNameReceiveStateMode=null;_subReceiveSignalMode=null;_repeatDigitalInterval=null;_ch5ButtonSignal;_pressable=null;_iconUrl="";_previousIconUrl="";_customClassPressed=null;_customClassDisabled=null;sgIconNumeric=-1;sgIconString="";buttonListContract={clickHoldTime:0,index:-1,contractName:"",parentComponent:""};previousExtendedProperties={};debounceSetButtonDisplay=this.debounce(()=>{this.setButtonDisplayDetails()},this.DEBOUNCE_BUTTON_DISPLAY);set label(e){this.logger.log('set label("'+e+'")'),isNil5(e)&&(e="");const t=this._getTranslatedValue("label",e);t!==this.label&&(this.setAttribute("label",t),this.setButtonDisplay())}get label(){return this._label}set labelInnerHTML(e){this.logger.log('set labelInnerHTML("'+e+'")'),isNil5(e)&&(e=""),e!==this.labelInnerHTML&&(this.setAttribute("labelInnerHTML",e),this._labelInnerHTML=e,this.createButtonLabel(this),this.setButtonDisplay())}get labelInnerHTML(){return this._labelInnerHTML}set formType(e){this.logger.log('set formType("'+e+'")'),isNil5(e)?this.removeAttribute("formType"):this.setAttribute("formType",e)}get formType(){return this._formType}set customClass(e){this.setButtonAttribute("customClass",e)}get customClass(){return this._customClass}set customStyle(e){this.setButtonAttribute("customStyle",e)}get customStyle(){return this._customStyle}set iconClass(e){this.setButtonAttribute("iconClass",e)}get iconClass(){return this._iconClass}set hAlignLabel(t){this.setButtonAttribute("hAlignLabel",t,e.HORIZONTAL_LABEL_ALIGNMENTS,e.HORIZONTAL_LABEL_ALIGNMENTS[0])}get hAlignLabel(){return this._hAlignLabel}setButtonAttribute(e,t,i=[],s){this.logger.log("setButtonAttribute: "+e+' - "'+t+'"'),this[e]!==t&&(0===i.length?_7.isNil(t)||""===String(t).trim()?(this.removeAttribute(e),this.setButtonDisplay()):(this.setAttribute(e,String(t)),this.setButtonDisplay()):i.indexOf(t)>=0?(this.setAttribute(e,String(t).trim()),this.setButtonDisplay()):_7.isNil(s)?(this.removeAttribute(e),this.setButtonDisplay()):(this.setAttribute(e,String(s).trim()),this.setButtonDisplay()))}set vAlignLabel(e){this.setAttributeAndProperty(this.BUTTON_PROPERTIES.VALIGN_LABEL,e)}get vAlignLabel(){return this._vAlignLabel}set mode(t){if(this.logger.log('set mode("'+t+'")'),this._mode!==t){if(Number.isNaN(t))this._mode=0;else if(t>=e.MODES.MIN_LENGTH&&t<=e.MODES.MAX_LENGTH){const e=this.getElementsByTagName("ch5-button-mode");e&&e.length>0&&t<e.length?this._mode=t:this._mode=0}else this._mode=0;this.setAttribute("mode",String(this._mode)),this.setButtonDisplay()}}get mode(){return this._mode}set checkboxPosition(t){this.setButtonAttribute("checkboxPosition",t,e.CHECKBOX_POSITIONS,e.CHECKBOX_POSITIONS[0])}get checkboxPosition(){return this._checkboxPosition}set checkboxShow(e){this.logger.log('set checkboxShow("'+e+'")'),this.setAttributeAndProperty(this.BUTTON_PROPERTIES.CHECKBOX_SHOW,e)}get checkboxShow(){return this._checkboxShow}set iconPosition(t){this.setButtonAttribute("iconPosition",t,e.ICON_POSITIONS,e.ICON_POSITIONS[0])}get iconPosition(){return this._iconPosition}set iconUrl(e){this.setButtonAttribute("iconUrl",e)}get iconUrl(){return this._iconUrl}set orientation(t){this.logger.log('set orientation("'+t+'")'),this._orientation!==t&&(this._orientation=Ch5ButtonUtils.getValidInputValue(e.ORIENTATIONS,t),this.setAttribute("orientation",this._orientation))}get orientation(){return this._orientation}set type(t){this.logger.log('set type("'+t+'")'),this._type!==t&&(this.setAttribute("type",Ch5ButtonUtils.getValidInputValue(e.TYPES,t)),this.setButtonDisplay())}get type(){return this._type}set shape(t){this.logger.log('set shape("'+t+'")'),this._shape!==t&&null!==t&&(e.SHAPES.indexOf(t)>=0?this._shape=t:this._shape=e.SHAPES[0],this.setAttribute("shape",this._shape))}get shape(){return this._shape}set size(t){this.logger.log('set size("'+t+'")'),this._size!==t&&null!==t&&(e.SIZES.indexOf(t)>=0?this._size=t:this._size=e.SIZES[0],this.setAttribute("size",this._size))}get size(){return this._size}set stretch(t){this.logger.log('set stretch("'+t+'")'),null!==t?this._stretch!==t&&(e.STRETCHES.indexOf(t)>=0?(this._stretch=t,this.setAttribute("stretch",this._stretch)):(this._stretch=null,this.removeAttribute("stretch"))):(this._stretch=null,this.removeAttribute("stretch")),this.updateCssClasses()}get stretch(){return this._stretch}set selected(e){this.logger.log('set selected("'+e+'")'),(_7.isNil(this.receiveStateSelected)||""===this.receiveStateSelected)&&this.setAttributeAndProperty(this.BUTTON_PROPERTIES.SELECTED,e)}get selected(){return this._selected}set pressed(e){var t;this.logger.log('set pressed("'+e+'")'),this.setAttributeAndProperty(this.BUTTON_PROPERTIES.PRESSED,e);let i=!1;i="boolean"==typeof e?e:!!this.hasAttribute("pressed")&&(!([!0,!1,"true","false","0","1",0,1,"",null].indexOf(e)<0)&&this.toBoolean(e,!0)),this._pressable&&(null==(t=this._pressable)?void 0:t._pressed)!==i&&this._pressable.setPressed(i),this.updateCssClasses()}get pressed(){return!!this._pressable&&this._pressable._pressed}set customClassState(e){this.logger.log('set customclassstate("'+e+'")'),this._customClassState!==e&&(this._customClassState=e)}get customClassState(){return this._customClassState}set customClassPressed(e){this.logger.log('set customClassPressed("'+e+'")'),this._customClassPressed!==e&&(this._customClassPressed=e)}get customClassPressed(){return this._customClassPressed}set customClassDisabled(e){this.logger.log('set customClassDisabled("'+e+'")'),this._customClassDisabled!==e&&(this._customClassDisabled=e)}get customClassDisabled(){return this._customClassDisabled}set backgroundImageUrl(e){this._ch5Properties.set("backgroundImageUrl",e,()=>{this.backgroundImageURLHandler()})}get backgroundImageUrl(){return this._ch5Properties.get("backgroundImageUrl")}set backgroundImageFillType(e){this._ch5Properties.set("backgroundImageFillType",e,()=>{this.updateCssClasses()})}get backgroundImageFillType(){return this._ch5Properties.get("backgroundImageFillType")}set iconUrlFillType(e){this._ch5Properties.set("iconUrlFillType",e,()=>{this._iconUrlFillType!==e&&(this.setButtonDisplay(),this.updateCssClasses())})}get iconUrlFillType(){return this._iconUrlFillType}set receiveStateBackgroundImageUrl(e){this._ch5Properties.set("receiveStateBackgroundImageUrl",e,null,e=>{this._ch5Properties.setForSignalResponse("backgroundImageUrl",e,()=>{this.backgroundImageURLHandler()})})}get receiveStateBackgroundImageUrl(){return this._ch5Properties.get("receiveStateBackgroundImageUrl")}set sendEventOnClick(e){this.logger.log('set sendEventOnClick("'+e+'")'),""!==e&&e!==this._sigNameSendOnClick&&(this._sigNameSendOnClick=e,this.setAttribute("sendeventonclick",e))}get sendEventOnClick(){return this._sigNameSendOnClick}set sendEventOnTouch(e){this.logger.log('set sendEventOnTouch("'+e+'")'),""!==e&&e!==this._sigNameSendOnTouch&&(this._sigNameSendOnTouch=e,this.setAttribute("sendeventontouch",e))}get sendEventOnTouch(){return this._sigNameSendOnTouch}set receiveStateSelected(e){if(this.logger.log('set receiveStateSelected("'+e+'")'),!e||this._sigNameReceiveSelected===e)return;if(this._sigNameReceiveSelected){const e=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveSelected),t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&t.unsubscribe(this._subReceiveSelected)}this._sigNameReceiveSelected=e,this.setAttribute("receiveStateSelected",e);const t=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveSelected),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);null!==i&&(this._subReceiveSelected=i.subscribe(e=>{e!==this.selected&&this.setAttributeAndProperty(this.BUTTON_PROPERTIES.SELECTED,e,!0)}))}get receiveStateSelected(){return this._attributeValueAsString("receivestateselected")}set receiveStateLabel(e){this.receiveSignalAsString(this,"receiveStateLabel",e)}get receiveStateLabel(){return this._attributeValueAsString("receivestatelabel")}set receiveStateScriptLabelHtml(e){this.receiveSignalAsString(this,"receiveStateScriptLabelHtml",e)}get receiveStateScriptLabelHtml(){return this._attributeValueAsString("receivestatescriptlabelhtml")}set receiveStateIconClass(e){this.receiveSignalAsString(this,"receiveStateIconClass",e)}get receiveStateIconClass(){return this._attributeValueAsString("receivestateiconclass")}set receiveStateIconUrl(e){this.receiveSignalAsString(this,"receiveStateIconUrl",e)}get receiveStateIconUrl(){return this._attributeValueAsString("receivestateiconurl")}set receiveStateMode(e){if(this.logger.log("set receiveStateMode('"+e+"')"),this.logger.log("this._sigNameReceiveStateMode"+this._sigNameReceiveStateMode),this._sigNameReceiveStateMode===e||null===e)return;if(this._sigNameReceiveStateMode){this.logger.log("_sigNameReceiveStateMode exists");const e=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveStateMode),t=Ch5SignalFactory.getInstance().getNumberSignal(e);this.logger.log("oldReceiveStateSigName",e),this.logger.log("oldSignal",t),null!==t&&t.unsubscribe(this._subReceiveSignalMode)}this._sigNameReceiveStateMode=e,this.setAttribute("receivestatemode",e);const t=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveStateMode),i=Ch5SignalFactory.getInstance().getNumberSignal(t);null!==i&&(this._subReceiveSignalMode=i.subscribe(e=>{!1===this.isModeSetUsingJavascript&&(this.mode=Number(e),this.setButtonDisplay())}))}get receiveStateMode(){return this._attributeValueAsString("receivestatemode")}set receiveStateType(e){this.receiveSignalAsString(this,"receiveStateType",e)}get receiveStateType(){return this._attributeValueAsString("receivestatetype")}set sgIconTheme(t){this._ch5Properties.set("sgIconTheme",t,()=>{Array.from(e.SG_ICON_THEME).forEach(e=>this._elIcon.classList.remove("sg-"+e)),this._elIcon.classList.add("sg-"+this.sgIconTheme)})}get sgIconTheme(){return this._ch5Properties.get("sgIconTheme")}set receiveStateSGIconNumeric(t){this._ch5Properties.set("receiveStateSGIconNumeric",t,null,t=>{t>=0&&t<=e.MAX_SG_NUMERIC&&(this.sgIconNumeric=t,this.setButtonDisplay())})}get receiveStateSGIconNumeric(){return this._ch5Properties.get("receiveStateSGIconNumeric")}set receiveStateSGIconString(e){this._ch5Properties.set("receiveStateSGIconString",e,null,e=>{this.sgIconString=e.trim().toLowerCase().split(" ").join("-"),this.setButtonDisplay()})}get receiveStateSGIconString(){return this._ch5Properties.get("receiveStateSGIconString")}set receiveStateCustomClass(e){this.receiveSignalAsString(this,"receiveStateCustomClass",e)}get receiveStateCustomClass(){return this._attributeValueAsString("receivestatecustomclass")}set receiveStateCustomStyle(e){this.receiveSignalAsString(this,"receiveStateCustomStyle",e)}get receiveStateCustomStyle(){return this._attributeValueAsString("receivestatecustomstyle")}connectedCallback(){var e,t,i;this.logger.start("connectedCallback()",this.primaryCssClass),subscribeInViewPortChange(this,()=>{this.elementIsInViewPort?this.verticalOrientationHandler():(this.setAttribute("pressed","false"),this._pressable&&this._pressable.resetPressAndReleaseActions())}),this.isButtonInitiated=!1,this.previousExtendedProperties={},this._listOfAllPossibleComponentCssClasses=this.generateListOfAllPossibleComponentCssClasses(),"ch5-tab-button"===(null==(e=this.buttonListContract)?void 0:e.parentComponent)||"ch5-button-list"===(null==(t=this.buttonListContract)?void 0:t.parentComponent)?this.updatePressedClass(this.primaryCssClass+this.pressedCssClassPostfix+" "+(null==(i=this.buttonListContract)?void 0:i.parentComponent)+this.pressedCssClassPostfix,!1):this.updatePressedClass(this.primaryCssClass+this.pressedCssClassPostfix),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Button),this._elContainer.parentElement!==this&&this.appendChild(this._elContainer),this.customClassState&&this.hasAttribute("customclasspressed")&&this.updatePressedClass(this.customClassState),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.hasAttribute("customclasspressed")||this.updateCssClassesForCustomState(),customElements.whenDefined("ch5-button").then(()=>{this.isButtonInitiated=!0,this.setButtonDisplay(),this.updateCssClasses(),this.componentLoadedEvent(this.ELEMENT_NAME,this.id)}),this.logger.stop()}onWindowResizeHandler(){this.isResizeInProgress||(this.isResizeInProgress=!0,setTimeout(()=>{this.verticalOrientationHandler(),this.isResizeInProgress=!1},this.RESIZE_DEBOUNCE))}verticalOrientationHandler(){if(!_7.isNil(this.stretch)&&"circle"===this.shape&&this.parentElement){const{offsetHeight:e,offsetWidth:t}=this.parentElement,i=t<=e?t:e;0!==i&&(this.style.height=i+"px",this.style.width=i+"px")}if("vertical"===this.orientation)if(!_7.isNil(this.stretch)&&this.parentElement){const{height:e,width:t}=this.parentElement.getBoundingClientRect();"height"===this.stretch?(this._elButton.style.width=e+"px",this._elButton.style.height=this._elContainer.getBoundingClientRect().width+"px"):"width"===this.stretch?(this._elButton.style.height=t+"px",this._elButton.style.width=this._elContainer.getBoundingClientRect().height+"px"):"both"===this.stretch&&(this._elButton.style.height=t+"px",this._elButton.style.width=e+"px")}else if(_7.isNil(this.stretch)&&"circle"!==this.shape){const{height:e,width:t}=this._elContainer.getBoundingClientRect();this._elButton.style.width=e+"px",this._elButton.style.height=t+"px"}else"circle"===this.shape&&(this._elButton.style.removeProperty("width"),this._elButton.style.removeProperty("height"));else this._elButton.style.removeProperty("width"),this._elButton.style.removeProperty("height")}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=["label","labelinnerhtml","iconclass","iconposition","orientation","iconurl","checkboxshow","checkboxposition","halignlabel","valignlabel","shape","size","stretch","type","formtype","mode","pressed","selected","customclassselected","customclasspressed","customclassdisabled","receivestatemode","receivestateselected","receivestatelabel","receivestatescriptlabelhtml","receivestateiconclass","receivestateiconurl","receivestatetype","sendeventonclick","sendeventontouch","iconurlfilltype","backgroundimageurl","backgroundimagefilltype","receivestatebackgroundimageurl"];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this.logger.start("initAttributes",this.primaryCssClass),this.hasAttribute("checkboxposition")&&(this.checkboxPosition=this.getAttribute("checkboxposition")),this.hasAttribute("checkboxshow")&&(this.checkboxShow=this.getAttribute("checkboxshow")),this.hasAttribute("customclassselected")&&(this.customClassState=this.getAttribute("customclassselected")),this.hasAttribute("customclasspressed")&&(this.customClassPressed=this.getAttribute("customclasspressed"),this.customClassState=this.customClassPressed),this.hasAttribute("customclassdisabled")&&(this.customClassDisabled=this.getAttribute("customclassdisabled"),this.customClassState=this.customClassDisabled),this.hasAttribute("formtype")&&(this.formType=this.getAttribute("formtype")),this.hasAttribute("halignlabel")&&(this.hAlignLabel=this.getAttribute("halignlabel")),this.hasAttribute("iconclass")&&(this.iconClass=this.getAttribute("iconclass")),this.hasAttribute("iconposition")&&(this.iconPosition=this.getAttribute("iconposition")),this.hasAttribute("iconurl")&&(this.iconUrl=this.getAttribute("iconurl")),this.hasAttribute("label")&&(this.label=this.getAttribute("label")),this.hasAttribute("mode")&&(this.mode=Number(this.getAttribute("mode"))),this.hasAttribute("orientation")&&(this.orientation=this.getAttribute("orientation")),this.hasAttribute("selected")&&(this.selected=this.getAttribute("selected")),this.hasAttribute("shape")&&(this.shape=this.getAttribute("shape")),this.hasAttribute("size")&&(this.size=this.getAttribute("size")),this.hasAttribute("stretch")&&(this.stretch=this.getAttribute("stretch")),this.hasAttribute("type")&&(this.type=this.getAttribute("type")),this.hasAttribute("valignlabel")&&(this.vAlignLabel=this.getAttribute("valignlabel")),this.hasAttribute("pressed")&&(this.pressed=this.getAttribute("pressed")),this.hasAttribute("labelInnerHTML")&&(this.labelInnerHTML=this.getAttribute("labelInnerHTML")),this.hasAttribute("receivestateselected")&&(this.receiveStateSelected=this.getAttribute("receivestateselected")),this.hasAttribute("receivestatelabel")&&(this.receiveStateLabel=this.getAttribute("receivestatelabel")),this.hasAttribute("receivestatescriptlabelhtml")&&(this.receiveStateScriptLabelHtml=this.getAttribute("receivestatescriptlabelhtml")),this.hasAttribute("receivestateiconclass")&&(this.receiveStateIconClass=this.getAttribute("receivestateiconclass")),this.hasAttribute("receivestateiconurl")&&(this.receiveStateIconUrl=this.getAttribute("receivestateiconurl")),this.hasAttribute("receivestatetype")&&(this.receiveStateType=this.getAttribute("receivestatetype")),this.hasAttribute("receivestatemode")&&(this.receiveStateMode=this.getAttribute("receivestatemode")),this.hasAttribute("sendeventonclick")&&(this.sendEventOnClick=this.getAttribute("sendeventonclick")),this.hasAttribute("sendeventontouch")&&(this.sendEventOnTouch=this.getAttribute("sendeventontouch")),this.updateCssClasses(),this.updateInternalHtml(),this.logger.stop()}attachEventListeners(){super.attachEventListeners(),this._elButton.addEventListener("focus",this._onFocus),this._elButton.addEventListener("blur",this._onBlur),isNil5(this._pressable)||(this._pressable.init(),this._subscribeToPressableIsPressed()),resizeObserver(this._elContainer,this.onWindowResizeHandler.bind(this))}removeEventListeners(){super.removeEventListeners(),this._elButton.removeEventListener("focus",this._onFocus),this._elButton.removeEventListener("blur",this._onBlur),this.style&&(this.style.removeProperty("height"),this.style.removeProperty("width")),isNil5(this._pressable)||this._unsubscribeFromPressableIsPressed()}_onFocus(e){this.logger.start("_onFocus");const t=new Event(e.type,e);this.dispatchEvent(t),e.preventDefault(),e.stopPropagation(),this.logger.stop()}_onBlur(e){this.logger.start("_onBlur"),this.pressed=!1;const t=new Event(e.type,e);this.dispatchEvent(t),e.preventDefault(),e.stopPropagation(),this.logger.stop()}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i===s)return void this.logger.stop();this.logger.log('ch5-button attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}switch(t){case"customclass":this.customClass=Ch5ButtonUtils.getAttributeValue(this,"customclass",s,"");break;case"labelinnerhtml":this.labelInnerHTML=Ch5ButtonUtils.getAttributeValue(this,"labelinnerhtml",s,"");break;case"receivestatecustomclass":this.hasAttribute("receivestatecustomclass")?this.receiveStateCustomClass=this.getAttribute("receivestatecustomclass"):(this.clearStringSignalSubscription(this._receiveStateCustomClass,this._subKeySigReceiveCustomClass),this._receiveStateCustomClass="");break;case"customstyle":this.customStyle=Ch5ButtonUtils.getAttributeValue(this,"customstyle",s,"");break;case"receivestatecustomstyle":this.hasAttribute("receivestatecustomstyle")?this.receiveStateCustomStyle=this.getAttribute("receivestatecustomstyle"):(this.clearStringSignalSubscription(this._receiveStateCustomStyle,this._subKeySigReceiveCustomStyle),this._receiveStateCustomStyle="");break;case"label":this.label=Ch5ButtonUtils.getAttributeValue(this,"label",s,"");break;case"iconclass":this.iconClass=Ch5ButtonUtils.getAttributeValue(this,"iconclass",s,"");break;case"iconposition":this.iconPosition=Ch5ButtonUtils.getAttributeValue(this,"iconposition",s,e.ICON_POSITIONS[0]);break;case"iconurl":this.iconUrl=Ch5ButtonUtils.getAttributeValue(this,"iconurl",s,"");break;case"mode":this.mode=Ch5ButtonUtils.getAttributeValue(this,"mode",Number(s),0),this.updateCssClasses(),this.updateInternalHtml();break;case"orientation":this.orientation=Ch5ButtonUtils.getAttributeValue(this,"orientation",s,e.ORIENTATIONS[0]),this.updateCssClasses();break;case"type":this.type=Ch5ButtonUtils.getAttributeValue(this,"type",s,e.TYPES[0]);break;case"shape":this.shape=Ch5ButtonUtils.getAttributeValue(this,"shape",s,e.SHAPES[0]),this.updateCssClasses();break;case"halignlabel":this.hAlignLabel=Ch5ButtonUtils.getAttributeValue(this,"halignlabel",s,e.HORIZONTAL_LABEL_ALIGNMENTS[0]);break;case"valignlabel":this.vAlignLabel=Ch5ButtonUtils.getAttributeValue(this,"valignlabel",s,e.VERTICAL_LABEL_ALIGNMENTS[0]);break;case"size":this.size=Ch5ButtonUtils.getAttributeValue(this,"size",s,e.SIZES[0]),this.updateCssClasses();break;case"stretch":this.stretch=Ch5ButtonUtils.getAttributeValue(this,"stretch",s,null),this.updateCssClasses();break;case"selected":this.selected=s;break;case"pressed":this.pressed=s;break;case"checkboxshow":this.checkboxShow=s,this.updateInternalHtml();break;case"checkboxposition":this.checkboxPosition=Ch5ButtonUtils.getAttributeValue(this,"checkboxposition",s,e.CHECKBOX_POSITIONS[0]);break;case"formtype":this.hasAttribute("formtype")&&(this.formType=this.getAttribute("formtype"));break;case"customclassselected":this.customClassState=Ch5ButtonUtils.getAttributeValue(this,"customclassselected",s,""),this.updateCssClassesForCustomState();break;case"customclasspressed":this.customClassPressed=Ch5ButtonUtils.getAttributeValue(this,"customclasspressed",s,""),this.customClassState=this.customClassPressed,this.updatePressedClass(this.customClassState);break;case"customclassdisabled":this.customClassDisabled=Ch5ButtonUtils.getAttributeValue(this,"customclassdisabled",s,""),this.customClassState=this.customClassDisabled,this.updateCssClassesForCustomState();break;case"receivestateselected":this.receiveStateSelected=Ch5ButtonUtils.getAttributeValue(this,"receivestateselected",s,"");break;case"receivestatelabel":this.receiveStateLabel=Ch5ButtonUtils.getAttributeValue(this,"receivestatelabel",s,"");break;case"receivestatescriptlabelhtml":this.receiveStateScriptLabelHtml=Ch5ButtonUtils.getAttributeValue(this,"receivestatescriptlabelhtml",s,"");break;case"sendeventonclick":this.sendEventOnClick=Ch5ButtonUtils.getAttributeValue(this,"sendeventonclick",s,"");break;case"sendeventontouch":this.sendEventOnTouch=Ch5ButtonUtils.getAttributeValue(this,"sendeventontouch",s,"");break;case"receivestateiconclass":this.receiveStateIconClass=Ch5ButtonUtils.getAttributeValue(this,"receivestateiconclass",s,"");break;case"receivestateiconurl":this.receiveStateIconUrl=Ch5ButtonUtils.getAttributeValue(this,"receivestateiconurl",s,"");break;case"receivestatetype":this.receiveStateType=Ch5ButtonUtils.getAttributeValue(this,"receivestatetype",s,"");break;case"receivestatemode":this.receiveStateMode=Ch5ButtonUtils.getAttributeValue(this,"receivestatemode",s,"");break;default:super.attributeChangedCallback(t,i,s)}this.logger.stop()}updateSwipeGesture(){null===this._pressable||_7.isNil(this._pressable.options)||(this._pressable.options.enableSwipe=this.swipeGestureEnabled)}createButtonLabel(e){const t=e.getElementsByTagName("ch5-button-label"),i=Array.prototype.slice.call(t).filter(t=>t.parentNode.nodeName.toString().toLowerCase()===e.nodeName.toString().toLowerCase());let s=null;i&&i.length>0&&!isNil5(i[0].children[0])?s=i[0]:(s=document.createElement("ch5-button-label"),e.appendChild(s));let n=s.querySelector("template");null!==n&&s.removeChild(n),n=document.createElement("template"),n.innerHTML=this.decodeInnerHTMLForAttribute(e.labelInnerHTML),s.appendChild(n)}backgroundImageURLHandler(){""===this.backgroundImageUrl||_7.isNil(this.backgroundImageUrl)||(this._elButton.style.backgroundImage="url("+this.backgroundImageUrl+")")}_subscribeToPressableIsPressed(){if(""!==this.buttonListContract.contractName.trim()&&"ch5-button-list"===this.buttonListContract.parentComponent.trim())return this._subscribeToPressableIsPressedForButtonList();if(""!==this.buttonListContract.contractName.trim()&&"ch5-tab-button"===this.buttonListContract.parentComponent.trim())return this._subscribeToPressableIsPressedForTabButton();null===this._isPressedSubscription&&null!==this._pressable&&(this._isPressedSubscription=this._pressable.observablePressed.subscribe(e=>{this.logger.log(`Ch5Button.pressableSubscriptionCb(${e})`,this.pressed),!1===e?(null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),this.sendValueForRepeatDigitalWorking(!1),setTimeout(()=>{this.setButtonDisplay()},this.STATE_CHANGE_TIMEOUTS)):(this.sendValueForRepeatDigitalWorking(!0),null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),this._repeatDigitalInterval=window.setInterval(()=>{this.sendValueForRepeatDigitalWorking(!0)},200),this.setButtonDisplay())}))}_subscribeToPressableIsPressedForTabButton(){null===this._isPressedSubscription&&null!==this._pressable&&(this._isPressedSubscription=this._pressable.observablePressed.subscribe(e=>{var t,i;this.logger.log(`Ch5Button.pressableSubscriptionCb(${e})`,this.pressed),!1===e?(null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.buttonListContract.contractName+`.Tab${this.buttonListContract.index}_Press`))||t.publish(e),setTimeout(()=>{this.setButtonDisplay()},this.STATE_CHANGE_TIMEOUTS)):(null==(i=Ch5SignalFactory.getInstance().getBooleanSignal(this.buttonListContract.contractName+`.Tab${this.buttonListContract.index}_Press`))||i.publish(e),this.setButtonDisplay())}))}_subscribeToPressableIsPressedForButtonList(){if(null===this._isPressedSubscription&&null!==this._pressable){let e=!1;this._isPressedSubscription=this._pressable.observablePressed.subscribe(t=>{var i,s,n,r;this.logger.log(`Ch5Button.pressableSubscriptionCb(${t})`,this.pressed),!1===t?(null==(i=Ch5SignalFactory.getInstance().getBooleanSignal(this.buttonListContract.contractName+`.Button${this.buttonListContract.index}ItemPress`))||i.publish(t),!1===e&&(null==(s=Ch5SignalFactory.getInstance().getNumberSignal(this.buttonListContract.contractName+".ListItemClicked"))||s.publish(this.buttonListContract.index)),null!==this._repeatDigitalInterval&&(window.clearInterval(this._repeatDigitalInterval),e=!1),setTimeout(()=>{this.setButtonDisplay()},this.STATE_CHANGE_TIMEOUTS)):(null==(n=Ch5SignalFactory.getInstance().getBooleanSignal(this.buttonListContract.contractName+`.Button${this.buttonListContract.index}ItemPress`))||n.publish(t),null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),0===this.buttonListContract.clickHoldTime?(e=!0,null==(r=Ch5SignalFactory.getInstance().getNumberSignal(this.buttonListContract.contractName+".ListItemHeld"))||r.publish(this.buttonListContract.index)):this._repeatDigitalInterval=window.setInterval(()=>{var t;e=!0,null==(t=Ch5SignalFactory.getInstance().getNumberSignal(this.buttonListContract.contractName+".ListItemHeld"))||t.publish(this.buttonListContract.index),window.clearInterval(this._repeatDigitalInterval)},this.buttonListContract.clickHoldTime),this.setButtonDisplay())})}}_unsubscribeFromPressableIsPressed(){null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),null!==this._isPressedSubscription&&(this._isPressedSubscription.unsubscribe(),this._isPressedSubscription=null)}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),unSubscribeInViewPortChange(this),null!==this._pressable&&this._pressable.destroy(),this.disconnectCommonMutationObserver(),this.logger.stop()}updatePressedClass(e,t=!0){this._pressable=new Ch5Pressable(this,{cssTargetElement:this.getTargetElementForCssClassesAndStyle(),cssPressedClass:e,enableSwipe:this.swipeGestureEnabled,touchMove:t})}updateForChangeInCustomCssClass(){const e=this.getTargetElementForCssClassesAndStyle();this.logger.start("updateForChangeInCustomCssClass()"),this._prevAddedCustomClasses.forEach(t=>{""!==t&&e.classList.remove(t)}),this._prevAddedCustomClasses=[],this.customClass.split(" ").forEach(t=>{""!==t&&(this._prevAddedCustomClasses.push(t),e.classList.add(t))}),this.logger.stop()}updateForChangeInStyleCss(){this.logger.start("updateForChangeInStyleCss()");this.getTargetElementForCssClassesAndStyle().style.cssText=this.customStyle,this.logger.stop()}generateListOfAllPossibleComponentCssClasses(){var t,i,s;const n=[];return n.push(this.primaryCssClass),e.SHAPES.forEach(e=>{const t=this.primaryCssClass+"--"+e;n.push(t)}),e.TYPES.forEach(e=>{const t=this.primaryCssClass+"--"+e;n.push(t)}),e.HORIZONTAL_LABEL_ALIGNMENTS.forEach(e=>{const t=this.primaryCssClass+"--horizontal-"+e;n.push(t)}),e.VERTICAL_LABEL_ALIGNMENTS.forEach(e=>{const t=this.primaryCssClass+"--vertical-"+e;n.push(t)}),e.SIZES.forEach(e=>{n.push(this.primaryCssClass+"--size-"+e)}),e.STRETCHES.forEach(e=>{n.push(this.primaryCssClass+"--stretch-"+e)}),e.BACKGROUND_IMAGE_FILL_TYPE.forEach(e=>{n.push(this.primaryCssClass+"--background-image-fill-type-"+e)}),e.ICON_URL_FILL_TYPE.forEach(e=>{n.push(this.primaryCssClass+"--icon-url-fill-type-"+e)}),e.ORIENTATIONS.forEach(e=>{n.push(this.primaryCssClass+"--"+e)}),n.push(this.primaryCssClass+this.selectedCssClassPostfix),"ch5-tab-button"!==(null==(t=this.buttonListContract)?void 0:t.parentComponent)&&"ch5-button-list"!==(null==(i=this.buttonListContract)?void 0:i.parentComponent)||n.push((null==(s=this.buttonListContract)?void 0:s.parentComponent)+this.selectedCssClassPostfix),n}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5ButtonSignal.unsubscribeAll(),this.clearBooleanSignalSubscription(this._sigNameReceiveSelected,this._subReceiveSelected),this._sigNameReceiveSelected="",this._subReceiveSelected="",this.clearNumberSignalSubscription(this._sigNameReceiveStateMode,this._subReceiveSignalMode),this._sigNameReceiveStateMode=null,this._subReceiveSignalMode=null}updateIconDisplay(){var t,i;this.logger.start("updateIconDisplay"),isNil5(this._previousIconUrl)||""===this._previousIconUrl||(this._elIcon.style.backgroundImage=""),isNil5(this._previousIconClass)||""===this._previousIconClass||this._previousIconClass.split(" ").forEach(e=>{e=e.trim(),this._elIcon&&this._elIcon.classList&&""!==e&&this._elIcon.classList.remove(e)}),-1!==this._previousSgIconNumeric&&this._elIcon.classList.remove("sg-"+this._previousSgIconNumeric),""!==this._previousSgIconString&&this._elIcon.classList.remove("sg-"+this._previousSgIconString),this._elIcon.classList.remove("sg"),Array.from(e.SG_ICON_THEME).forEach(e=>this._elIcon.classList.remove("sg-"+e)),isNil5(this.sgIconString)||""===this.sgIconString?isNil5(this.sgIconNumeric)||-1===this.sgIconNumeric?isNil5(this.iconUrl)||""===this.iconUrl||this.iconUrl!==(null==(t=this._ch5ButtonSignal.getSignal("receiveStateIconUrl"))?void 0:t.currentValue)?isNil5(this.iconClass)||""===this.iconClass||this.iconClass!==(null==(i=this._ch5ButtonSignal.getSignal("receiveStateiconClass"))?void 0:i.currentValue)?isNil5(this.iconUrl)||""===this.iconUrl?isNil5(this.iconClass)||""===this.iconClass||this.iconClass.split(" ").forEach(e=>{""!==(e=e.trim())&&this._elIcon.classList.add(e)}):this._elIcon.style.backgroundImage=this.iconUrl:this.iconClass.split(" ").forEach(e=>{""!==(e=e.trim())&&this._elIcon.classList.add(e)}):this._elIcon.style.backgroundImage=this.iconUrl:(this._elIcon.classList.add("sg-"+this.sgIconNumeric),this._previousSgIconNumeric=this.sgIconNumeric,this._elIcon.classList.add("sg"),this._elIcon.classList.add("sg-"+this.sgIconTheme)):(this._elIcon.classList.add("sg-"+this.sgIconString),this._previousSgIconString=this.sgIconString,this._elIcon.classList.add("sg"),this._elIcon.classList.add("sg-"+this.sgIconTheme)),this.logger.stop()}setLabel(e){this.labelSetByJavascriptValue=e,this.isLabelSetUsingJavascript=!0,this.setButtonDisplay()}setMode(e){this.mode=e,this.isModeSetUsingJavascript=!0,this.setButtonDisplay()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._elButton=document.createElement("button"),this._elButton.classList.add(this.BUTTON_PRIMARY_CLASS),this._elCheckboxIcon=document.createElement("i"),this._elCheckboxIcon.classList.add("cb-checkbox-icon"),this._elSpanForLabelIconImg=document.createElement("span"),this._elSpanForLabelIconImg.classList.add("cb-lbl"),this._elSpanForLabelOnly=document.createElement("span"),this._elSpanForLabelOnly.classList.add("cb-lbl"),this._elIcon=document.createElement("i"),this._elIcon.classList.add("cb-icon"),this._elContainer.classList.add(this.primaryCssClass),this._elButton.setAttribute("data-ch5-id",this.getCrId()),this._elIcon.classList.add(this.primaryCssClass+"--icon"),this._elSpanForLabelOnly.classList.add(this.primaryCssClass+"--label"),this._elContainer.appendChild(this._elButton),this.logger.stop()}addContainerClass(e){this._elContainer.classList.contains(e)||this._elContainer.classList.add(e)}removeContainerClass(e){this._elContainer.classList.contains(e)&&this._elContainer.classList.remove(e)}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}sendValueForRepeatDigitalWorking(e){if(this.info(`Ch5Button.sendValueForRepeatDigital(${e})`),!this._sigNameSendOnTouch&&!this._sigNameSendOnClick)return;const t=Ch5SignalFactory.getInstance().getObjectAsBooleanSignal(this._sigNameSendOnTouch),i=Ch5SignalFactory.getInstance().getObjectAsBooleanSignal(this._sigNameSendOnClick);i&&t&&i.name===t.name?i.publish({[Ch5SignalBridge.REPEAT_DIGITAL_KEY]:e}):(t&&t.name&&t.publish({[Ch5SignalBridge.REPEAT_DIGITAL_KEY]:e}),i&&i.name&&i.publish({[Ch5SignalBridge.REPEAT_DIGITAL_KEY]:e}))}checkboxDisplay(){this.logger.start("checkboxDisplay");let e=[],t=[];const i=this.primaryCssClass+"__checkbox";e=[i,i+"--unchecked",i+"--checked"],!0===this._checkboxShow&&!0===this._selected?t=[i,i+"--checked"]:!1===this._checkboxShow||!0===this._checkboxShow&&(t=[i,i+"--unchecked"]),e.forEach(e=>{""!==(e=e.trim())&&this._elCheckboxIcon.classList.remove(e)}),t.forEach(e=>{""!==(e=e.trim())&&this._elCheckboxIcon.classList.add(e)}),this._elCheckboxIcon.classList.remove("cx-button-checkbox-pos-left"),this._elCheckboxIcon.classList.remove("cx-button-checkbox-pos-right"),!0===this.checkboxShow&&this._elCheckboxIcon.classList.add("cx-button-checkbox-pos-"+this.checkboxPosition);let s=!1;this.hasAttribute("checkboxShow")&&!0===this.toBoolean(this.hasAttribute("checkboxshow")&&"false"!==this.getAttribute("checkboxshow"))&&(s=!0),this.logger.log("hasCheckboxIcon",s),this._elCheckboxIcon.parentNode&&this._elCheckboxIcon.remove(),s?"right"===this.checkboxPosition?this._elCheckboxIcon.parentNode!==this._elButton?this._elButton.appendChild(this._elCheckboxIcon):this._elButton.insertBefore(this._elSpanForLabelIconImg,this._elCheckboxIcon):"left"===this.checkboxPosition&&!0===this._elSpanForLabelIconImg.isConnected&&this._elButton.insertBefore(this._elCheckboxIcon,this._elSpanForLabelIconImg):this._elCheckboxIcon.parentNode&&this._elCheckboxIcon.remove(),this.logger.stop()}setButtonDisplay(){0===this.DEBOUNCE_BUTTON_DISPLAY||!0===this.isButtonInitiated?this.setButtonDisplayDetails():this.debounceSetButtonDisplay()}encodeInnerHTMLForAttribute(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}decodeInnerHTMLForAttribute(e){return e.replace("&","&").replace("<","<").replace(">",">").replace(""",'/"').replace("'","/'")}setButtonDisplayDetails(t="ch5-button"){var i;this.logger.start("setButtonDisplayDetails"),this.DEBOUNCE_BUTTON_DISPLAY=0;const s={};if(this.receiveStateType&&""!==this.receiveStateType){const t=this._ch5ButtonSignal.getVariable("receiveStateType");!isNil5(t)&&e.TYPES.indexOf(t)>=0?s.type=t:(s.type=e.TYPES[0],this._ch5ButtonSignal.setVariable("receiveStateType",e.TYPES[0]))}this.receiveStateIconClass&&""!==this.receiveStateIconClass&&(s.iconClass=this._ch5ButtonSignal.getVariable("receiveStateIconClass")),this.receiveStateIconUrl&&""!==this.receiveStateIconUrl&&(s.iconUrl=this._ch5ButtonSignal.getVariable("receiveStateIconUrl")),this.receiveStateCustomClass&&""!==this.receiveStateCustomClass&&(s.customClass=this._ch5ButtonSignal.getVariable("receiveStateCustomClass")),this.receiveStateCustomStyle&&""!==this.receiveStateCustomStyle&&(s.customStyle=this._ch5ButtonSignal.getVariable("receiveStateCustomStyle")),!0===this.isLabelSetUsingJavascript?s.labelHtml=this.labelSetByJavascriptValue:this.receiveStateScriptLabelHtml&&""!==this.receiveStateScriptLabelHtml?s.labelHtml=this._ch5ButtonSignal.getVariable("receiveStateScriptLabelHtml"):this.receiveStateLabel&&""!==this.receiveStateLabel&&(s.label=this._ch5ButtonSignal.getVariable("receiveStateLabel"));const n=this.getElementsByTagName("ch5-button-mode");if(n&&n.length>0){const e=n[this.mode];if(e){const t=e.getElementsByTagName("ch5-button-mode-state");if(t&&t.length>0){let e=null;if(e=!0===(null==(i=this._pressable)?void 0:i._pressed)?Array.from(t).find(e=>"pressed"===e.getAttribute("state")):!0===this.selected?Array.from(t).find(e=>"selected"===e.getAttribute("state")):Array.from(t).find(e=>"normal"===e.getAttribute("state")),e){isNil5(s.type)&&!isNil5(e.getAttribute("type"))&&(s.type=e.getAttribute("type")),isNil5(s.iconUrl)&&!isNil5(e.getAttribute("iconurl"))&&(s.iconUrl=e.getAttribute("iconurl")),isNil5(s.iconClass)&&!isNil5(e.getAttribute("iconclass"))&&(s.iconClass=e.getAttribute("iconclass")),isNil5(s.iconPosition)&&!isNil5(e.getAttribute("iconposition"))&&(s.iconPosition=e.getAttribute("iconposition")),isNil5(s.checkboxPosition)&&!isNil5(e.getAttribute("checkboxposition"))&&(s.checkboxPosition=e.getAttribute("checkboxposition")),isNil5(s.customClass)&&!isNil5(e.getAttribute("customclass"))&&(s.customClass=e.getAttribute("customclass")),isNil5(s.customStyle)&&!isNil5(e.getAttribute("customstyle"))&&(s.customStyle=e.getAttribute("customstyle")),isNil5(s.hAlignLabel)&&!isNil5(e.getAttribute("halignlabel"))&&(s.hAlignLabel=e.getAttribute("halignlabel")),isNil5(s.vAlignLabel)&&!isNil5(e.getAttribute("valignlabel"))&&(s.vAlignLabel=e.getAttribute("valignlabel")),isNil5(s.iconUrlFillType)&&!isNil5(e.getAttribute("iconurlfilltype"))&&(s.iconUrlFillType=e.getAttribute("iconurlfilltype"));const t=e.getElementsByTagName("ch5-button-label");isNil5(s.labelHtml)&&isNil5(s.label)&&t&&t.length>0&&t[0].children[0]&&(s.labelHtml=t[0].children[0].innerHTML)}}isNil5(s.type)&&!isNil5(e.getAttribute("type"))&&(s.type=e.getAttribute("type")),isNil5(s.iconUrl)&&!isNil5(e.getAttribute("iconurl"))&&(s.iconUrl=e.getAttribute("iconurl")),isNil5(s.iconClass)&&!isNil5(e.getAttribute("iconclass"))&&(s.iconClass=e.getAttribute("iconclass")),isNil5(s.iconPosition)&&!isNil5(e.getAttribute("iconposition"))&&(s.iconPosition=e.getAttribute("iconposition")),isNil5(s.checkboxPosition)&&!isNil5(e.getAttribute("checkboxposition"))&&(s.checkboxPosition=e.getAttribute("checkboxposition")),isNil5(s.customClass)&&!isNil5(e.getAttribute("customclass"))&&(s.customClass=e.getAttribute("customclass")),isNil5(s.customStyle)&&!isNil5(e.getAttribute("customstyle"))&&(s.customStyle=e.getAttribute("customstyle")),isNil5(s.hAlignLabel)&&!isNil5(e.getAttribute("halignlabel"))&&(s.hAlignLabel=e.getAttribute("halignlabel")),isNil5(s.vAlignLabel)&&!isNil5(e.getAttribute("valignlabel"))&&(s.vAlignLabel=e.getAttribute("valignlabel")),isNil5(s.iconUrlFillType)&&!isNil5(e.getAttribute("iconurlfilltype"))&&(s.iconUrlFillType=e.getAttribute("iconurlfilltype"));const n=e.getElementsByTagName("ch5-button-label");if(isNil5(s.labelHtml)&&isNil5(s.label)&&n&&n.length>0){const e=Array.prototype.slice.call(n).filter(e=>"ch5-button-mode"===e.parentNode.nodeName.toString().toLowerCase());e&&e.length>0&&!isNil5(e[0].children[0])&&(s.labelHtml=e[0].children[0].innerHTML)}}}if(isNil5(s.type)&&!isNil5(this.getAttribute("type"))&&(s.type=this.getAttribute("type")),isNil5(s.iconUrl)&&this.getAttribute("iconurl")&&""!==this.getAttribute("iconurl")&&(s.iconUrl=this.getAttribute("iconurl")),isNil5(s.iconClass)&&this.getAttribute("iconclass")&&""!==this.getAttribute("iconclass")&&(s.iconClass=this.getAttribute("iconclass")),isNil5(s.iconPosition)&&!isNil5(this.getAttribute("iconposition"))&&(s.iconPosition=this.getAttribute("iconposition")),isNil5(s.checkboxPosition)&&!isNil5(this.getAttribute("checkboxposition"))&&(s.checkboxPosition=this.getAttribute("checkboxposition")),isNil5(s.customClass)&&!isNil5(this.getAttribute("customclass"))&&(s.customClass=this.getAttribute("customclass")),isNil5(s.customStyle)&&!isNil5(this.getAttribute("customstyle"))&&(s.customStyle=this.getAttribute("customstyle")),isNil5(s.hAlignLabel)&&!isNil5(this.getAttribute("halignlabel"))&&(s.hAlignLabel=this.getAttribute("halignlabel")),isNil5(s.vAlignLabel)&&!isNil5(this.getAttribute("valignlabel"))&&(s.vAlignLabel=this.getAttribute("valignlabel")),isNil5(s.iconUrlFillType)&&!isNil5(this.getAttribute("iconurlfilltype"))&&(s.iconUrlFillType=this.getAttribute("iconurlfilltype")),isNil5(s.labelHtml)&&isNil5(s.label)){const e=this.getElementsByTagName(t+"-label");if(e&&e.length>0){const i=Array.prototype.slice.call(e).filter(e=>e.parentNode.nodeName.toString().toLowerCase()===t);i&&i.length>0&&!isNil5(i[0].children[0])&&(i&&i.length>0&&i[0].children?s.labelHtml=i[0].children[0].innerHTML:isNil5(this.getAttribute("label"))||(s.label=this.getAttribute("label")))}else isNil5(this.getAttribute("label"))||(s.label=this.getAttribute("label"))}isNil5(s.labelHtml)&&isNil5(s.label)&&(s.labelHtml=""),this.updatePropertiesObject(s),Ch5AugmentVarSignalsNames.differentiateTmplElemsAttrs(this,this.getAttribute("contractname")||"",parseInt(this.getAttribute("booleanjoinoffset")||"0",10)||0,parseInt(this.getAttribute("numericJoinOffset")||"0",10)||0,parseInt(this.getAttribute("stringJoinOffset")||"0",10)||0),this.logger.stop()}updatePropertiesObject(t){this.logger.start("updatePropertiesObject");const i={updateCssClasses:!1,updateIconDisplay:!1,updateInternalHtml:!1,checkboxDisplay:!1,updateForChangeInCustomCssClass:!1,updateForChangeInStyleCss:!1};(isNil5(t.type)||-1===e.TYPES.indexOf(t.type))&&(t.type=e.TYPES[0]),this._type=t.type,this.previousExtendedProperties.type!==this.type&&(i.updateCssClasses=!0),this._previousIconUrl=this._iconUrl,this._previousIconClass=this._iconClass,isNil5(t.iconUrl)&&(t.iconUrl=""),this._iconUrl=t.iconUrl,isNil5(t.iconClass)&&(t.iconClass=""),this._iconClass=t.iconClass,(this._previousSgIconNumeric!==this.sgIconNumeric||this._previousSgIconString!==this.sgIconString||this.previousExtendedProperties.iconUrl!==this.iconUrl||this.previousExtendedProperties.iconClass!==this.iconClass)&&(i.updateIconDisplay=!0,i.updateInternalHtml=!0),isNil5(t.iconPosition)&&(t.iconPosition=e.ICON_POSITIONS[0]),this._iconPosition=t.iconPosition,this.previousExtendedProperties.iconPosition!==this.iconPosition&&(i.updateCssClasses=!0,i.updateInternalHtml=!0),isNil5(t.checkboxPosition)&&(t.checkboxPosition=e.CHECKBOX_POSITIONS[0]),this._checkboxPosition=t.checkboxPosition,this.previousExtendedProperties.checkboxPosition!==this.checkboxPosition&&(i.checkboxDisplay=!0),isNil5(t.customClass)&&(t.customClass=""),this._customClass=t.customClass,this.previousExtendedProperties.customClass!==this.customClass&&(i.updateForChangeInCustomCssClass=!0),isNil5(t.customStyle)&&(t.customStyle=""),this._customStyle=t.customStyle,this.previousExtendedProperties.customStyle!==this.customStyle&&(i.updateForChangeInStyleCss=!0),(isNil5(t.hAlignLabel)||-1===e.HORIZONTAL_LABEL_ALIGNMENTS.indexOf(t.hAlignLabel))&&(t.hAlignLabel=e.HORIZONTAL_LABEL_ALIGNMENTS[0]),this._hAlignLabel=t.hAlignLabel,this.previousExtendedProperties.hAlignLabel!==this.hAlignLabel&&(i.updateCssClasses=!0),(isNil5(t.vAlignLabel)||-1===e.VERTICAL_LABEL_ALIGNMENTS.indexOf(t.vAlignLabel))&&(t.vAlignLabel=e.VERTICAL_LABEL_ALIGNMENTS[0]),this._vAlignLabel=t.vAlignLabel,this.previousExtendedProperties.vAlignLabel!==this.vAlignLabel&&(i.updateCssClasses=!0),(isNil5(t.iconUrlFillType)||-1===e.ICON_URL_FILL_TYPE.indexOf(t.iconUrlFillType))&&(t.iconUrlFillType=null),this._iconUrlFillType=t.iconUrlFillType,this.previousExtendedProperties.iconUrlFillType!==this.iconUrlFillType&&(i.updateCssClasses=!0),isNil5(t.labelHtml)?isNil5(t.label)||(this._label=t.label,t.labelHtml=t.label,this._elSpanForLabelOnly.textContent=this._label):(this._label=t.labelHtml,t.label=t.labelHtml,this._elSpanForLabelOnly.innerHTML=this._label),this.previousExtendedProperties.labelHtml!==this.label&&this.previousExtendedProperties.label!==this.label&&(i.updateInternalHtml=!0),!0===i.updateCssClasses&&this.updateCssClasses(),!0===i.updateIconDisplay&&this.updateIconDisplay(),!0===i.updateForChangeInCustomCssClass&&this.updateForChangeInCustomCssClass(),!0===i.updateForChangeInStyleCss&&this.updateForChangeInStyleCss(),!0===i.checkboxDisplay&&this.checkboxDisplay(),!0===i.updateInternalHtml&&this.updateInternalHtml(),this.previousExtendedProperties=t,this.logger.stop()}receiveSignalAsString(e,t,i){this.logger.log("set "+t+'("'+i+'")');const s=t.toLowerCase();e.hasAttribute(s)&&e.getAttribute(s)===i||e.setAttribute(s,i);const n=e._ch5ButtonSignal.setSignal(t,i);isNil5(n)||(e._ch5ButtonSignal.getSignal(t).signalState=n.subscribe(i=>{e._ch5ButtonSignal.getSignal(t).currentValue=i,e._ch5ButtonSignal.setVariable(t,i),e.setButtonDisplay()}))}isCheckboxVisible(){return!(!this.hasAttribute("checkboxShow")||!0!==this.toBoolean(this.hasAttribute("checkboxshow")&&"false"!==this.getAttribute("checkboxshow")))}updateInternalHtml(){var t,i,s;if(this.logger.start("updateInternalHtml()"),void 0!==this._elButton.insertBefore&&void 0!==this._elIcon.classList){e.ICON_POSITIONS.forEach(e=>{this.iconPosition===e?(this._elContainer.classList.add(`${this.primaryCssClass}--iconposition-${e}`),this._elIcon.classList.add(`cx-button-icon-pos-${e}`)):(this._elContainer.classList.remove(`${this.primaryCssClass}--iconposition-${e}`),this._elIcon.classList.remove(`cx-button-icon-pos-${e}`))});let n=!1,r=!1,a=!1,l=!1,o=!1,h=!1,c=!1;if((!isNil5(this.iconClass)&&""!==this.iconClass||this.receiveStateIconClass&&""!==this.receiveStateIconClass)&&(n=!0),(!isNil5(this.iconUrl)&&""!==this.iconUrl||this.receiveStateIconUrl&&""!==this.receiveStateIconUrl)&&(a=!0),(!isNil5(this.sgIconNumeric)&&-1!==this.sgIconNumeric||this.receiveStateSGIconNumeric&&""!==this.receiveStateSGIconNumeric)&&(l=!0),(!isNil5(this.sgIconString)&&""!==this.sgIconString||this.receiveStateSGIconString&&""!==this.receiveStateSGIconString)&&(o=!0),c=this.isCheckboxVisible(),(!isNil5(this.label)&&""!==this.label||this.receiveStateLabel&&""!==this.receiveStateLabel||this.receiveStateScriptLabelHtml&&""!==this.receiveStateScriptLabelHtml)&&(r=!0),this.hasAttribute("aria-label")&&""!==this.getAttribute("aria-label")&&(h=!0),this.logger.log("hasIcon",n),this.logger.log("hasLabel",r),this.logger.log("hasImage",a),this.logger.log("hasAriaLabel",h),this.logger.log("hasCheckbox",c),!r&&h&&a){const e=this.getAttribute("aria-label");e&&this._elIcon.setAttribute("alt",e)}o||l?(this._elIcon.classList.remove(this.primaryCssClass+"--icon"),Array.from(e.ICON_URL_FILL_TYPE).forEach(e=>{this._elSpanForLabelIconImg.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e)}),null!==this.iconUrlFillType&&this._elSpanForLabelIconImg.classList.add(this.primaryCssClass+`--icon-url-fill-type-${this.iconUrlFillType}`),this._elIcon.classList.add(this.primaryCssClass+"--img")):a&&this.iconUrl===(null==(t=this._ch5ButtonSignal.getSignal("receiveStateIconUrl"))?void 0:t.currentValue)?(this._elIcon.style.backgroundImage=`url(${this.iconUrl})`,this._elIcon.classList.remove(this.primaryCssClass+"--icon"),Array.from(e.ICON_URL_FILL_TYPE).forEach(e=>{!0===c?this._elSpanForLabelIconImg.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e):this._elButton.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e)}),this._elIcon.classList.add(this.primaryCssClass+"--img"),null!==this.iconUrlFillType&&(!0===c?this._elSpanForLabelIconImg.classList.add(this.primaryCssClass+`--icon-url-fill-type-${this.iconUrlFillType}`):this._elButton.classList.add(this.primaryCssClass+`--icon-url-fill-type-${this.iconUrlFillType}`))):n&&this.iconClass===(null==(i=this._ch5ButtonSignal.getSignal("receiveStateiconClass"))?void 0:i.currentValue)?(this._elIcon.classList.remove(this.primaryCssClass+"--img"),Array.from(e.ICON_URL_FILL_TYPE).forEach(e=>{!0===c?this._elSpanForLabelIconImg.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e):this._elButton.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e)}),this._elIcon.classList.add(this.primaryCssClass+"--icon")):a?(this._elIcon.style.backgroundImage=`url(${this.iconUrl})`,this._elIcon.classList.remove(this.primaryCssClass+"--icon"),Array.from(e.ICON_URL_FILL_TYPE).forEach(e=>{!0===c?this._elSpanForLabelIconImg.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e):this._elButton.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e)}),this._elIcon.classList.add(this.primaryCssClass+"--img"),null!==this.iconUrlFillType&&(!0===c?this._elSpanForLabelIconImg.classList.add(this.primaryCssClass+`--icon-url-fill-type-${this.iconUrlFillType}`):this._elButton.classList.add(this.primaryCssClass+`--icon-url-fill-type-${this.iconUrlFillType}`))):n&&(this._elIcon.classList.remove(this.primaryCssClass+"--img"),Array.from(e.ICON_URL_FILL_TYPE).forEach(e=>{!0===c?this._elSpanForLabelIconImg.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e):this._elButton.classList.remove(this.primaryCssClass+"--icon-url-fill-type-"+e)}),this._elIcon.classList.add(this.primaryCssClass+"--icon")),!0===c?(this._elButton.appendChild(this._elSpanForLabelIconImg),this._elSpanForLabelIconImg.appendChild(this._elSpanForLabelOnly),this._elButton.classList.remove(this.primaryCssClass+"--span"),this._elSpanForLabelIconImg.classList.add(this.primaryCssClass+"--span"),this.updateCssClasses()):(this._elButton.innerHTML="",this._elButton.appendChild(this._elSpanForLabelOnly),null==(s=this._elSpanForLabelIconImg)||s.classList.remove(this.primaryCssClass+"--span"),this._elButton.classList.add(this.primaryCssClass+"--span"),this.updateCssClasses()),r&&(n||a||l||o)?(this.logger.log("Has Label and Icon"),(!1===this._elSpanForLabelOnly.isConnected||this._elIcon.parentNode!==this._elSpanForLabelOnly)&&(!0===c?this._elSpanForLabelIconImg.appendChild(this._elSpanForLabelOnly):this._elButton.appendChild(this._elSpanForLabelOnly)),["last","bottom"].indexOf(this.iconPosition)>=0?this._elIcon.parentNode!==this._elButton?!0===c?this._elSpanForLabelIconImg.appendChild(this._elIcon):this._elButton.appendChild(this._elIcon):!0===c?this._elSpanForLabelIconImg.insertBefore(this._elSpanForLabelOnly,this._elIcon):this._elButton.insertBefore(this._elSpanForLabelOnly,this._elIcon):["first","top"].indexOf(this.iconPosition)>=0&&(this.logger.log("insert icon before label"),!0===this._elSpanForLabelOnly.isConnected&&(!0===c?this._elSpanForLabelIconImg.insertBefore(this._elIcon,this._elSpanForLabelOnly):this._elButton.insertBefore(this._elIcon,this._elSpanForLabelOnly)))):r&&!(n||a||l||o)?(this.logger.log("Has Label Only"),this._elIcon.parentNode&&this._elIcon.remove()):!r&&(n||a||l||o)?(this.logger.log("Has Icon Only"),!0===c?(this._elSpanForLabelIconImg.appendChild(this._elIcon),this._elSpanForLabelOnly.parentNode&&this._elSpanForLabelOnly.remove()):(this._elButton.appendChild(this._elIcon),this._elSpanForLabelOnly.parentNode&&this._elSpanForLabelOnly.remove())):(this.logger.log("No Label and No Icon"),this._elIcon.parentNode&&this._elIcon.remove(),this._elSpanForLabelOnly.parentNode&&this._elSpanForLabelOnly.remove())}this.checkboxDisplay(),this.logger.stop()}updateCssClasses(){var e,t,i,s,n,r;this.logger.start("updateCssClasses()"),super.updateCssClasses();const a=new Set;a.add(this.primaryCssClass),a.add(this.primaryCssClass+"--"+this.shape),a.add(this.primaryCssClass+"--background-image-fill-type-"+this.backgroundImageFillType),!0===this.isButtonInitiated&&a.add(this.primaryCssClass+"--"+this.type),a.add(this.primaryCssClass+"--size-"+this.size),_7.isNil(this.stretch)||a.add(this.primaryCssClass+"--stretch-"+this.stretch),a.add(this.primaryCssClass+"--"+this.orientation);const l=this.getTargetElementForCssClassesAndStyle();if(void 0!==l.classList){this._listOfAllPossibleComponentCssClasses.forEach(e=>{a.has(e)?l.classList.add(e):l.classList.remove(e)});const o=this.primaryCssClass+this.selectedCssClassPostfix;this._selected?(l.classList.add(o),"ch5-tab-button"!==(null==(e=this.buttonListContract)?void 0:e.parentComponent)&&"ch5-button-list"!==(null==(t=this.buttonListContract)?void 0:t.parentComponent)||l.classList.add((null==(i=this.buttonListContract)?void 0:i.parentComponent)+this.selectedCssClassPostfix)):(l.classList.remove(o),"ch5-tab-button"!==(null==(s=this.buttonListContract)?void 0:s.parentComponent)&&"ch5-button-list"!==(null==(n=this.buttonListContract)?void 0:n.parentComponent)||l.classList.remove((null==(r=this.buttonListContract)?void 0:r.parentComponent)+this.selectedCssClassPostfix))}this.verticalOrientationHandler();const o=new Set;o.add(this.primaryCssClass+"--horizontal-"+this.hAlignLabel),o.add(this.primaryCssClass+"--vertical-"+this.vAlignLabel),null!==this.iconUrlFillType&&o.add(this.primaryCssClass+`--icon-url-fill-type-${this.iconUrlFillType}`);const h=[];if(this.hasAttribute("checkboxShow")&&!0===this.toBoolean(this.hasAttribute("checkboxshow")&&"false"!==this.getAttribute("checkboxshow"))){for(let e=0;e<this._listOfAllPossibleComponentCssClasses.length;e++)o.has(this._listOfAllPossibleComponentCssClasses[e])&&h.push(this._listOfAllPossibleComponentCssClasses[e]);this._elSpanForLabelIconImg.className=this.primaryCssClass+"--span "+h.join(" ")}else{for(let e=0;e<this._listOfAllPossibleComponentCssClasses.length;e++)o.has(this._listOfAllPossibleComponentCssClasses[e])&&h.push(this._listOfAllPossibleComponentCssClasses[e]);this._elButton.className=this.BUTTON_PRIMARY_CLASS+" "+this.primaryCssClass+"--span "+h.join(" ")}this.logger.stop()}updateCssClassesForCustomState(){const e=this.getTargetElementForCssClassesAndStyle();if(void 0===e.classList)return;const t=this.customClassState;this._customClassState&&e.classList.add(t)}setSelectionMethods(){this.setButtonDisplay(),this.checkboxDisplay(),this.updateCssClasses()}},Ch5Button=class e extends Ch5ButtonBase{constructor(e){super(e),this.buttonListContractObj=e}buttonListContractObj;static ELEMENT_NAME="ch5-button";static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}};Ch5Button.registerCustomElement(),Ch5Button.registerSignalAttributeTypes(),Ch5Button.registerSignalAttributeDefaults(Ch5Button.ELEMENT_NAME);var Ch5Log=class extends HTMLElement{_id="";_crId="";logger;constructor(){super(),this._crId=Ch5Uid.getUid(),this.logger=new Ch5CommonLog(!1,!1,this._crId)}static get observedAttributes(){return["debug","trace"]}getCrId(){return this._crId}info(e,...t){this.logger.info(e,t)}attributeChangedCallback(e,t,i){if(t!==i)switch(this.info('ch5-common attributeChangedCallback("'+e+'","'+t+'","'+i+')"'),e){case"debug":this.hasAttribute("debug")&&!0===this.toBoolean(this.getAttribute("debug"),!0)?this.logger.isDebugEnabled=!0:this.logger.isDebugEnabled=!1;break;case"trace":this.hasAttribute("trace")&&!0===this.toBoolean(this.getAttribute("trace"),!0)?this.logger.isTraceEnabled=!0:this.logger.isTraceEnabled=!1}}initAttributes(){this.hasAttribute("debug")&&!0===this.toBoolean(this.getAttribute("debug"),!0)?this.logger.isDebugEnabled=!0:this.logger.isDebugEnabled=!1,this.hasAttribute("trace")&&!0===this.toBoolean(this.getAttribute("trace"),!0)?this.logger.isTraceEnabled=!0:this.logger.isTraceEnabled=!1}toBoolean(e,t=!1){switch(String(e).toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1;case"":case null:case void 0:case"null":case"undefined":return!0===t;default:return!1}}};import _8 from"lodash";var COMPONENT_NAME="ch5-button-mode",Ch5ButtonMode=class extends Ch5Log{constructor(e){super(),this.parentButton=e,this.logger.start("constructor()"),_8.isNil(e)?this._parentCh5Button=this.getParentButton():this._parentCh5Button=e,this.logger.stop()}parentButton;static ELEMENT_NAME="ch5-button-mode";_parentCh5Button;set labelInnerHTML(e){const t="labelInnerHTML";this.logger.start("set "+t+'("'+e+'")'),null!==e?this.setAttribute(t.toLowerCase(),e):this.removeAttribute(t),this._parentCh5Button.createButtonLabel(this),this._parentCh5Button.setButtonDisplay(),this.logger.stop()}get labelInnerHTML(){return this.getAttribute("labelinnerhtml")}set iconClass(e){this.validateAndSetAttributeWithStringType("iconClass",e)}get iconClass(){return this.getAttribute("iconclass")}set hAlignLabel(e){this.validateAndSetAttributeWithCustomType("hAlignLabel",Ch5Button.HORIZONTAL_LABEL_ALIGNMENTS,e)}get hAlignLabel(){return this.getAttribute("halignlabel")}set vAlignLabel(e){this.validateAndSetAttributeWithCustomType("vAlignLabel",Ch5Button.VERTICAL_LABEL_ALIGNMENTS,e)}get vAlignLabel(){return this.getAttribute("valignlabel")}set checkboxPosition(e){this.validateAndSetAttributeWithCustomType("checkboxPosition",Ch5Button.CHECKBOX_POSITIONS,e)}get checkboxPosition(){return this.getAttribute("checkboxposition")}set iconPosition(e){this.validateAndSetAttributeWithCustomType("iconPosition",Ch5Button.ICON_POSITIONS,e)}get iconPosition(){return this.getAttribute("iconposition")}set iconUrl(e){this.validateAndSetAttributeWithStringType("iconUrl",e)}get iconUrl(){return this.getAttribute("iconurl")}set type(e){this.logger.log('set type("'+e+'")'),this.validateAndSetAttributeWithCustomType("type",Ch5Button.TYPES,e)}get type(){return this.getAttribute("type")}set customClass(e){this.logger.log('set customClass("'+e+'")'),this.validateAndSetAttributeWithStringType("customClass",e)}get customClass(){return this.getAttribute("customclass")}set customStyle(e){this.validateAndSetAttributeWithStringType("customStyle",e)}get customStyle(){return this.getAttribute("customstyle")}set iconUrlFillType(e){this.validateAndSetAttributeWithCustomType("iconUrlFillType",Ch5Button.ICON_URL_FILL_TYPE,e)}get iconUrlFillType(){return this.getAttribute("iconurlfilltype")}connectedCallback(){if(this.logger.start("connectedCallback()",COMPONENT_NAME),!(this._parentCh5Button instanceof Ch5Button))throw new Error("Invalid parent element for ch5-button-mode.");this.setAttribute("role",Ch5RoleAttributeMapping.ch5ButtonMode),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()",COMPONENT_NAME),this.logger.stop()}static get observedAttributes(){return Ch5Log.observedAttributes.concat(["type","iconclass","halignlabel","valignlabel","checkboxposition","iconposition","iconurl","customclass","customstyle","labelinnerhtml","iconurlfilltype"])}attributeChangedCallback(e,t,i){if(this.logger.start("attributeChangedCallback",COMPONENT_NAME),t!==i)switch(this.logger.log('Ch5ButtonMode.attributeChangedCallback("'+e+'","'+t+'","'+i+')"'),e){case"type":this.hasAttribute("type")?this.type=i:this.type=null;break;case"labelinnerhtml":this.hasAttribute("labelinnerhtml")&&(this.labelInnerHTML=i);break;case"iconclass":this.hasAttribute("iconclass")&&(this.iconClass=i);break;case"customclass":this.hasAttribute("customclass")&&(this.customClass=i);break;case"customstyle":this.hasAttribute("customstyle")&&(this.customStyle=i);break;case"halignlabel":this.hasAttribute("halignlabel")?this.hAlignLabel=i:this.hAlignLabel=null;break;case"valignlabel":this.hasAttribute("valignlabel")?this.vAlignLabel=i:this.vAlignLabel=null;break;case"checkboxposition":this.hasAttribute("checkboxposition")&&(this.checkboxPosition=i);break;case"iconposition":this.hasAttribute("iconposition")&&(this.iconPosition=i);break;case"iconurl":this.hasAttribute("iconurl")&&(this.iconUrl=i);break;case"iconurlfilltype":this.hasAttribute("iconurlfilltype")&&(this.iconUrlFillType=i);break;default:super.attributeChangedCallback(e,t,i)}this.logger.stop()}validateAndSetAttributeWithCustomType(e,t,i){null!==i?t.indexOf(i)>=0?(this.setAttribute(e.toLowerCase(),i),this._parentCh5Button.setButtonDisplay()):this.removeAttribute(e):(this.removeAttribute(e),this._parentCh5Button.setButtonDisplay())}validateAndSetAttributeWithStringType(e,t){null!==t?this.setAttribute(e.toLowerCase(),t):this.removeAttribute(e),this._parentCh5Button.setButtonDisplay()}getParentButton(){const e=t=>_8.isNil(t)||"CH5-BUTTON"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5ButtonMode.ELEMENT_NAME,Ch5ButtonMode);import _9 from"lodash";var Ch5ButtonModeState=class e extends Ch5Log{constructor(e){super(),this.parentButton=e,this.logger.start("constructor"),_9.isNil(e)?this._parentCh5Button=this.getParentButton():this._parentCh5Button=e,this.logger.stop()}parentButton;static ELEMENT_NAME="ch5-button-mode-state";static STATES=["normal","pressed","selected"];_state="normal";_parentCh5Button;set labelInnerHTML(e){const t="labelInnerHTML";this.logger.start("set "+t+'("'+e+'")'),null!==e?this.setAttribute(t.toLowerCase(),e):this.removeAttribute(t),this._parentCh5Button.createButtonLabel(this),this._parentCh5Button.setButtonDisplay(),this.logger.stop()}get labelInnerHTML(){return this.getAttribute("labelinnerhtml")}set state(t){this.logger.log('set state("'+t+'")'),this._state!==t&&(e.STATES.indexOf(t)>=0?this._state=t:this._state=e.STATES[0],this.setAttribute("state",this._state),this._parentCh5Button.setButtonDisplay())}get state(){return this._state}set iconClass(e){this.validateAndSetAttributeWithStringType("iconClass",e)}get iconClass(){return this.getAttribute("iconclass")}set hAlignLabel(e){this.validateAndSetAttributeWithCustomType("hAlignLabel",Ch5Button.HORIZONTAL_LABEL_ALIGNMENTS,e)}get hAlignLabel(){return this.getAttribute("halignlabel")}set vAlignLabel(e){this.validateAndSetAttributeWithCustomType("vAlignLabel",Ch5Button.VERTICAL_LABEL_ALIGNMENTS,e)}get vAlignLabel(){return this.getAttribute("valignlabel")}set checkboxPosition(e){this.validateAndSetAttributeWithCustomType("checkboxPosition",Ch5Button.CHECKBOX_POSITIONS,e)}get checkboxPosition(){return this.getAttribute("checkboxposition")}set iconPosition(e){this.validateAndSetAttributeWithCustomType("iconPosition",Ch5Button.ICON_POSITIONS,e)}get iconPosition(){return this.getAttribute("iconposition")}set iconUrl(e){this.validateAndSetAttributeWithStringType("iconUrl",e)}get iconUrl(){return this.getAttribute("iconurl")}set type(e){this.validateAndSetAttributeWithCustomType("type",Ch5Button.TYPES,e)}get type(){return this.getAttribute("type")}set customClass(e){this.validateAndSetAttributeWithStringType("customClass",e)}get customClass(){return this.getAttribute("customclass")}set customStyle(e){this.validateAndSetAttributeWithStringType("customStyle",e)}get customStyle(){return this.getAttribute("customstyle")}set iconUrlFillType(e){this.validateAndSetAttributeWithCustomType("iconUrlFillType",Ch5Button.ICON_URL_FILL_TYPE,e)}get iconUrlFillType(){return this.getAttribute("iconurlfilltype")}connectedCallback(){if(this.logger.start("connectedCallback"),!(this.parentElement instanceof Ch5ButtonMode))throw new Error("Invalid parent element for ch5-button-mode-state.");if(_9.isNil(this._parentCh5Button))throw new Error("Missing parent ch5-button element for ch5-button-mode-state.");this.setAttribute("role",Ch5RoleAttributeMapping.ch5ButtonModeState),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback"),this.logger.stop()}static get observedAttributes(){return Ch5Log.observedAttributes.concat(["type","iconclass","halignlabel","valignlabel","checkboxposition","iconposition","iconurl","state","customclass","customstyle","labelinnerhtml","iconurlfilltype"])}attributeChangedCallback(e,t,i){if(this.logger.start("attributeChangedCallback"),t!==i)switch(this.logger.log('Ch5ButtonModeState.attributeChangedCallback("'+e+'","'+t+'","'+i+')"'),e){case"type":this.hasAttribute("type")?this.type=i:this.type=null;break;case"labelinnerhtml":this.hasAttribute("labelinnerhtml")&&(this.labelInnerHTML=i);break;case"iconclass":this.hasAttribute("iconclass")&&(this.iconClass=i);break;case"customclass":this.hasAttribute("customclass")&&(this.customClass=i);break;case"customstyle":this.hasAttribute("customstyle")&&(this.customStyle=i);break;case"halignlabel":this.hasAttribute("halignlabel")?this.hAlignLabel=i:this.hAlignLabel=null;break;case"valignlabel":this.hasAttribute("valignlabel")?this.vAlignLabel=i:this.vAlignLabel=null;break;case"checkboxposition":this.hasAttribute("checkboxposition")&&(this.checkboxPosition=i);break;case"iconposition":this.hasAttribute("iconposition")&&(this.iconPosition=i);break;case"iconurl":this.hasAttribute("iconurl")&&(this.iconUrl=i);break;case"state":this.hasAttribute("state")&&(this.state=i);break;case"iconurlfilltype":this.hasAttribute("iconurlfilltype")&&(this.iconUrlFillType=i);break;default:super.attributeChangedCallback(e,t,i)}this.logger.stop()}validateAndSetAttributeWithCustomType(e,t,i,s=!0){this.logger.start("set "+e+'("'+i+'")'),null!==i?t.indexOf(i)>=0?(this.setAttribute(e.toLowerCase(),String(i)),this._parentCh5Button.setButtonDisplay()):!0===s?this.removeAttribute(e):(this.setAttribute(e.toLowerCase(),String(t[0])),this._parentCh5Button.setButtonDisplay()):!0===s?(this.removeAttribute(e),this._parentCh5Button.setButtonDisplay()):(this.setAttribute(e.toLowerCase(),String(t[0])),this._parentCh5Button.setButtonDisplay()),this.logger.stop()}validateAndSetAttributeWithStringType(e,t){this.logger.start("set "+e+'("'+t+'")'),null!==t?this.setAttribute(e.toLowerCase(),t):this.removeAttribute(e),this._parentCh5Button.setButtonDisplay(),this.logger.stop()}getParentButton(){const e=t=>_9.isNil(t)||"CH5-BUTTON"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5ButtonModeState.ELEMENT_NAME,Ch5ButtonModeState);var Ch5ButtonLabel=class e extends Ch5Log{static ELEMENT_NAME="ch5-button-label";constructor(){super()}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,{contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}})}connectedCallback(){if(this.logger.start("connectedCallback"),!(this.parentElement instanceof Ch5Button||this.parentElement instanceof Ch5ButtonMode||this.parentElement instanceof Ch5ButtonModeState))throw new Error("Invalid parent element for ch5-button-label.");this.setAttribute("role",Ch5RoleAttributeMapping.ch5ButtonLabel),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.log("Ch5ButtonLabel.disconnectedCallback()")}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5ButtonLabel.ELEMENT_NAME,Ch5ButtonLabel),Ch5ButtonLabel.registerSignalAttributeTypes();var Ch5ButtonListModeBase=class e extends Ch5Log{static BUTTON_TYPES=["default","danger","text","warning","info","success","primary","secondary"];static BUTTON_HALIGN_LABEL_POSITIONS=["center","left","right"];static BUTTON_VALIGN_LABEL_POSITIONS=["middle","top","bottom"];static BUTTON_CHECKBOX_POSITIONS=["left","right"];static BUTTON_ICON_POSITIONS=["first","last","top","bottom"];static COMPONENT_PROPERTIES=[{default:e.BUTTON_HALIGN_LABEL_POSITIONS[0],enumeratedValues:e.BUTTON_HALIGN_LABEL_POSITIONS,name:"hAlignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_HALIGN_LABEL_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_TYPES[0],enumeratedValues:e.BUTTON_TYPES,name:"type",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_TYPES[0],isObservableProperty:!0},{default:e.BUTTON_VALIGN_LABEL_POSITIONS[0],enumeratedValues:e.BUTTON_VALIGN_LABEL_POSITIONS,name:"vAlignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_VALIGN_LABEL_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_CHECKBOX_POSITIONS[0],enumeratedValues:e.BUTTON_CHECKBOX_POSITIONS,name:"checkboxPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_CHECKBOX_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_ICON_POSITIONS[0],enumeratedValues:e.BUTTON_ICON_POSITIONS,name:"iconPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_ICON_POSITIONS[0],isObservableProperty:!0},{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"customClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"customStyle",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelInnerHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];_ch5Properties;_parentCh5ButtonList=null;set parentComponent(e){this._parentCh5ButtonList=e}get parentComponent(){return this._parentCh5ButtonList}set type(e){this._ch5Properties.set("type",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get type(){return this._ch5Properties.get("type")}set hAlignLabel(e){this._ch5Properties.set("hAlignLabel",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get hAlignLabel(){return this._ch5Properties.get("hAlignLabel")}set vAlignLabel(e){this._ch5Properties.set("vAlignLabel",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get vAlignLabel(){return this._ch5Properties.get("vAlignLabel")}set checkboxPosition(e){this._ch5Properties.set("checkboxPosition",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get checkboxPosition(){return this._ch5Properties.get("checkboxPosition")}set iconPosition(e){this._ch5Properties.set("iconPosition",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconPosition(){return this._ch5Properties.get("iconPosition")}set iconClass(e){this._ch5Properties.set("iconClass",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconClass(){return this._ch5Properties.get("iconClass")}set iconUrl(e){this._ch5Properties.set("iconUrl",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconUrl(){return this._ch5Properties.get("iconUrl")}set customClass(e){this._ch5Properties.set("customClass",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get customClass(){return this._ch5Properties.get("customClass")}set customStyle(e){this._ch5Properties.set("customStyle",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get customStyle(){return this._ch5Properties.get("customStyle")}set labelInnerHTML(e){this._ch5Properties.set("labelInnerHTML",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get labelInnerHTML(){return this._ch5Properties.get("labelInnerHTML")}constructor(){super(),this.logger.start("constructor()"),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}static get observedAttributes(){const t=Ch5Log.observedAttributes;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&t.push(e.COMPONENT_PROPERTIES[i].name.toLowerCase());return t}attributeChangedCallback(t,i,s){if(i!==s){this.logger.log(this.nodeName+' attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()"),this.setAttribute("role",Ch5RoleAttributeMapping.ch5ButtonListMode),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}};import _10 from"lodash";var Ch5ButtonListModeStateBase=class e extends Ch5Log{static STATES=["normal","pressed","selected"];static BUTTON_TYPES=["default","danger","text","warning","info","success","primary","secondary"];static BUTTON_HALIGN_LABEL_POSITIONS=["center","left","right"];static BUTTON_VALIGN_LABEL_POSITIONS=["middle","top","bottom"];static BUTTON_CHECKBOX_POSITIONS=["left","right"];static BUTTON_ICON_POSITIONS=["first","last","top","bottom"];static COMPONENT_PROPERTIES=[{default:e.STATES[0],enumeratedValues:e.STATES,name:"state",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.STATES[0],isObservableProperty:!0},{default:e.BUTTON_TYPES[0],enumeratedValues:e.BUTTON_TYPES,name:"type",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_TYPES[0],isObservableProperty:!0},{default:e.BUTTON_HALIGN_LABEL_POSITIONS[0],enumeratedValues:e.BUTTON_HALIGN_LABEL_POSITIONS,name:"hAlignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_HALIGN_LABEL_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_VALIGN_LABEL_POSITIONS[0],enumeratedValues:e.BUTTON_VALIGN_LABEL_POSITIONS,name:"vAlignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_VALIGN_LABEL_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_CHECKBOX_POSITIONS[0],enumeratedValues:e.BUTTON_CHECKBOX_POSITIONS,name:"checkboxPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_CHECKBOX_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_ICON_POSITIONS[0],enumeratedValues:e.BUTTON_ICON_POSITIONS,name:"iconPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_ICON_POSITIONS[0],isObservableProperty:!0},{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"customClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"customStyle",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelInnerHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];_ch5Properties;_parentCh5ButtonList=null;set parentComponent(e){this._parentCh5ButtonList=e}get parentComponent(){return this._parentCh5ButtonList}set state(e){this._ch5Properties.set("state",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get state(){return this._ch5Properties.get("state")}set type(e){this._ch5Properties.set("type",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get type(){return this._ch5Properties.get("type")}set hAlignLabel(e){this._ch5Properties.set("hAlignLabel",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get hAlignLabel(){return this._ch5Properties.get("hAlignLabel")}set vAlignLabel(e){this._ch5Properties.set("vAlignLabel",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get vAlignLabel(){return this._ch5Properties.get("vAlignLabel")}set checkboxPosition(e){this._ch5Properties.set("checkboxPosition",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get checkboxPosition(){return this._ch5Properties.get("checkboxPosition")}set iconPosition(e){this._ch5Properties.set("iconPosition",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconPosition(){return this._ch5Properties.get("iconPosition")}set iconClass(e){this._ch5Properties.set("iconClass",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconClass(){return this._ch5Properties.get("iconClass")}set iconUrl(e){this._ch5Properties.set("iconUrl",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconUrl(){return this._ch5Properties.get("iconUrl")}set customClass(e){this._ch5Properties.set("customClass",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get customClass(){return this._ch5Properties.get("customClass")}set customStyle(e){this._ch5Properties.set("customStyle",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get customStyle(){return this._ch5Properties.get("customStyle")}set labelInnerHTML(e){this._ch5Properties.set("labelInnerHTML",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get labelInnerHTML(){return this._ch5Properties.get("labelInnerHTML")}constructor(){super(),this.logger.start("constructor()"),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this._parentCh5ButtonList=this.getParentButton(),this.logger.stop()}static get observedAttributes(){const t=Ch5Log.observedAttributes;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&t.push(e.COMPONENT_PROPERTIES[i].name.toLowerCase());return t}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback"),i!==s){this.logger.log('attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5ButtonListModeState),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}getParentButton(){const e=t=>_10.isNil(t)||"CH5-BUTTON-LIST"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}};import _11 from"lodash";var Ch5ButtonListBase=class e extends Ch5Common{static SCROLLBAR_CLASSLIST_PREFIX="--scrollbar-";static CENTER_ITEMS_CLASSLIST_PREFIX="--center-items-";static BUTTON_CONTAINER_BUFFER=4;static MODES_MAX_COUNT=5;static ORIENTATION=["horizontal","vertical"];static LOAD_ITEMS=["visible-only","load-new","all"];static STRETCH=["both"];static CONTRACT_ITEM_LABEL_TYPE=["none","textContent","innerHTML"];static CONTRACT_ITEM_ICON_TYPE=["none","iconClass","url","sgStateName","sgStateNumber"];static BUTTON_TYPES=["default","danger","text","warning","info","success","primary","secondary"];static BUTTON_HALIGN_LABEL_POSITIONS=["center","left","right"];static BUTTON_VALIGN_LABEL_POSITIONS=["middle","top","bottom"];static BUTTON_CHECKBOX_POSITIONS=["left","right"];static BUTTON_ICON_POSITIONS=["first","last","top","bottom"];static BUTTON_SHAPES=["rounded-rectangle","rectangle"];static BUTTON_ICON_URL_FILL_TYPE=["stretch","stretch-aspect","center","tile","initial"];static SG_ICON_THEME=["icons-lg","icons-sm","media-transports-accents","media-transports-light","media-transports-dark"];static COMPONENT_DATA={ORIENTATION:{default:e.ORIENTATION[0],values:e.ORIENTATION,key:"orientation",attribute:"orientation",classListPrefix:"--orientation-"},LOAD_ITEMS:{default:e.LOAD_ITEMS[0],values:e.LOAD_ITEMS,key:"loadItems",attribute:"loadItems",classListPrefix:"--load-items-"},STRETCH:{default:e.STRETCH[0],values:e.STRETCH,key:"stretch",attribute:"stretch",classListPrefix:"--stretch-"},BUTTON_TYPE:{default:e.BUTTON_TYPES[0],values:e.BUTTON_TYPES,key:"buttonType",attribute:"buttonType",classListPrefix:"--button-type-"},BUTTON_HALIGN_LABEL:{default:e.BUTTON_HALIGN_LABEL_POSITIONS[0],values:e.BUTTON_HALIGN_LABEL_POSITIONS,key:"buttonHAlignLabel",attribute:"buttonHAlignLabel",classListPrefix:"--button-halign-label-"},BUTTON_VALIGN_LABEL:{default:e.BUTTON_VALIGN_LABEL_POSITIONS[0],values:e.BUTTON_VALIGN_LABEL_POSITIONS,key:"buttonVAlignLabel",attribute:"buttonVAlignLabel",classListPrefix:"--button-valign-label-"},BUTTON_CHECKBOX_POSITION:{default:e.BUTTON_CHECKBOX_POSITIONS[0],values:e.BUTTON_CHECKBOX_POSITIONS,key:"buttonCheckboxPosition",attribute:"buttonCheckboxPosition",classListPrefix:"--button-checkbox-position-"},BUTTON_ICON_POSITION:{default:e.BUTTON_ICON_POSITIONS[0],values:e.BUTTON_ICON_POSITIONS,key:"buttonIconPosition",attribute:"buttonIconPosition",classListPrefix:"--button-icon-position-"},BUTTON_SHAPE:{default:e.BUTTON_SHAPES[0],values:e.BUTTON_SHAPES,key:"buttonShape",attribute:"buttonShape",classListPrefix:"--button-shape-"},BUTTON_ICON_URL_FILL_TYPE:{default:e.BUTTON_ICON_URL_FILL_TYPE[0],values:e.BUTTON_ICON_URL_FILL_TYPE,key:"buttonIconUrlFillType",attribute:"buttonIconUrlFillType",classListPrefix:"--button-icon-url-fill-type-"},CONTRACT_ITEM_LABEL_TYPE:{default:e.CONTRACT_ITEM_LABEL_TYPE[0],values:e.CONTRACT_ITEM_LABEL_TYPE,key:"contractItemLabelType",attribute:"contractItemLabelType",classListPrefix:"ch5-general--contract-item-label-type-"},CONTRACT_ITEM_ICON_TYPE:{default:e.CONTRACT_ITEM_ICON_TYPE[0],values:e.CONTRACT_ITEM_ICON_TYPE,key:"contractItemIconType",attribute:"contractItemIconType",classListPrefix:"ch5-general--contract-item-icon-type-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receiveStateNumberOfItems:{direction:"state",numericJoin:1,contractName:!0},receiveStateScrollToPosition:{direction:"state",numericJoin:1,contractName:!0},receivestateselectedbutton:{direction:"state",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:e.ORIENTATION[0],enumeratedValues:e.ORIENTATION,name:"orientation",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ORIENTATION[0],isObservableProperty:!0},{default:e.LOAD_ITEMS[0],enumeratedValues:e.LOAD_ITEMS,name:"loadItems",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.LOAD_ITEMS[0],isObservableProperty:!0},{default:!1,name:"scrollbar",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"centerItems",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:null,enumeratedValues:e.STRETCH,name:"stretch",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:!1,name:"endless",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:1,name:"rows",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:1,numberProperties:{min:1,max:500,conditionalMin:1,conditionalMax:500,conditionalMinValue:1,conditionalMaxValue:500},isObservableProperty:!0},{default:1,name:"columns",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:1,numberProperties:{min:1,max:500,conditionalMin:1,conditionalMax:500,conditionalMinValue:1,conditionalMaxValue:500},isObservableProperty:!0},{default:"",name:"indexId",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:10,name:"numberOfItems",removeAttributeOnNull:!0,nameForSignal:"receiveStateNumberOfItems",type:"number",valueOnAttributeEmpty:10,numberProperties:{min:1,max:500,conditionalMin:1,conditionalMax:500,conditionalMinValue:1,conditionalMaxValue:500},isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateNumberOfItems",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:0,name:"scrollToPosition",removeAttributeOnNull:!0,nameForSignal:"receiveStateScrollToPosition",type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:499,conditionalMin:0,conditionalMax:499,conditionalMinValue:0,conditionalMaxValue:499},isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateScrollToPosition",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSelectedButton",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"contractName",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"useContractForEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForItemEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForItemShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomStyle",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomClass",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForEachButtonSelection",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.CONTRACT_ITEM_LABEL_TYPE[0],enumeratedValues:e.CONTRACT_ITEM_LABEL_TYPE,name:"contractItemLabelType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.CONTRACT_ITEM_LABEL_TYPE[0],isObservableProperty:!0},{default:e.CONTRACT_ITEM_ICON_TYPE[0],enumeratedValues:e.CONTRACT_ITEM_ICON_TYPE,name:"contractItemIconType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.CONTRACT_ITEM_ICON_TYPE[0],isObservableProperty:!0},{default:!1,name:"useContractForNumItems",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.BUTTON_TYPES[0],enumeratedValues:e.BUTTON_TYPES,name:"buttonType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_TYPES[0],isObservableProperty:!0},{default:e.BUTTON_HALIGN_LABEL_POSITIONS[0],enumeratedValues:e.BUTTON_HALIGN_LABEL_POSITIONS,name:"buttonHAlignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_HALIGN_LABEL_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_VALIGN_LABEL_POSITIONS[0],enumeratedValues:e.BUTTON_VALIGN_LABEL_POSITIONS,name:"buttonVAlignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_VALIGN_LABEL_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_CHECKBOX_POSITIONS[0],enumeratedValues:e.BUTTON_CHECKBOX_POSITIONS,name:"buttonCheckboxPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_CHECKBOX_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_ICON_POSITIONS[0],enumeratedValues:e.BUTTON_ICON_POSITIONS,name:"buttonIconPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_ICON_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_SHAPES[0],enumeratedValues:e.BUTTON_SHAPES,name:"buttonShape",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_SHAPES[0],isObservableProperty:!0},{default:null,enumeratedValues:e.BUTTON_ICON_URL_FILL_TYPE,name:"buttonIconUrlFillType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:e.SG_ICON_THEME[0],enumeratedValues:e.SG_ICON_THEME,name:"buttonSgIconTheme",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SG_ICON_THEME[0],isObservableProperty:!0},{default:!1,name:"buttonCheckboxShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"buttonSelected",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"buttonPressed",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:0,name:"buttonMode",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:4,conditionalMin:0,conditionalMax:4,conditionalMinValue:0,conditionalMaxValue:0},isObservableProperty:!0},{default:"",name:"buttonIconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonIconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonLabelInnerHtml",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateMode",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateSelected",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateLabel",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateScriptLabelHtml",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateIconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateIconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateSGIconNumeric",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateSGIconString",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonSendEventOnClick",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateShow",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateEnable",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:1500,name:"clickHoldTime",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:12e4,conditionalMin:0,conditionalMax:12e4,conditionalMinValue:0,conditionalMaxValue:12e4},isObservableProperty:!0}];primaryCssClass="";_ch5Properties;_elContainer={};_scrollbarContainer={};_scrollbar={};isDown=!1;startX=0;startY=0;scrollListLeft=0;scrollListTop=0;scrollbarDimension=0;buttonWidth=0;buttonHeight=0;signalNameOnContract={contractName:"",receiveStateCustomClass:"",receiveStateCustomStyle:"",receiveStateEnable:"",receiveStateShow:"",receiveStateScrollToPosition:"",receiveStateNumberOfItems:"",receiveStateSelectedButton:""};rowClassValue=1;columnClassValue=1;selectedButton=0;showSignalHolder=[];loadButtonForShow=!1;allButtonsVisible=!1;debounceButtonDisplay=this.debounce((e=!1)=>{"visible-only"===this.loadItems?this.buttonDisplay(e):"load-new"===this.loadItems?this.buttonDisplayForLoadItemsNew(e):this.buttonDisplayForLoadItemsAll(e)},100);debounceButtonShow=this.debounce(()=>{this.buttonShow()},150);set orientation(e){this._ch5Properties.set("orientation",e,()=>{this.handleOrientation()})}get orientation(){return this._ch5Properties.get("orientation")}set loadItems(e){this._ch5Properties.set("loadItems",e,()=>{this.debounceButtonDisplay()})}get loadItems(){return this._ch5Properties.get("loadItems")}set scrollbar(e){this._ch5Properties.set("scrollbar",e,()=>{this.handleScrollbar()})}get scrollbar(){return this._ch5Properties.get("scrollbar")}set centerItems(e){this._ch5Properties.set("centerItems",e,()=>{this.handleCenterItems()})}get centerItems(){return this._ch5Properties.get("centerItems")}set stretch(e){this._ch5Properties.set("stretch",e,()=>{this.handleStretch()})}get stretch(){return this._ch5Properties.get("stretch")}set buttonIconUrlFillType(e){this._ch5Properties.set("buttonIconUrlFillType",e,()=>{this.debounceButtonDisplay()})}get buttonIconUrlFillType(){return this._ch5Properties.get("buttonIconUrlFillType")}set endless(e){this._ch5Properties.set("endless",e,()=>{this.handleEndless()})}get endless(){return this._ch5Properties.get("endless")}set numberOfItems(e){this._ch5Properties.set("numberOfItems",e,()=>{this.handleRowsAndColumn()})}get numberOfItems(){return this._ch5Properties.get("numberOfItems")}set rows(e){this._ch5Properties.set("rows",e,()=>{this.handleRowsAndColumn()})}get rows(){return this._ch5Properties.get("rows")}set columns(e){this._ch5Properties.set("columns",e,()=>{this.handleRowsAndColumn()})}get columns(){return this._ch5Properties.get("columns")}set indexId(e){this._ch5Properties.set("indexId",e)}get indexId(){return this._ch5Properties.get("indexId")}set receiveStateNumberOfItems(e){this._ch5Properties.set("receiveStateNumberOfItems",e,null,e=>{this._ch5Properties.setForSignalResponse("numberOfItems",e,()=>{this.handleRowsAndColumn()})})}get receiveStateNumberOfItems(){return this._ch5Properties.get("receiveStateNumberOfItems")}set scrollToPosition(e){this._ch5Properties.set("scrollToPosition",e,()=>{const e=this.scrollToPosition<this.numberOfItems&&this.scrollToPosition>=0,t="horizontal"===this.orientation&&1===this.rows||"vertical"===this.orientation&&1===this.columns;e&&t&&this.debounceButtonDisplay(!0)})}get scrollToPosition(){return this._ch5Properties.get("scrollToPosition")}set receiveStateScrollToPosition(e){this._ch5Properties.set("receiveStateScrollToPosition",e,null,e=>{this._ch5Properties.setForSignalResponse("scrollToPosition",e,()=>{const e=this.scrollToPosition<this.numberOfItems&&this.scrollToPosition>=0,t="horizontal"===this.orientation&&1===this.rows||"vertical"===this.orientation&&1===this.columns;e&&t&&this.debounceButtonDisplay(!0)})})}get receiveStateScrollToPosition(){return this._ch5Properties.get("receiveStateScrollToPosition")}set receiveStateSelectedButton(e){this._ch5Properties.set("receiveStateSelectedButton",e,null,e=>{const t=""===this.contractName,i=""!==this.contractName&&!0===this.useContractForEachButtonSelection&&this.receiveStateSelectedButton===this.contractName+".ItemSelected";(t||i)&&(this.selectedButton=e,this.handleReceiveStateSelectedButton())})}get receiveStateSelectedButton(){return this._ch5Properties.get("receiveStateSelectedButton")}set contractName(e){this._ch5Properties.set("contractName",e,()=>{this.handleContractName()})}get contractName(){return this._ch5Properties.get("contractName")}set useContractForEnable(e){this._ch5Properties.set("useContractForEnable",e,()=>{this.debounceButtonDisplay()})}get useContractForEnable(){return this._ch5Properties.get("useContractForEnable")}set useContractForShow(e){this._ch5Properties.set("useContractForShow",e,()=>{this.debounceButtonDisplay()})}get useContractForShow(){return this._ch5Properties.get("useContractForShow")}set useContractForItemEnable(e){this._ch5Properties.set("useContractForItemEnable",e,()=>{this.debounceButtonDisplay()})}get useContractForItemEnable(){return this._ch5Properties.get("useContractForItemEnable")}set useContractForItemShow(e){this._ch5Properties.set("useContractForItemShow",e,()=>{this.debounceButtonDisplay()})}get useContractForItemShow(){return this._ch5Properties.get("useContractForItemShow")}set useContractForCustomStyle(e){this._ch5Properties.set("useContractForCustomStyle",e,()=>{this.debounceButtonDisplay()})}get useContractForCustomStyle(){return this._ch5Properties.get("useContractForCustomStyle")}set useContractForCustomClass(e){this._ch5Properties.set("useContractForCustomClass",e,()=>{this.debounceButtonDisplay()})}get useContractForCustomClass(){return this._ch5Properties.get("useContractForCustomClass")}set useContractForEachButtonSelection(e){this._ch5Properties.set("useContractForEachButtonSelection",e,()=>{this.debounceButtonDisplay()})}get useContractForEachButtonSelection(){return this._ch5Properties.get("useContractForEachButtonSelection")}set contractItemLabelType(e){this._ch5Properties.set("contractItemLabelType",e,()=>{this.debounceButtonDisplay()})}get contractItemLabelType(){return this._ch5Properties.get("contractItemLabelType")}set contractItemIconType(e){this._ch5Properties.set("contractItemIconType",e,()=>{this.debounceButtonDisplay()})}get contractItemIconType(){return this._ch5Properties.get("contractItemIconType")}set useContractForNumItems(e){this._ch5Properties.set("useContractForNumItems",e,()=>{this.debounceButtonDisplay()})}get useContractForNumItems(){return this._ch5Properties.get("useContractForNumItems")}set buttonType(e){this._ch5Properties.set("buttonType",e,()=>{this.debounceButtonDisplay()})}get buttonType(){return this._ch5Properties.get("buttonType")}set buttonHAlignLabel(e){this._ch5Properties.set("buttonHAlignLabel",e,()=>{this.debounceButtonDisplay()})}get buttonHAlignLabel(){return this._ch5Properties.get("buttonHAlignLabel")}set buttonVAlignLabel(e){this._ch5Properties.set("buttonVAlignLabel",e,()=>{this.debounceButtonDisplay()})}get buttonVAlignLabel(){return this._ch5Properties.get("buttonVAlignLabel")}set buttonCheckboxPosition(e){this._ch5Properties.set("buttonCheckboxPosition",e,()=>{this.debounceButtonDisplay()})}get buttonCheckboxPosition(){return this._ch5Properties.get("buttonCheckboxPosition")}set buttonIconPosition(e){this._ch5Properties.set("buttonIconPosition",e,()=>{this.debounceButtonDisplay()})}get buttonIconPosition(){return this._ch5Properties.get("buttonIconPosition")}set buttonShape(e){this._ch5Properties.set("buttonShape",e,()=>{this.debounceButtonDisplay()})}get buttonShape(){return this._ch5Properties.get("buttonShape")}set buttonCheckboxShow(e){this._ch5Properties.set("buttonCheckboxShow",e,()=>{this.debounceButtonDisplay()})}get buttonCheckboxShow(){return this._ch5Properties.get("buttonCheckboxShow")}set buttonSelected(e){this._ch5Properties.set("buttonSelected",e,()=>{this.debounceButtonDisplay()})}get buttonSelected(){return this._ch5Properties.get("buttonSelected")}set buttonPressed(e){this._ch5Properties.set("buttonPressed",e,()=>{this.debounceButtonDisplay()})}get buttonPressed(){return this._ch5Properties.get("buttonPressed")}set buttonMode(e){this._ch5Properties.set("buttonMode",e,()=>{this.debounceButtonDisplay()})}get buttonMode(){return+this._ch5Properties.get("buttonMode")}set buttonIconClass(e){this._ch5Properties.set("buttonIconClass",e,()=>{this.debounceButtonDisplay()})}get buttonIconClass(){return this._ch5Properties.get("buttonIconClass")}set buttonIconUrl(e){this._ch5Properties.set("buttonIconUrl",e,()=>{this.debounceButtonDisplay()})}get buttonIconUrl(){return this._ch5Properties.get("buttonIconUrl")}set buttonLabelInnerHtml(e){this._ch5Properties.set("buttonLabelInnerHtml",e,()=>{this.debounceButtonDisplay()})}get buttonLabelInnerHtml(){return this._ch5Properties.get("buttonLabelInnerHtml")}set buttonReceiveStateMode(e){this._ch5Properties.set("buttonReceiveStateMode",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateMode(){return this._ch5Properties.get("buttonReceiveStateMode")}set buttonReceiveStateSelected(e){this._ch5Properties.set("buttonReceiveStateSelected",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateSelected(){return this._ch5Properties.get("buttonReceiveStateSelected")}set buttonReceiveStateLabel(e){this._ch5Properties.set("buttonReceiveStateLabel",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateLabel(){return this._ch5Properties.get("buttonReceiveStateLabel")}set buttonReceiveStateScriptLabelHtml(e){this._ch5Properties.set("buttonReceiveStateScriptLabelHtml",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateScriptLabelHtml(){return this._ch5Properties.get("buttonReceiveStateScriptLabelHtml")}set buttonReceiveStateIconClass(e){this._ch5Properties.set("buttonReceiveStateIconClass",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateIconClass(){return this._ch5Properties.get("buttonReceiveStateIconClass")}set buttonReceiveStateIconUrl(e){this._ch5Properties.set("buttonReceiveStateIconUrl",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateIconUrl(){return this._ch5Properties.get("buttonReceiveStateIconUrl")}set buttonReceiveStateSGIconString(e){this._ch5Properties.set("buttonReceiveStateSGIconString",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateSGIconString(){return this._ch5Properties.get("buttonReceiveStateSGIconString")}set buttonReceiveStateSGIconNumeric(e){this._ch5Properties.set("buttonReceiveStateSGIconNumeric",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateSGIconNumeric(){return this._ch5Properties.get("buttonReceiveStateSGIconNumeric")}set buttonSgIconTheme(e){this._ch5Properties.set("buttonSgIconTheme",e,()=>{this.debounceButtonDisplay()})}get buttonSgIconTheme(){return this._ch5Properties.get("buttonSgIconTheme")}set buttonSendEventOnClick(e){this._ch5Properties.set("buttonSendEventOnClick",e,()=>{this.debounceButtonDisplay()})}get buttonSendEventOnClick(){return this._ch5Properties.get("buttonSendEventOnClick")}set buttonReceiveStateShow(e){this._ch5Properties.set("buttonReceiveStateShow",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateShow(){return this._ch5Properties.get("buttonReceiveStateShow")}set buttonReceiveStateEnable(e){this._ch5Properties.set("buttonReceiveStateEnable",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateEnable(){return this._ch5Properties.get("buttonReceiveStateEnable")}set clickHoldTime(e){this._ch5Properties.set("clickHoldTime",e,()=>{this.debounceButtonDisplay()})}get clickHoldTime(){return this._ch5Properties.get("clickHoldTime")}constructor(){super(),this.ignoreAttributes=["receivestatehidepulse","receivestateshowpulse","sendeventonshow"],this.logger.start("constructor()"),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.initCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.nodeName),i!==s){this.logger.log('attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5ButtonList),this.checkInternalHTML(),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.debounceButtonDisplay(),resizeObserver(this._elContainer,this.resizeHandler),customElements.whenDefined(this.nodeName.toLowerCase()).then(()=>{this.componentLoadedEvent(this.nodeName.toLowerCase(),this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.showSignalHolder.forEach(e=>this.clearOldSubscription(e.signalValue,e.signalState)),this.showSignalHolder=[],this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._scrollbarContainer=document.createElement("div"),this._scrollbar=document.createElement("div"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),this._elContainer.addEventListener("mousedown",this.handleMouseDown),this._elContainer.addEventListener("mouseleave",this.handleMouseUpAndLeave),this._elContainer.addEventListener("mouseup",this.handleMouseUpAndLeave),this._elContainer.addEventListener("mousemove",this.handleMouseMove),this._elContainer.addEventListener("scroll",this.handleScrollEvent)}removeEventListeners(){super.removeEventListeners(),this._elContainer.removeEventListener("mouseleave",this.handleMouseUpAndLeave),this._elContainer.removeEventListener("mouseup",this.handleMouseUpAndLeave),this._elContainer.removeEventListener("mousedown",this.handleMouseDown),this._elContainer.removeEventListener("mousemove",this.handleMouseMove),this._elContainer.removeEventListener("scroll",this.handleScrollEvent)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}handleMouseDown=e=>{this.isDown=!0,this._elContainer.classList.add("active"),this.startX=e.pageX-this._elContainer.offsetLeft,this.startY=e.pageY-this._elContainer.offsetTop,this.scrollListLeft=this._elContainer.scrollLeft,this.scrollListTop=this._elContainer.scrollTop};handleMouseUpAndLeave=this.debounce(()=>{this.isDown=!1,this._elContainer.classList.remove("active")},10);handleMouseMove=this.debounce(e=>{if(!this.isDown)return;e.preventDefault();const t=e.pageX-this._elContainer.offsetLeft,i=e.pageY-this._elContainer.offsetTop,s=3*(t-this.startX),n=3*(i-this.startY);this._elContainer.scrollLeft=this.scrollListLeft-s,this._elContainer.scrollTop=this.scrollListTop-n},10);handleScrollEvent=()=>{if(this.initScrollbar(),this.endless)return"all"===this.loadItems?(this.buttonWidth=this._elContainer.children[0].getBoundingClientRect().width,this.buttonHeight=this._elContainer.children[0].getBoundingClientRect().height,this.endlessHelper()):"load-new"===this.loadItems?this.endlessHelperForNew():this.endlessHelper();"visible-only"===this.loadItems?this.scrollHelper():"load-new"===this.loadItems&&this.scrollHelperForNew()};scrollHelperForNew(){var e,t,i;if("rtl"===this.dir&&"horizontal"===this.orientation){const{offsetWidth:t,scrollLeft:i,scrollWidth:s}=this._elContainer;if(s-t<this.buttonWidth)return;let n=this.getLastChild();if(Math.abs(i)+t>s-this.buttonWidth&&n!==this.numberOfItems-1){for(let t=0;t<this.rows;t++)if(this.createButton(++n),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let t=n;for(;t<this.numberOfItems&&!1===(null==(e=this.showSignalHolder[t])?void 0:e.value);)this.createButton(++t)}this.initScrollbar()}}else if("horizontal"===this.orientation){const{offsetWidth:e,scrollLeft:i,scrollWidth:s}=this._elContainer;if(s-e<this.buttonWidth)return;let n=this.getLastChild();if(i+e>s-this.buttonWidth&&n!==this.numberOfItems-1){for(let e=0;e<this.rows;e++)if(n+1<this.numberOfItems&&(this.createButton(++n),!0===this.loadButtonForShow&&!1===this.allButtonsVisible)){let e=n;for(;e<this.numberOfItems&&!1===(null==(t=this.showSignalHolder[e])?void 0:t.value);)this.createButton(++e)}this.initScrollbar()}}else{const{offsetHeight:e,scrollTop:t,scrollHeight:s}=this._elContainer;if(s-e<this.buttonHeight)return;let n=this.getLastChild();if(t+e>s-this.buttonHeight&&n!==this.numberOfItems-1){for(let e=0;e<this.columns;e++)if(n+1<this.numberOfItems&&(this.createButton(++n),!0===this.loadButtonForShow&&!1===this.allButtonsVisible)){let e=n;for(;e<this.numberOfItems&&!1===(null==(i=this.showSignalHolder[e])?void 0:i.value);)this.createButton(++e)}this.initScrollbar()}}}scrollHelper(){var e,t,i,s,n,r,a,l,o,h,c,u,d,m,g;if("rtl"===this.dir&&"horizontal"===this.orientation){const{offsetWidth:r,scrollLeft:a,scrollWidth:l}=this._elContainer;if(l-r<this.buttonWidth)return;let o=this.getFirstChild(),h=this.getLastChild();if(Math.abs(a)+r>l-this.buttonWidth&&h!==this.numberOfItems-1){for(let i=0;i<this.rows;i++){if(this.createButton(++h),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let t=h;for(;t<this.numberOfItems&&!1===(null==(e=this.showSignalHolder[t])?void 0:e.value);)this.createButton(++t)}null==(t=this._elContainer.firstElementChild)||t.remove()}this._elContainer.scrollLeft+=this.buttonWidth}else if(Math.abs(a)<this.buttonWidth&&0!==o){let e=(h+1)%this.rows;for(let t=0;t<this.rows;t++){if(this.createButton(--o,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=o;for(;e>0&&!1===(null==(i=this.showSignalHolder[e])?void 0:i.value);)this.createButton(--e,!1)}(h+1)%this.rows!==0?e-- >0&&(null==(s=this._elContainer.lastElementChild)||s.remove()):null==(n=this._elContainer.lastElementChild)||n.remove()}this._elContainer.scrollLeft-=this.buttonWidth}}else if("horizontal"===this.orientation){const{offsetWidth:e,scrollLeft:t,scrollWidth:i}=this._elContainer;if(i-e<this.buttonWidth)return;let s=this.getFirstChild(),n=this.getLastChild();if(t<this.buttonWidth&&0!==s){let e=(n+1)%this.rows;for(let t=0;t<this.rows;t++){if(this.createButton(--s,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=s;for(;e>0&&!1===(null==(r=this.showSignalHolder[e])?void 0:r.value);)this.createButton(--e,!1)}(n+1)%this.rows!==0?e-- >0&&(null==(a=this._elContainer.lastElementChild)||a.remove()):null==(l=this._elContainer.lastElementChild)||l.remove()}this._elContainer.scrollLeft+=this.buttonWidth}else if(t+e>i-this.buttonWidth&&n!==this.numberOfItems-1){for(let e=0;e<this.rows;e++){if(n+1<this.numberOfItems&&(this.createButton(++n),!0===this.loadButtonForShow&&!1===this.allButtonsVisible)){let e=n;for(;e<this.numberOfItems&&!1===(null==(o=this.showSignalHolder[e])?void 0:o.value);)this.createButton(++e)}null==(h=this._elContainer.firstElementChild)||h.remove()}this._elContainer.scrollLeft-=this.buttonWidth}}else{const{offsetHeight:e,scrollTop:t,scrollHeight:i}=this._elContainer;if(i-e<this.buttonHeight)return;let s=this.getFirstChild(),n=this.getLastChild();if(t<this.buttonHeight&&0!==s){let e=(n+1)%this.columns;for(let t=0;t<this.columns;t++){if(this.createButton(--s,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=s;for(;e>0&&!1===(null==(c=this.showSignalHolder[e])?void 0:c.value);)this.createButton(--e,!1)}(n+1)%this.columns!==0?e-- >0&&(null==(u=this._elContainer.lastElementChild)||u.remove()):null==(d=this._elContainer.lastElementChild)||d.remove()}this._elContainer.scrollTop+=this.buttonHeight}else if(t+e>i-this.buttonHeight&&n!==this.numberOfItems-1){for(let e=0;e<this.columns;e++){if(n+1<this.numberOfItems&&(this.createButton(++n),!0===this.loadButtonForShow&&!1===this.allButtonsVisible)){let e=n;for(;e<this.numberOfItems&&!1===(null==(m=this.showSignalHolder[e])?void 0:m.value);)this.createButton(++e)}null==(g=this._elContainer.firstElementChild)||g.remove()}this._elContainer.scrollTop-=this.buttonHeight}}}endlessHelper(){var e,t,i,s,n,r,a,l,o,h,c,u;const{offsetHeight:d,offsetWidth:m,scrollLeft:g,scrollTop:b,scrollWidth:p,scrollHeight:_}=this._elContainer;if(!1!==("horizontal"===this.orientation?m+this.buttonWidth<p:d+this.buttonHeight<_))if("horizontal"===this.orientation&&"rtl"===this.dir){if(Math.abs(g)+m>p-this.buttonWidth/4){const i=this.getLastChild(),s=(this.numberOfItems+i+1)%this.numberOfItems;if(this.createButton(s),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let t=s;for(;t<this.numberOfItems&&!1===(null==(e=this.showSignalHolder[t])?void 0:e.value);)this.createButton(++t)}null==(t=this._elContainer.firstElementChild)||t.remove(),this._elContainer.scrollLeft+=this.buttonWidth/2}else if(Math.abs(g)<this.buttonWidth/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createButton(t,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e>0&&!1===(null==(i=this.showSignalHolder[e])?void 0:i.value);)this.createButton(--e,!1)}null==(s=this._elContainer.lastElementChild)||s.remove(),this._elContainer.scrollLeft-=this.buttonWidth/2}}else if("horizontal"===this.orientation){if(g<this.buttonWidth/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createButton(t,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e>0&&!1===(null==(n=this.showSignalHolder[e])?void 0:n.value);)this.createButton(--e,!1)}null==(r=this._elContainer.lastElementChild)||r.remove(),this._elContainer.scrollLeft+=this.buttonWidth/2}else if(g+m>p-this.buttonWidth/4){const e=this.getLastChild(),t=(this.numberOfItems+e+1)%this.numberOfItems;if(this.createButton(t),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e<this.numberOfItems&&!1===(null==(a=this.showSignalHolder[e])?void 0:a.value);)this.createButton(++e)}null==(l=this._elContainer.firstElementChild)||l.remove(),this._elContainer.scrollLeft-=this.buttonWidth/2}}else if(b<this.buttonHeight/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createButton(t,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e>0&&!1===(null==(o=this.showSignalHolder[e])?void 0:o.value);)this.createButton(--e,!1)}null==(h=this._elContainer.lastElementChild)||h.remove(),this._elContainer.scrollTop+=this.buttonHeight/2}else if(b+d>_-this.buttonHeight/4){const e=this.getLastChild(),t=(this.numberOfItems+e+1)%this.numberOfItems;if(this.createButton(t),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e<this.numberOfItems&&!1===(null==(c=this.showSignalHolder[e])?void 0:c.value);)this.createButton(++e)}null==(u=this._elContainer.firstElementChild)||u.remove(),this._elContainer.scrollTop-=this.buttonHeight/2,this.scrollToPosition===this.numberOfItems-1&&0===t&&(this._elContainer.scrollTop+=this.buttonHeight)}}endlessHelperForNew(){var e,t,i,s,n,r,a,l,o,h,c,u;const{offsetHeight:d,offsetWidth:m,scrollLeft:g,scrollTop:b,scrollWidth:p,scrollHeight:_}=this._elContainer;if(!1!==("horizontal"===this.orientation?m+this.buttonWidth<p:d+this.buttonHeight<_))if("horizontal"===this.orientation&&"rtl"===this.dir){if(Math.abs(g)+m>p-this.buttonWidth/4){const i=this.getLastChild(),s=(this.numberOfItems+i+1)%this.numberOfItems;if(this.createButton(s),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let t=s;for(;t<this.numberOfItems&&!1===(null==(e=this.showSignalHolder[t])?void 0:e.value);)this.createButton(++t)}for(;this._elContainer.children.length>this.numberOfItems;)null==(t=this._elContainer.firstElementChild)||t.remove();this._elContainer.scrollLeft+=this.buttonWidth/2}else if(Math.abs(g)<this.buttonWidth/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createButton(t,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e>0&&!1===(null==(i=this.showSignalHolder[e])?void 0:i.value);)this.createButton(--e,!1)}for(;this._elContainer.children.length>this.numberOfItems;)null==(s=this._elContainer.lastElementChild)||s.remove();this._elContainer.scrollLeft-=this.buttonWidth/2}}else if("horizontal"===this.orientation){if(g<this.buttonWidth/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createButton(t,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e>0&&!1===(null==(n=this.showSignalHolder[e])?void 0:n.value);)this.createButton(--e,!1)}for(;this._elContainer.children.length>this.numberOfItems;)null==(r=this._elContainer.lastElementChild)||r.remove();this._elContainer.scrollLeft+=this.buttonWidth/2}else if(g+m>p-this.buttonWidth/4){const e=this.getLastChild(),t=(this.numberOfItems+e+1)%this.numberOfItems;if(this.createButton(t),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e<this.numberOfItems&&!1===(null==(a=this.showSignalHolder[e])?void 0:a.value);)this.createButton(++e)}for(;this._elContainer.children.length>this.numberOfItems;)null==(l=this._elContainer.firstElementChild)||l.remove();this._elContainer.scrollLeft-=this.buttonWidth/2}}else if(b<this.buttonHeight/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createButton(t,!1),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e>0&&!1===(null==(o=this.showSignalHolder[e])?void 0:o.value);)this.createButton(--e,!1)}for(;this._elContainer.children.length>this.numberOfItems;)null==(h=this._elContainer.lastElementChild)||h.remove();this._elContainer.scrollTop+=this.buttonHeight/2}else if(b+d>_-this.buttonHeight/4){const e=this.getLastChild(),t=(this.numberOfItems+e+1)%this.numberOfItems;if(this.createButton(t),!0===this.loadButtonForShow&&!1===this.allButtonsVisible){let e=t;for(;e<this.numberOfItems&&!1===(null==(c=this.showSignalHolder[e])?void 0:c.value);)this.createButton(++e)}for(;this._elContainer.children.length>this.numberOfItems;)null==(u=this._elContainer.firstElementChild)||u.remove();this._elContainer.scrollTop-=this.buttonHeight/2,this.scrollToPosition===this.numberOfItems-1&&0===t&&(this._elContainer.scrollTop+=this.buttonHeight)}}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleOrientation(){Array.from(e.COMPONENT_DATA.ORIENTATION.values).forEach(t=>{this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.COMPONENT_DATA.ORIENTATION.classListPrefix+t)}),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this.handleRowsAndColumn()}handleScrollbar(){!0===this.endless&&!0===this.scrollbar&&(this.scrollbar=!1),[!0,!1].forEach(t=>{this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+t.toString())}),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+this.scrollbar),this.initScrollbar()}handleRowsAndColumn(){this.endless&&(this.endless="horizontal"===this.orientation?1===this.rows:1===this.columns),"both"===this.stretch&&(this.stretch="horizontal"===this.orientation?1===this.rows?"both":null:1===this.columns?"both":null),"horizontal"===this.orientation?(this._elContainer.style.removeProperty("grid-template-rows"),this._elContainer.style.removeProperty("grid-template-columns"),this.rowClassValue=this.rows<this.numberOfItems?this.rows:this.numberOfItems,this._elContainer.style.setProperty("grid-template-rows","repeat("+this.rowClassValue+", 1fr)")):(this._elContainer.style.removeProperty("grid-template-columns"),this._elContainer.style.removeProperty("grid-template-rows"),this.columnClassValue=this.columns<this.numberOfItems?this.columns:this.numberOfItems,this._elContainer.style.setProperty("grid-template-columns","repeat("+this.columnClassValue+", 1fr)")),this.debounceButtonDisplay()}handleStretch(){"both"===this.stretch&&(this.stretch="horizontal"===this.orientation?1===this.rows?"both":null:1===this.columns?"both":null),null===this.stretch?this._elContainer.classList.remove(this.primaryCssClass+"--stretch-both"):this.debounceButtonDisplay()}handleCenterItems(){[!0,!1].forEach(t=>{this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+t.toString())}),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+this.centerItems),!0===this.centerItems&&this.debounceButtonDisplay()}handleEndless(){this.endless&&(this.endless="horizontal"===this.orientation?1===this.rows:1===this.columns),this.endless&&!0===this.scrollbar&&(this.scrollbar=!1)}handleScrollToPosition(t){var i,s;if(!(t>=this.numberOfItems||t<0||"horizontal"===this.orientation&&1!==this.rows||"vertical"===this.orientation&&1!==this.columns)){if(0!==this.buttonWidth&&0!==this.buttonHeight||(this.createButton(0,!1),this.buttonWidth=(null==(i=this._elContainer.firstElementChild)?void 0:i.getBoundingClientRect().width)||this.buttonWidth,this.buttonHeight=(null==(s=this._elContainer.firstElementChild)?void 0:s.getBoundingClientRect().height)||this.buttonHeight),Array.from(this._elContainer.children).forEach(e=>e.remove()),0!==this.contractName.length&&!0===this.useContractForItemShow||0!==this.buttonReceiveStateShow.length&&!0===this.buttonReceiveStateShow.trim().includes(`{{${this.indexId}}}`)){this.loadButtonForShow=!0,0===this.showSignalHolder.length&&this.signalHolder();const e=this.showSignalHolder.filter(e=>!0===(null==e?void 0:e.value)).length;this.allButtonsVisible=e===this.numberOfItems}else this.loadButtonForShow=!1;if("rtl"===this.dir&&"horizontal"===this.orientation){const i=this._elContainer.getBoundingClientRect().width,s=Math.ceil(i/this.buttonWidth)+e.BUTTON_CONTAINER_BUFFER;if(t>=this.numberOfItems-(s-e.BUTTON_CONTAINER_BUFFER)){for(let e=this.numberOfItems-s;e<this.numberOfItems;e++)this.createButton(e);this._elContainer.scrollLeft=t===this.numberOfItems-1?5*this.buttonWidth*-1:this.buttonWidth*e.BUTTON_CONTAINER_BUFFER*-1,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToRightEdgeRange()}else if(t>=e.BUTTON_CONTAINER_BUFFER){for(let i=t-e.BUTTON_CONTAINER_BUFFER;i<t+s&&i<this.numberOfItems;i++)this.createButton(i);this._elContainer.scrollLeft=this.buttonWidth*e.BUTTON_CONTAINER_BUFFER*-1,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToMiddleRange()}else{for(let e=0;e<s&&e<this.numberOfItems;e++)this.createButton(e);this._elContainer.scrollLeft=this.buttonWidth*t*-1,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToLeftEdgeRange()}}else if("horizontal"===this.orientation){const i=this._elContainer.getBoundingClientRect().width,s=Math.ceil(i/this.buttonWidth)+e.BUTTON_CONTAINER_BUFFER;if(t>=this.numberOfItems-(s-e.BUTTON_CONTAINER_BUFFER)){for(let e=this.numberOfItems-s;e<this.numberOfItems;e++)this.createButton(e);this._elContainer.scrollLeft=t===this.numberOfItems-1?5*this.buttonWidth:this.buttonWidth*e.BUTTON_CONTAINER_BUFFER,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToRightEdgeRange()}else if(t>=e.BUTTON_CONTAINER_BUFFER){for(let i=t-e.BUTTON_CONTAINER_BUFFER;i<t+s&&i<this.numberOfItems;i++)this.createButton(i);this._elContainer.scrollLeft=this.buttonWidth*e.BUTTON_CONTAINER_BUFFER,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToMiddleRange()}else{for(let e=0;e<s&&e<this.numberOfItems;e++)this.createButton(e);this._elContainer.scrollLeft=this.buttonWidth*t,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToLeftEdgeRange()}}else{const i=this._elContainer.getBoundingClientRect().height,s=Math.ceil(i/this.buttonHeight)+e.BUTTON_CONTAINER_BUFFER;if(i<=10||i<=this.buttonHeight+10)for(let e=0;e<this.numberOfItems;e++)this.createButton(e);else if(t>=this.numberOfItems-(s-e.BUTTON_CONTAINER_BUFFER)){for(let e=this.numberOfItems-s;e<this.numberOfItems;e++)this.createButton(e);this._elContainer.scrollTop=t===this.numberOfItems-1?5*this.buttonHeight:this.buttonHeight*e.BUTTON_CONTAINER_BUFFER,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToRightEdgeRange()}else if(t>=e.BUTTON_CONTAINER_BUFFER){for(let i=t-e.BUTTON_CONTAINER_BUFFER;i<t+s&&i<this.numberOfItems;i++)this.createButton(i);this._elContainer.scrollTop=this.buttonHeight*e.BUTTON_CONTAINER_BUFFER,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToMiddleRange()}else{for(let e=0;e<s&&e<this.numberOfItems;e++)this.createButton(e);this._elContainer.scrollTop=this.buttonHeight*t,!1===this.allButtonsVisible&&!0===this.loadButtonForShow&&this.scrollToLeftEdgeRange()}}this.initScrollbar()}}handleScrollToPositionForNew(t){var i,s,n,r,a;if(!(t>=this.numberOfItems||t<0||"horizontal"===this.orientation&&1!==this.rows||"vertical"===this.orientation&&1!==this.columns)){if(0!==this.buttonWidth&&0!==this.buttonHeight||(0===this._elContainer.children.length?(this.createButton(0),this.buttonWidth=(null==(i=this._elContainer.firstElementChild)?void 0:i.getBoundingClientRect().width)||this.buttonWidth,this.buttonHeight=(null==(s=this._elContainer.firstElementChild)?void 0:s.getBoundingClientRect().height)||this.buttonHeight,null==(n=this._elContainer.firstElementChild)||n.remove()):(this.buttonWidth=(null==(r=this._elContainer.firstElementChild)?void 0:r.getBoundingClientRect().width)||this.buttonWidth,this.buttonHeight=(null==(a=this._elContainer.firstElementChild)?void 0:a.getBoundingClientRect().height)||this.buttonHeight)),0!==this.contractName.length&&!0===this.useContractForItemShow||0!==this.buttonReceiveStateShow.length&&!0===this.buttonReceiveStateShow.trim().includes(`{{${this.indexId}}}`)){this.loadButtonForShow=!0,0===this.showSignalHolder.length&&this.signalHolder();const e=this.showSignalHolder.filter(e=>!0===(null==e?void 0:e.value)).length;this.allButtonsVisible=e===this.numberOfItems}else this.loadButtonForShow=!1;if("rtl"===this.dir&&"horizontal"===this.orientation){const i=this._elContainer.getBoundingClientRect().width,s=Math.ceil(i/this.buttonWidth)+e.BUTTON_CONTAINER_BUFFER;if(0===this._elContainer.children.length)for(let e=0;e<this.numberOfItems&&e<t+s-1;e++)this.createButton(e);else if(this.getLastChild()<t+s)for(let e=this.getLastChild()+1;e<this.numberOfItems&&e<t+s;e++)this.createButton(e);this._elContainer.scrollLeft=0!==t?t*this.buttonWidth*-1:0}else if("horizontal"===this.orientation){const i=this._elContainer.getBoundingClientRect().width,s=Math.ceil(i/this.buttonWidth)+e.BUTTON_CONTAINER_BUFFER;if(0===this._elContainer.children.length)for(let e=0;e<this.numberOfItems&&e<t+s-1;e++)this.createButton(e);else if(this.getLastChild()<t+s)for(let e=this.getLastChild()+1;e<this.numberOfItems&&e<t+s;e++)this.createButton(e);this._elContainer.scrollLeft=0!==t?t*this.buttonWidth:0}else{const i=this._elContainer.getBoundingClientRect().height,s=Math.ceil(i/this.buttonHeight)+e.BUTTON_CONTAINER_BUFFER;if(i<=10||i<=this.buttonHeight+10)for(let e=0;e<this.numberOfItems;e++)this.createButton(e);else if(0===this._elContainer.children.length)for(let e=0;e<this.numberOfItems&&e<t+s-1;e++)this.createButton(e);else if(this.getLastChild()<t+s)for(let e=this.getLastChild()+1;e<this.numberOfItems&&e<t+s;e++)this.createButton(e);this._elContainer.scrollTop=0!==t?t*this.buttonHeight:0}if(!1===this.allButtonsVisible&&!0===this.loadButtonForShow){let e=0;for(let t=this.getFirstChild();t<=this.getLastChild();t++)!1===this.showSignalHolder[t].value&&(e+=1);let t=0;for(;0!==e&&t<e&&this.getLastChild()!==this.numberOfItems-1;)!0===this.showSignalHolder[this.getLastChild()+1].value&&(t+=1),this.createButton(this.getLastChild()+1)}this.initScrollbar()}}handleScrollToPositionForAll(e){var t,i;e>=this.numberOfItems||e<0||"horizontal"===this.orientation&&1!==this.rows||"vertical"===this.orientation&&1!==this.columns||(this.buttonWidth=(null==(t=this._elContainer.firstElementChild)?void 0:t.getBoundingClientRect().width)||this.buttonWidth,this.buttonHeight=(null==(i=this._elContainer.firstElementChild)?void 0:i.getBoundingClientRect().height)||this.buttonHeight,"rtl"===this.dir&&"horizontal"===this.orientation?this._elContainer.scrollLeft=e*this.buttonWidth*-1:"horizontal"===this.orientation?this._elContainer.scrollLeft=e*this.buttonWidth:this._elContainer.scrollTop=e*this.buttonHeight,this.initScrollbar())}buttonDisplay(t=!1){if(this.contractDefaultHelper(),!0===t)return this.handleScrollToPosition(this.scrollToPosition);this._elContainer.classList.remove(this.primaryCssClass+"--stretch-both"),Array.from(this._elContainer.children).forEach(e=>e.remove()),this.createButton(0),this.buttonWidth=this._elContainer.children[0].getBoundingClientRect().width,this.buttonHeight=this._elContainer.children[0].getBoundingClientRect().height;let i=0;if("horizontal"===this.orientation){const t=this._elContainer.getBoundingClientRect().width;i=Math.floor(t/this.buttonWidth)*this.rows+this.rows*e.BUTTON_CONTAINER_BUFFER}else{const t=this._elContainer.getBoundingClientRect().height;i=t>this.buttonHeight+10?Math.floor(t/this.buttonHeight)*this.columns+this.columns*e.BUTTON_CONTAINER_BUFFER:this.numberOfItems}i=i>this.numberOfItems?this.numberOfItems:i;for(let e=1;e<i;e++)this.createButton(e);this.endless&&("horizontal"===this.orientation?this._elContainer.scrollLeft=5:this._elContainer.scrollTop=5),this.initScrollbar(),"both"===this.stretch&&this._elContainer.classList.add(this.primaryCssClass+"--stretch-both"),this.signalHolder(),0!==this.scrollToPosition&&this.handleScrollToPosition(this.scrollToPosition)}buttonDisplayForLoadItemsNew(t=!1){if(this.contractDefaultHelper(),!0===t)return this.handleScrollToPositionForNew(this.scrollToPosition);this._elContainer.classList.remove(this.primaryCssClass+"--stretch-both"),Array.from(this._elContainer.children).forEach(e=>e.remove()),this.createButton(0),this.buttonWidth=this._elContainer.children[0].getBoundingClientRect().width,this.buttonHeight=this._elContainer.children[0].getBoundingClientRect().height;let i=0;if("horizontal"===this.orientation){const t=this._elContainer.getBoundingClientRect().width;i=Math.floor(t/this.buttonWidth)*this.rows+this.rows*e.BUTTON_CONTAINER_BUFFER}else{const t=this._elContainer.getBoundingClientRect().height;i=t>this.buttonHeight+10?Math.floor(t/this.buttonHeight)*this.columns+this.columns*e.BUTTON_CONTAINER_BUFFER:this.numberOfItems}i=i>this.numberOfItems?this.numberOfItems:i;for(let e=1;e<i;e++)this.createButton(e);this.endless&&("horizontal"===this.orientation?this._elContainer.scrollLeft=5:this._elContainer.scrollTop=5),this.initScrollbar(),"both"===this.stretch&&this._elContainer.classList.add(this.primaryCssClass+"--stretch-both"),this.signalHolder(),0!==this.scrollToPosition&&this.handleScrollToPositionForNew(this.scrollToPosition)}buttonDisplayForLoadItemsAll(e=!1){this.contractDefaultHelper(),Array.from(this._elContainer.children).forEach(e=>e.remove());for(let e=0;e<this.numberOfItems;e++)this.createButton(e);this.endless&&("horizontal"===this.orientation?this._elContainer.scrollLeft=5:this._elContainer.scrollTop=5),this.initScrollbar(),"both"===this.stretch&&this._elContainer.classList.add(this.primaryCssClass+"--stretch-both"),!0===e&&0===this.scrollToPosition&&("horizontal"===this.orientation?this._elContainer.scrollLeft=0:this._elContainer.scrollTop=0),0!==this.scrollToPosition&&this.handleScrollToPositionForAll(this.scrollToPosition)}createButton(t,i=!0){var s,n,r,a,l;if(t<0||t>=this.numberOfItems)return;const o={index:t+1,clickHoldTime:this.clickHoldTime,contractName:this.contractName,parentComponent:"ch5-button-list"},h=new Ch5Button(o);h.setAttribute("swipeGestureEnabled","true");const c=document.createElement("div");if(c.setAttribute("id",this.getCrId()+"-"+t),""!==this.contractName&&!0===this.useContractForItemShow)c.setAttribute("data-ch5-noshow-type","display"),c.setAttribute("data-ch5-show",this.contractName+`.Button${t+1}Visible`);else if(!1===(null==(s=this.getAttribute("buttonReceiveStateShow"))?void 0:s.trim().includes(`{{${this.indexId}}}`))){const e=null==(n=this.getAttribute("buttonReceiveStateShow"))?void 0:n.trim();e&&(c.setAttribute("data-ch5-noshow-type","display"),c.setAttribute("data-ch5-show",e.trim()))}else if(this.hasAttribute("buttonReceiveStateShow")&&(null==(r=this.getAttribute("buttonReceiveStateShow"))?void 0:r.trim())){const e=this.replaceAll((null==(a=this.getAttribute("buttonReceiveStateShow"))?void 0:a.trim())+"",`{{${this.indexId}}}`,""),i=/^[0-9]+$/.test(e);c.setAttribute("data-ch5-noshow-type","display"),i?c.setAttribute("data-ch5-show",Number(e)+t+""):c.setAttribute("data-ch5-show",this.replaceAll((null==(l=this.getAttribute("buttonReceiveStateShow"))?void 0:l.trim())+"",`{{${this.indexId}}}`,t+""))}c.classList.add(this.nodeName.toLowerCase()+"--button-container"),c.appendChild(h),i?this._elContainer.appendChild(c):this._elContainer.prepend(c),this.buttonModeHelper(h,t),this.buttonLabelHelper(h,t),this.buttonHelper(h,t),h.addContainerClass(this.nodeName.toLowerCase()+e.COMPONENT_DATA.BUTTON_TYPE.classListPrefix+this.buttonType),h.addContainerClass(this.nodeName.toLowerCase()+e.COMPONENT_DATA.BUTTON_SHAPE.classListPrefix+this.buttonShape),h.addContainerClass(this.nodeName.toLowerCase()+e.COMPONENT_DATA.BUTTON_ICON_POSITION.classListPrefix+this.buttonIconPosition),h.addContainerClass(this.nodeName.toLowerCase()+e.COMPONENT_DATA.BUTTON_CHECKBOX_POSITION.classListPrefix+this.buttonCheckboxPosition)}buttonModeHelper(t,i){const s=this.getElementsByTagName(this.nodeName.toLowerCase()+"-mode");s&&s.length>0&&Array.from(s).forEach((s,n)=>{if(n<e.MODES_MAX_COUNT&&s.parentElement instanceof e){const e=new Ch5ButtonMode(t);Ch5ButtonMode.observedAttributes.forEach(t=>{s.hasAttribute(t)&&e.setAttribute(t,s.getAttribute(t)+"")});const n=s.getElementsByTagName(this.nodeName.toLowerCase()+"-mode-state");n&&n.length>0&&Array.from(n).forEach(s=>{if(s.parentElement instanceof Ch5ButtonListModeBase){const n=new Ch5ButtonModeState(t);Ch5ButtonModeState.observedAttributes.forEach(e=>{s.hasAttribute(e)&&n.setAttribute(e,s.getAttribute(e)+"")});const r=s.getElementsByTagName(this.nodeName.toLowerCase()+"-label");r&&r.length>0&&Array.from(r).forEach(e=>{if(e.parentElement instanceof Ch5ButtonListModeStateBase){const t=e.getElementsByTagName("template");if(t&&t.length>0){const e=new Ch5ButtonLabel,s=document.createElement("template");s.innerHTML=t[0].innerHTML,Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(s,i,this.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(s,i,this.indexId),e.appendChild(s),n.appendChild(e)}}}),e.appendChild(n)}});const r=s.getElementsByTagName(this.nodeName.toLowerCase()+"-label");r&&r.length>0&&Array.from(r).forEach(t=>{if(t.parentElement instanceof Ch5ButtonListModeBase){const s=t.getElementsByTagName("template");if(s&&s.length>0){const t=new Ch5ButtonLabel,n=document.createElement("template");n.innerHTML=s[0].innerHTML,Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(n,i,this.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(n,i,this.indexId),t.appendChild(n),e.appendChild(t)}}}),t.appendChild(e)}})}buttonLabelHelper(t,i){const s=this.getElementsByTagName(this.nodeName.toLowerCase()+"-label");s&&s.length>0&&Array.from(s).forEach(s=>{if(s.parentElement instanceof e){const e=s.getElementsByTagName("template");if(e&&e.length>0){const s=new Ch5ButtonLabel,n=document.createElement("template");n.innerHTML=e[0].innerHTML,Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(n,i,this.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(n,i,this.indexId),s.appendChild(n),t.appendChild(s)}}})}buttonHelper(t,i){if(t.setAttribute("stretch","both"),t.setAttribute("shape",e.BUTTON_SHAPES[0]),""!==this.contractName)return this.contractButtonHelper(t,i);const s=this.getElementsByTagName(this.nodeName.toLowerCase()+"-individual-button"),n=s.length;e.COMPONENT_PROPERTIES.forEach(e=>{var r,a,l,o,h,c,u,d,m,g,b,p,_,S;if(i<n){if("buttoniconclass"===e.name.toLowerCase()){if(s[i]&&s[i].hasAttribute("iconclass")){const e=null==(r=s[i].getAttribute("iconclass"))?void 0:r.trim();e&&t.setAttribute("iconclass",e)}else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name)){const s=null==(a=this.getAttribute(e.name))?void 0:a.trim().replace(`{{${this.indexId}}}`,i+"");s&&t.setAttribute(e.name.toLowerCase().replace("button",""),s.trim())}}else if("buttoniconurl"===e.name.toLowerCase()){if(s[i]&&s[i].hasAttribute("iconurl")){const e=null==(l=s[i].getAttribute("iconurl"))?void 0:l.trim();e&&t.setAttribute("iconurl",e)}else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name)){const s=null==(o=this.getAttribute(e.name))?void 0:o.trim().replace(`{{${this.indexId}}}`,i+"");s&&t.setAttribute(e.name.toLowerCase().replace("button",""),s.trim())}}else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name))if(!1===(null==(h=this.getAttribute(e.name))?void 0:h.trim().includes(`{{${this.indexId}}}`))){const i=null==(c=this.getAttribute(e.name))?void 0:c.trim();i&&t.setAttribute(e.name.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(u=this.getAttribute(e.name))?void 0:u.trim().length)){const s=this.replaceAll((null==(d=this.getAttribute(e.name))?void 0:d.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?t.setAttribute(e.name.toLowerCase().replace("button",""),Number(s)+i+""):t.setAttribute(e.name.toLowerCase().replace("button",""),this.replaceAll((null==(m=this.getAttribute(e.name))?void 0:m.trim())+"",`{{${this.indexId}}}`,i+""))}}else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name))if(!1===(null==(g=this.getAttribute(e.name))?void 0:g.trim().includes(`{{${this.indexId}}}`))){const i=null==(b=this.getAttribute(e.name))?void 0:b.trim();i&&t.setAttribute(e.name.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(p=this.getAttribute(e.name))?void 0:p.trim().length)){const s=this.replaceAll((null==(_=this.getAttribute(e.name))?void 0:_.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?t.setAttribute(e.name.toLowerCase().replace("button",""),Number(s)+i+""):t.setAttribute(e.name.toLowerCase().replace("button",""),this.replaceAll((null==(S=this.getAttribute(e.name))?void 0:S.trim())+"",`{{${this.indexId}}}`,i+""))}}),""!==this.receiveStateSelectedButton.trim()&&(t.removeAttribute("receiveStateSelected"),t.removeAttribute("selected"),this.selectedButton===i&&t.setAttribute("selected","true"));["onRelease","labelInnerHTML"].forEach(e=>{var r;if(i<n&&s[i]&&s[i].hasAttribute(e)){const n=null==(r=s[i].getAttribute(e))?void 0:r.trim();n&&t.setAttribute(e,n.trim())}})}replaceAll(e,t,i){return e&&""!==String(e).trim()?String(e).split(t).join(i):e}contractDefaultHelper(){""!==this.contractName&&(!0===this.useContractForCustomStyle&&(this.receiveStateCustomStyle=this.contractName+".CustomStyle"),!0===this.useContractForCustomClass&&(this.receiveStateCustomClass=this.contractName+".CustomClass"),!0===this.useContractForEnable&&(this.receiveStateEnable=this.contractName+".ListEnabled"),!0===this.useContractForShow&&(this.receiveStateShow=this.contractName+".ListVisible"),!0===this.useContractForNumItems&&(this.receiveStateNumberOfItems=this.contractName+".ListNumberOfItems"),!0===this.useContractForEachButtonSelection&&(this.receiveStateSelectedButton=this.contractName+".ItemSelected"),this.receiveStateScrollToPosition=this.contractName+".ListScrollToItem")}contractButtonHelper(e,t){var i,s,n,r,a,l;!0===this.useContractForItemEnable?e.setAttribute("receiveStateEnable",this.contractName+`.Button${t+1}Enabled`):this.hasAttribute("buttonReceiveStateEnable")&&(null==(i=this.getAttribute("buttonReceiveStateEnable"))?void 0:i.trim())&&this.indexIdReplaceHelper(e,"buttonReceiveStateEnable",t),!0===this.useContractForItemShow?e.setAttribute("receiveStateShow",this.contractName+`.Button${t+1}Visible`):this.hasAttribute("buttonReceiveStateShow")&&(null==(s=this.getAttribute("buttonReceiveStateShow"))?void 0:s.trim())&&this.indexIdReplaceHelper(e,"buttonReceiveStateShow",t),"iconClass"===this.contractItemIconType?e.setAttribute("receiveStateIconClass",this.contractName+`.Button${t+1}IconClass`):"url"===this.contractItemIconType?e.setAttribute("receiveStateIconUrl",this.contractName+`.Button${t+1}IconURL`):"sgStateNumber"===this.contractItemIconType?e.setAttribute("receiveStateSGIconNumeric",this.contractName+`.Button${t+1}IconAnalog`):"sgStateName"===this.contractItemIconType?e.setAttribute("receiveStateSGIconString",this.contractName+`.Button${t+1}IconSerial`):"none"===this.contractItemIconType&&(this.hasAttribute("buttonReceiveStateIconClass")&&(null==(n=this.getAttribute("buttonReceiveStateIconClass"))?void 0:n.trim())&&this.indexIdReplaceHelper(e,"buttonReceiveStateIconClass",t),this.hasAttribute("buttonReceiveStateIconUrl")&&(null==(r=this.getAttribute("buttonReceiveStateIconUrl"))?void 0:r.trim())&&this.indexIdReplaceHelper(e,"buttonReceiveStateIconUrl",t)),"textContent"===this.contractItemLabelType?e.setAttribute("receiveStateLabel",this.contractName+`.Button${t+1}Text`):"innerHTML"===this.contractItemLabelType?e.setAttribute("receiveStateScriptLabelHtml",this.contractName+`.Button${t+1}Text`):(this.hasAttribute("buttonReceiveStateLabel")&&(null==(a=this.getAttribute("buttonReceiveStateLabel"))?void 0:a.trim())&&this.indexIdReplaceHelper(e,"buttonReceiveStateLabel",t),this.hasAttribute("buttonReceiveStateScriptLabelHtml")&&(null==(l=this.getAttribute("buttonReceiveStateScriptLabelHtml"))?void 0:l.trim())&&this.indexIdReplaceHelper(e,"buttonReceiveStateScriptLabelHtml",t)),e.setAttribute("receiveStateMode",this.contractName+`.Button${t+1}Mode`),!1===this.useContractForEachButtonSelection&&e.setAttribute("receiveStateSelected",this.contractName+`.Button${t+1}ItemSelected`),t===this.selectedButton&&!0===this.useContractForEachButtonSelection&&e.setAttribute("selected","true"),e.setAttribute("sgIconTheme",this.buttonSgIconTheme);const o=this.getElementsByTagName(this.nodeName.toLowerCase()+"-individual-button"),h=o.length;["buttonCheckboxPosition","buttonCheckboxShow","buttonVAlignLabel","buttonHAlignLabel","buttonIconClass","buttonIconPosition","buttonIconUrl","buttonShape","buttonType","buttonPressed","buttonLabelInnerHtml","buttonIconUrlFillType"].forEach(i=>{var s,n,r,a,l,c,u,d,m,g,b,p,_,S;if(i=i.toLowerCase(),t<h){if("buttoniconclass"===i){if(o[t]&&o[t].hasAttribute("iconclass")){const i=null==(s=o[t].getAttribute("iconclass"))?void 0:s.trim();i&&e.setAttribute("iconclass",i)}else if(i.startsWith("button")&&this.hasAttribute(i)){const s=null==(n=this.getAttribute(i))?void 0:n.trim().replace(`{{${this.indexId}}}`,t+"");s&&e.setAttribute(i.replace("button",""),s.trim())}}else if("buttoniconurl"===i){if(o[t]&&o[t].hasAttribute("iconurl")){const i=null==(r=o[t].getAttribute("iconurl"))?void 0:r.trim();i&&e.setAttribute("iconurl",i)}else if(i.startsWith("button")&&this.hasAttribute(i)){const s=null==(a=this.getAttribute(i))?void 0:a.trim().replace(`{{${this.indexId}}}`,t+"");s&&e.setAttribute(i.replace("button",""),s.trim())}}else if("buttonreceivestateshow"===i&&this.hasAttribute("receivestateshow"))e.setAttribute("receivestateshow",this.getAttribute("receivestateshow")+"");else if("buttonreceivestateenable"===i&&this.hasAttribute("receivestateenable"))e.setAttribute("receivestateenable",this.getAttribute("receivestateenable")+"");else if(i.startsWith("button")&&this.hasAttribute(i))if(!1===(null==(l=this.getAttribute(i))?void 0:l.trim().includes(`{{${this.indexId}}}`))){const t=null==(c=this.getAttribute(i))?void 0:c.trim();t&&e.setAttribute(i.replace("button",""),t.trim())}else if(0!==(null==(u=this.getAttribute(i))?void 0:u.trim().length)){const s=this.replaceAll((null==(d=this.getAttribute(i))?void 0:d.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?e.setAttribute(i.replace("button",""),Number(s)+t+""):e.setAttribute(i.replace("button",""),this.replaceAll((null==(m=this.getAttribute(i))?void 0:m.trim())+"",`{{${this.indexId}}}`,t+""))}}else if("buttonreceivestateshow"===i&&this.hasAttribute("receivestateshow"))e.setAttribute("receivestateshow",this.getAttribute("receivestateshow")+"");else if("buttonreceivestateenable"===i&&this.hasAttribute("receivestateenable"))e.setAttribute("receivestateenable",this.getAttribute("receivestateenable")+"");else if(i.startsWith("button")&&this.hasAttribute(i))if(!1===(null==(g=this.getAttribute(i))?void 0:g.trim().includes(`{{${this.indexId}}}`))){const t=null==(b=this.getAttribute(i))?void 0:b.trim();t&&e.setAttribute(i.replace("button",""),t.trim())}else if(0!==(null==(p=this.getAttribute(i))?void 0:p.trim().length)){const s=this.replaceAll((null==(_=this.getAttribute(i))?void 0:_.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?e.setAttribute(i.replace("button",""),Number(s)+t+""):e.setAttribute(i.replace("button",""),this.replaceAll((null==(S=this.getAttribute(i))?void 0:S.trim())+"",`{{${this.indexId}}}`,t+""))}});["onRelease","labelInnerHTML"].forEach(i=>{var s;if(t<h&&o[t]&&o[t].hasAttribute(i)){const n=null==(s=o[t].getAttribute(i))?void 0:s.trim();n&&e.setAttribute(i,n.trim())}})}indexIdReplaceHelper(e,t,i){var s,n,r,a,l;if(!1===(null==(s=this.getAttribute(t))?void 0:s.trim().includes(`{{${this.indexId}}}`))){const i=null==(n=this.getAttribute(t))?void 0:n.trim();i&&e.setAttribute(t.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(r=this.getAttribute(t))?void 0:r.trim().length)){const s=this.replaceAll((null==(a=this.getAttribute(t))?void 0:a.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?e.setAttribute(t.toLowerCase().replace("button",""),Number(s)+i+""):e.setAttribute(t.toLowerCase().replace("button",""),this.replaceAll((null==(l=this.getAttribute(t))?void 0:l.trim())+"",`{{${this.indexId}}}`,i+""))}}initCssClass(){this.logger.start("initializeCssClass"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this._elContainer.style.setProperty("grid-template-rows","repeat("+this.rows+", 1fr)"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+this.scrollbar),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+this.centerItems),this.logger.stop()}initScrollbar(){if("horizontal"===this.orientation&&"rtl"===this.dir){const{scrollWidth:e,offsetWidth:t,scrollLeft:i}=this._elContainer;this.scrollbarDimension=Math.floor(t/e*100);const s=Math.ceil(Math.abs(i)/e*100);this._scrollbar.style.removeProperty("height"),this._scrollbar.style.removeProperty("top"),this._scrollbar.style.width=this.scrollbarDimension+"%",this._scrollbar.style.left=100-this.scrollbarDimension-s+"%"}else if("horizontal"===this.orientation){const{scrollWidth:e,offsetWidth:t,scrollLeft:i}=this._elContainer;this.scrollbarDimension=Math.floor(t/e*100);const s=Math.ceil(i/e*100);this._scrollbar.style.removeProperty("height"),this._scrollbar.style.removeProperty("top"),this._scrollbar.style.width=this.scrollbarDimension+"%",this._scrollbar.style.left=s+"%"}else{const{scrollHeight:e,offsetHeight:t,scrollTop:i}=this._elContainer;this.scrollbarDimension=Math.floor(t/e*100);const s=Math.ceil(i/e*100);this._scrollbar.style.removeProperty("width"),this._scrollbar.style.removeProperty("left"),this._scrollbar.style.height=this.scrollbarDimension+"%",this._scrollbar.style.top=s+"%"}this.scrollbar&&(100===this.scrollbarDimension?(this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+"true"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+"false")):(this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+"false"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+"true"))),this.centerItems&&this.checkCenterItems()}checkInternalHTML(){this._elContainer.parentElement!==this&&(this._elContainer.classList.add(this.nodeName.toLowerCase()),this.appendChild(this._elContainer)),this._scrollbar.parentElement!==this._scrollbarContainer&&(this._scrollbar.classList.add("scrollbar"),this._scrollbarContainer.appendChild(this._scrollbar)),this._scrollbarContainer.parentElement!==this&&(this._scrollbarContainer.classList.add("scrollbar-container"),this.appendChild(this._scrollbarContainer))}handleContractName(){0===this.contractName.trim().length?(this.signalNameOnContract.contractName="",this.receiveStateShow=this.signalNameOnContract.receiveStateShow,this.receiveStateEnable=this.signalNameOnContract.receiveStateEnable,this.receiveStateCustomStyle=this.signalNameOnContract.receiveStateCustomStyle,this.receiveStateCustomClass=this.signalNameOnContract.receiveStateCustomClass,this.receiveStateNumberOfItems=this.signalNameOnContract.receiveStateNumberOfItems,this.receiveStateSelectedButton=this.signalNameOnContract.receiveStateSelectedButton,this.receiveStateScrollToPosition=this.signalNameOnContract.receiveStateScrollToPosition):""===this.signalNameOnContract.contractName&&(this.signalNameOnContract.contractName=this.contractName,this.signalNameOnContract.receiveStateShow=this.receiveStateShow,this.signalNameOnContract.receiveStateEnable=this.receiveStateEnable,this.signalNameOnContract.receiveStateCustomStyle=this.receiveStateCustomStyle,this.signalNameOnContract.receiveStateCustomClass=this.receiveStateCustomClass,this.signalNameOnContract.receiveStateNumberOfItems=this.receiveStateNumberOfItems,this.signalNameOnContract.receiveStateSelectedButton=this.receiveStateSelectedButton,this.signalNameOnContract.receiveStateScrollToPosition=this.receiveStateScrollToPosition),this.debounceButtonDisplay()}signalHolder(){var e,t;if(0!==this.contractName.length&&!0===this.useContractForItemShow){this.showSignalHolder.forEach(e=>this.clearOldSubscription(e.signalValue,e.signalState)),this.showSignalHolder=[],this.loadButtonForShow=!0;for(let e=1;e<=this.numberOfItems;e++){const t=`${this.contractName}.Button${e}Visible`,i=this.setSignalByBoolean(t);this.showSignalHolder.push({signalState:"",signalValue:t,value:!1}),_11.isNil(i)||(this.showSignalHolder[e-1].signalState=i.subscribe(t=>(this.showSignalHolder[e-1].value=t,this.debounceButtonShow(),!0)))}}else if(0!==this.buttonReceiveStateShow.length&&!0===this.buttonReceiveStateShow.trim().includes(`{{${this.indexId}}}`)){this.showSignalHolder.forEach(e=>this.clearOldSubscription(e.signalValue,e.signalState)),this.showSignalHolder=[],this.loadButtonForShow=!0;const i=this.replaceAll((null==(e=this.getAttribute("buttonReceiveStateShow"))?void 0:e.trim())+"",`{{${this.indexId}}}`,""),s=/^[0-9]+$/.test(i);for(let e=0;e<this.numberOfItems;e++){const n=s?Number(i)+e+"":this.replaceAll((null==(t=this.getAttribute("buttonReceiveStateShow"))?void 0:t.trim())+"",`{{${this.indexId}}}`,e+"");this.showSignalHolder.push({signalState:"",signalValue:n,value:!1});const r=this.setSignalByBoolean(n);_11.isNil(r)||(this.showSignalHolder[e].signalState=r.subscribe(t=>(this.showSignalHolder[e].value=t,this.debounceButtonShow(),!0)))}}}clearOldSubscription(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);null!==s&&s.unsubscribe(t)}setSignalByBoolean(e){const t=Ch5Signal.getSubscriptionSignalName(e),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);return null===i?null:i}buttonShow(){const e=this.showSignalHolder.filter(e=>!0===(null==e?void 0:e.value)).length;this.allButtonsVisible=e===this.numberOfItems,!0!==this.allButtonsVisible&&(this.initScrollbar(),this.scrollToMiddleRange())}getFirstChild(){var e,t;return Number(null==(t=null==(e=this._elContainer.firstElementChild)?void 0:e.getAttribute("id"))?void 0:t.replace(this.getCrId()+"-",""))}getLastChild(){var e,t;return Number(null==(t=null==(e=this._elContainer.lastElementChild)?void 0:e.getAttribute("id"))?void 0:t.replace(this.getCrId()+"-",""))}scrollToRightEdgeRange(){let e=0;for(let t=this.getFirstChild();t<=this.getLastChild();t++)!1===this.showSignalHolder[t].value&&(e+=1);let t=0;for(;0!==e&&t<e&&0!==this.getFirstChild();)!0===this.showSignalHolder[this.getFirstChild()-1].value&&(t+=1),this.createButton(this.getFirstChild()-1,!1)}scrollToMiddleRange(){let e=0;for(let t=this.getFirstChild();t<=this.getLastChild();t++)!1===this.showSignalHolder[t].value&&(e+=1);let t=0;for(;0!==e&&t<e&&0!==this.getFirstChild();)!0===this.showSignalHolder[this.getFirstChild()-1].value&&(t+=1),this.createButton(this.getFirstChild()-1,!1);for(;0!==e&&t<e&&this.getLastChild()!==this.numberOfItems-1;)!0===this.showSignalHolder[this.getLastChild()+1].value&&(t+=1),this.createButton(this.getLastChild()+1)}scrollToLeftEdgeRange(){let e=0;for(let t=this.getFirstChild();t<=this.getLastChild();t++)!1===this.showSignalHolder[t].value&&(e+=1);let t=0;for(;0!==e&&t<e&&this.getLastChild()!==this.numberOfItems-1;)!0===this.showSignalHolder[this.getLastChild()+1].value&&(t+=1),this.createButton(this.getLastChild()+1)}handleReceiveStateSelectedButton(){Array.from(this._elContainer.children).forEach(e=>{var t;const i=e.children[0];i.removeAttribute("selected"),Number(null==(t=e.getAttribute("id"))?void 0:t.replace(this.getCrId()+"-",""))===this.selectedButton&&i.setAttribute("selected","true")})}checkCenterItems(){!0===this.centerItems&&(this.scrollbarDimension<100?(this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+"true"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+"false")):(this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+"false"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+"true")))}resizeHandler=()=>{this.scrollToPosition<=this.numberOfItems&&this.debounceButtonDisplay()};getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}},Ch5ButtonList=class e extends Ch5ButtonListBase{static ELEMENT_NAME="ch5-button-list";static SIGNAL_ATTRIBUTE_TYPES={...Ch5ButtonListBase.SIGNAL_ATTRIBUTE_TYPES};static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}constructor(){super(),this.primaryCssClass=e.ELEMENT_NAME}};Ch5ButtonList.registerCustomElement(),Ch5ButtonList.registerSignalAttributeTypes();import _12 from"lodash";var Ch5ButtonListMode=class e extends Ch5ButtonListModeBase{static ELEMENT_NAME="ch5-button-list-mode";static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}connectedCallback(){const e=this.getParentButton();if(!(this.parentElement instanceof Ch5ButtonList))throw new Error("Invalid parent element for ch5-button-list-mode.");if(_12.isNil(e))throw new Error(`Invalid parent element for ${this.nodeName}.`);super.connectedCallback(),this.parentComponent=e}getParentButton(){const e=t=>_12.isNil(t)||"CH5-BUTTON-LIST"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}};Ch5ButtonListMode.registerCustomElement();var Ch5ButtonListLabelBase=class extends Ch5Log{constructor(){super(),this.logger.start("constructor()"),this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5ButtonListLabel),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}};import _13 from"lodash";var Ch5ButtonListModeState=class e extends Ch5ButtonListModeStateBase{static ELEMENT_NAME="ch5-button-list-mode-state";static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}connectedCallback(){const e=this.getParentButton();if(!(this.parentElement instanceof Ch5ButtonListModeBase))throw new Error("Invalid parent element for ch5-button-list-mode-state.");if(_13.isNil(e))throw new Error(`Invalid parent element for ${this.nodeName}.`);super.connectedCallback(),this.parentComponent=e}getParentButton(){const e=t=>_13.isNil(t)||"CH5-BUTTON-LIST"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}};Ch5ButtonListModeState.registerCustomElement();var Ch5ButtonListLabel=class e extends Ch5ButtonListLabelBase{static ELEMENT_NAME="ch5-button-list-label";static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}connectedCallback(){if(!(this.parentElement instanceof Ch5ButtonList||this.parentElement instanceof Ch5ButtonListMode||this.parentElement instanceof Ch5ButtonListModeState))throw new Error(`Invalid parent element for ${e.ELEMENT_NAME}.`);super.connectedCallback()}};Ch5ButtonListLabel.registerCustomElement();import _14 from"lodash";var Ch5ButtonListIndividualButtonBase=class e extends Ch5Log{static COMPONENT_PROPERTIES=[{default:"",name:"labelInnerHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"onRelease",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];_ch5Properties;_parentCh5ButtonList=null;set parentComponent(e){this._parentCh5ButtonList=e}get parentComponent(){return this._parentCh5ButtonList}set labelInnerHTML(e){this._ch5Properties.set("labelInnerHTML",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get labelInnerHTML(){return this._ch5Properties.get("labelInnerHTML")}set iconUrl(e){this._ch5Properties.set("iconUrl",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconUrl(){return this._ch5Properties.get("iconUrl")}set iconClass(e){this._ch5Properties.set("iconClass",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconClass(){return this._ch5Properties.get("iconClass")}set onRelease(e){this._ch5Properties.set("onRelease",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get onRelease(){return this._ch5Properties.get("onRelease")}constructor(){super(),this.logger.start("constructor()"),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}static get observedAttributes(){const t=Ch5Log.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback"),i!==s){this.logger.log(this.nodeName+' attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()"),this.setAttribute("role",Ch5RoleAttributeMapping.ch5ButtonListIndividualButton),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}},Ch5ButtonListIndividualButton=class e extends Ch5ButtonListIndividualButtonBase{static ELEMENT_NAME="ch5-button-list-individual-button";static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}connectedCallback(){var e;const t=this.getParentButton();if(_14.isNil(t)||"CH5-BUTTON-LIST"!==(null==(e=this.parentElement)?void 0:e.nodeName.toString().toUpperCase()))throw new Error("Invalid parent element for ch5-button-list-individual-button.");super.connectedCallback(),this.parentComponent=t}getParentButton(){const e=t=>_14.isNil(t)||"CH5-BUTTON-LIST"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}};Ch5ButtonListIndividualButton.registerCustomElement();var Ch5ColorUtils=class{static getDigitalValue=(e,t)=>{const i=e/(t/255);return Math.round(i)};static getAnalogValue=(e,t)=>{const i=e*t/255;return Math.round(i)};static rgbFormat=e=>e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(/,\s*/);static rgbToHex(e,t,i){let s=e.toString(16),n=t.toString(16),r=i.toString(16);return 1===s.length&&(s="0"+s),1===n.length&&(n="0"+n),1===r.length&&(r="0"+r),"#"+s+n+r}static checkHex(e){return!!/^[#]*([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i.test(e)}static checkRgb(e){return!!/([R][G][B][A]?[(]\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\s*,\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\s*,\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])(\s*,\s*((0\.[0-9]{1})|(1\.0)|(1)))?[)])/i.test(e)}static modifyHex(e){return 4===e.length&&(e=e.replace("#","")),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e}static hexToRgb(e){const t=[];return 6!==(e=e.replace("#","")).length&&(e=this.modifyHex(e)),t.push(parseInt(e.slice(0,2),16)),t.push(parseInt(e.slice(2,4),16)),t.push(parseInt(e.slice(4,6),16)),"rgb("+t.toString()+")"}static validateColorName(e){try{const t=(new Option).style;return t.color=e,"string"==typeof t.color&&t.color.length>0}catch(e){}return!1}static convert(e){const t=document.createElement("div");t.style.color=e,document.body.appendChild(t);const i=window.getComputedStyle(t).getPropertyValue("color");return document.body.removeChild(t),i}static col2rgb(e){if(!0===this.checkRgb(e))return this.rgbFormat(e);if(!0===this.checkHex(e))return this.rgbFormat(this.hexToRgb(e));const t=this.convert(e);return this.rgbFormat(t)}static col2hex(e){let t=e;return"transparent"===t.toString().toLowerCase()?"#0000":!1===this.checkHex(e)?(!1===this.checkRgb(e)&&(t=this.convert(e)),this.rgbToHex(parseInt(this.rgbFormat(t)[0]),parseInt(this.rgbFormat(t)[1]),parseInt(this.rgbFormat(t)[2]))):e}static rgbToObj(e){const t=["red","green","blue","alpha"],i=e.slice(e.indexOf("(")+1,e.indexOf(")")).split(","),s={};return i.forEach((e,i)=>{s[t[i]]=Number(e.trim())}),s}},Ch5ColorChip=class e extends Ch5Common{static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,sendeventonclick:{direction:"event",booleanJoin:1,contractName:!0},receivestateredvalue:{direction:"state",numericJoin:1,contractName:!0},receivestategreenvalue:{direction:"state",numericJoin:1,contractName:!0},receivestatebluevalue:{direction:"state",numericJoin:1,contractName:!0},sendeventcolorredonchange:{direction:"event",numericJoin:1,contractName:!0},sendeventcolorgreenonchange:{direction:"event",numericJoin:1,contractName:!0},sendeventcolorblueonchange:{direction:"event",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:"rgb(0,0,0)",name:"previewColor",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"rgb(0,0,0)",isObservableProperty:!0},{default:255,name:"maxValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:255,numberProperties:{min:50,max:65535,conditionalMin:50,conditionalMax:65535,conditionalMinValue:50,conditionalMaxValue:65535},isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnClick",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateRedValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateGreenValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateBlueValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventColorRedOnChange",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventColorGreenOnChange",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventColorBlueOnChange",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-color-chip";primaryCssClass="ch5-color-chip";_ch5Properties;_elContainer={};redValue=0;greenValue=0;blueValue=0;_onClick=null;set previewColor(e){this._ch5Properties.set("previewColor",e,()=>{this.handlePreviewColor()})}get previewColor(){return this._ch5Properties.get("previewColor")}set maxValue(e){this._ch5Properties.set("maxValue",e)}get maxValue(){return this._ch5Properties.get("maxValue")}set sendEventOnClick(e){this._ch5Properties.set("sendEventOnClick",e)}get sendEventOnClick(){return this._ch5Properties.get("sendEventOnClick")}set receiveStateRedValue(e){this._ch5Properties.set("receiveStateRedValue",e,null,e=>{const t=Ch5ColorUtils.getDigitalValue(e,this.maxValue);e<=this.maxValue&&this.redValue!==t&&(this.redValue=t,this.handleSendSignals("red"))})}get receiveStateRedValue(){return this._ch5Properties.get("receiveStateRedValue")}set receiveStateGreenValue(e){this._ch5Properties.set("receiveStateGreenValue",e,null,e=>{const t=Ch5ColorUtils.getDigitalValue(e,this.maxValue);e<=this.maxValue&&this.greenValue!==t&&(this.greenValue=t,this.handleSendSignals("green"))})}get receiveStateGreenValue(){return this._ch5Properties.get("receiveStateGreenValue")}set receiveStateBlueValue(e){this._ch5Properties.set("receiveStateBlueValue",e,null,e=>{const t=Ch5ColorUtils.getDigitalValue(e,this.maxValue);e<=this.maxValue&&this.blueValue!==t&&(this.blueValue=t,this.handleSendSignals("blue"))})}get receiveStateBlueValue(){return this._ch5Properties.get("receiveStateBlueValue")}set sendEventColorRedOnChange(e){this._ch5Properties.set("sendEventColorRedOnChange",e)}get sendEventColorRedOnChange(){return this._ch5Properties.get("sendEventColorRedOnChange")}set sendEventColorGreenOnChange(e){this._ch5Properties.set("sendEventColorGreenOnChange",e)}get sendEventColorGreenOnChange(){return this._ch5Properties.get("sendEventColorGreenOnChange")}set sendEventColorBlueOnChange(e){this._ch5Properties.set("sendEventColorBlueOnChange",e)}get sendEventColorBlueOnChange(){return this._ch5Properties.get("sendEventColorBlueOnChange")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.ignoreAttributes=["receivestatecustomclass","receivestatecustomstyle","receivestatehidepulse","receivestateshowpulse","sendeventonshow","customstyle"],this.logger.start("constructor()",e.ELEMENT_NAME),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this._onClick=this.handleSendEventOnClick.bind(this)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-color-chip attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5ColorChip),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),customElements.whenDefined("ch5-color-chip").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()",e.ELEMENT_NAME),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this._elContainer=document.createElement("div"),this._elContainer.classList.add("ch5-color-chip"),this.appendChild(this._elContainer),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),this._elContainer.addEventListener("click",this._onClick)}removeEventListeners(){super.removeEventListeners(),this._elContainer.removeEventListener("click",this._onClick)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}handlePreviewColor(){const e=Ch5ColorUtils.col2rgb(this.previewColor);!e||this.hasAttribute("receiveStateBlueValue")||this.hasAttribute("receiveStateGreenValue")||this.hasAttribute("receiveStateRedValue")||(this.redValue=Number(e[0]),this.greenValue=Number(e[1]),this.blueValue=Number(e[2]),this._elContainer.style.backgroundColor=`rgb(${e[0]}, ${e[1]}, ${e[2]})`),this.previewColor=`rgb(${this.redValue}, ${this.greenValue}, ${this.blueValue})`}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}handleSendSignals(e){var t,i,s;"red"===e&&""!==this.sendEventColorRedOnChange?null==(t=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventColorRedOnChange))||t.publish(Ch5ColorUtils.getAnalogValue(this.redValue,this.maxValue)):"green"===e&&""!==this.sendEventColorGreenOnChange?null==(i=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventColorGreenOnChange))||i.publish(Ch5ColorUtils.getAnalogValue(this.greenValue,this.maxValue)):"blue"===e&&""!==this.sendEventColorBlueOnChange&&(null==(s=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventColorBlueOnChange))||s.publish(Ch5ColorUtils.getAnalogValue(this.blueValue,this.maxValue))),this._elContainer.style.backgroundColor=`rgb(${this.redValue}, ${this.greenValue}, ${this.blueValue})`}handleSendEventOnClick(){var e,t;this.sendEventOnClick&&(null==(e=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick))||e.publish(!0),null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick))||t.publish(!1))}};Ch5ColorChip.registerCustomElement(),Ch5ColorChip.registerSignalAttributeTypes();import*as mycolorpicker from"@raghavendradabbir/mycolorpicker";import{Subject as Subject3}from"rxjs";var ColorPicker=class{constructor(e,t){this.pickerId=e,this.colorChanged=new Subject3;try{this.joe=mycolorpicker.hsl(this.pickerId,t,[]).on("change",e=>{var t;const i=document.getElementById(this.pickerId);if(i){const e=i.querySelectorAll(".oned")[0].querySelectorAll(".shape")[0];e.style.backgroundColor="#d8d8d8",e.style.borderColor="#696969";i.querySelectorAll(".extras")[0].style.display="none"}const s=Ch5ColorUtils.rgbToObj(e.css());null==(t=this.colorChanged)||t.next([s.red,s.green,s.blue])}).update()}catch(e){}}pickerId;joe=null;colorChanged;invertHex(e){var t;return"#"+(null==(t=e.match(/[a-f0-9]{2}/gi))?void 0:t.map(e=>(255-parseInt(e,16)||0).toString(16).replace(/^([a-f0-9])$/,"0$1")).join(""))}setColor(e){try{this.joe.set(e)}catch(e){}}get picker(){return this.joe}},Ch5ColorPicker=class e extends Ch5Common{static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateredvalue:{direction:"state",numericJoin:1,contractName:!0},receivestategreenvalue:{direction:"state",numericJoin:1,contractName:!0},receivestatebluevalue:{direction:"state",numericJoin:1,contractName:!0},sendeventcolorredonchange:{direction:"event",numericJoin:1,contractName:!0},sendeventcolorgreenonchange:{direction:"event",numericJoin:1,contractName:!0},sendeventcolorblueonchange:{direction:"event",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:255,name:"maxValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:255,numberProperties:{min:50,max:65535,conditionalMin:50,conditionalMax:65535,conditionalMinValue:50,conditionalMaxValue:65535},isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateRedValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateGreenValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateBlueValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventColorRedOnChange",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventColorGreenOnChange",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventColorBlueOnChange",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-color-picker";primaryCssClass="ch5-color-picker";_ch5Properties;_elContainer={};_elColorPicker={};redValue=0;greenValue=0;blueValue=0;redValuePrevious=0;greenValuePrevious=0;blueValuePrevious=0;pickerId="";colorPicker=null;_colorChangedSubscription=null;COLOR_BLACK="#000000";_dirty=!1;isSendReceiveSignalEqual=!1;sendingValue=!1;receiveingValue=!1;_cleanValue=this.COLOR_BLACK;debounceSendSignals=this.debounce(()=>{this.handleSendSignals(),this.debounceSetColor()},100);debounceSetColor=this.debounce(()=>{this.colorPicker&&!(this.sendingValue&&this.receiveingValue&&this.isSendReceiveSignalEqual||this.sendingValue)&&this.colorPicker.picker.get().css()!==Ch5ColorUtils.hexToRgb(this._cleanValue)&&this.colorPicker.setColor(this._cleanValue),this.receiveingValue=!1},1500);set maxValue(e){this._ch5Properties.set("maxValue",e)}get maxValue(){return this._ch5Properties.get("maxValue")}set receiveStateRedValue(e){this._ch5Properties.set("receiveStateRedValue",e,null,e=>{e<=this.maxValue&&(this.redValuePrevious=this.redValue,this.redValue=Ch5ColorUtils.getDigitalValue(e,this.maxValue),this.setColor())})}get receiveStateRedValue(){return this._ch5Properties.get("receiveStateRedValue")}set receiveStateGreenValue(e){this._ch5Properties.set("receiveStateGreenValue",e,null,e=>{e<=this.maxValue&&(this.greenValuePrevious=this.greenValue,this.greenValue=Ch5ColorUtils.getDigitalValue(e,this.maxValue),this.setColor())})}get receiveStateGreenValue(){return this._ch5Properties.get("receiveStateGreenValue")}set receiveStateBlueValue(e){this._ch5Properties.set("receiveStateBlueValue",e,null,e=>{e<=this.maxValue&&(this.blueValuePrevious=this.blueValue,this.blueValue=Ch5ColorUtils.getDigitalValue(e,this.maxValue),this.setColor())})}get receiveStateBlueValue(){return this._ch5Properties.get("receiveStateBlueValue")}set sendEventColorRedOnChange(e){this._ch5Properties.set("sendEventColorRedOnChange",e)}get sendEventColorRedOnChange(){return this._ch5Properties.get("sendEventColorRedOnChange")}set sendEventColorGreenOnChange(e){this._ch5Properties.set("sendEventColorGreenOnChange",e)}get sendEventColorGreenOnChange(){return this._ch5Properties.get("sendEventColorGreenOnChange")}set sendEventColorBlueOnChange(e){this._ch5Properties.set("sendEventColorBlueOnChange",e)}get sendEventColorBlueOnChange(){return this._ch5Properties.get("sendEventColorBlueOnChange")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=["receivestatecustomclass","receivestatecustomstyle","receivestatehidepulse","receivestateshowpulse","sendeventonshow"],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-color-picker attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5ColorPicker),this._elContainer.classList.add("ch5-color-picker"),this._elContainer.parentElement!==this&&(this._elColorPicker=document.createElement("div"),this.pickerId=this.getCrId(),this._elColorPicker.setAttribute("id",this.pickerId),this._elContainer.appendChild(this._elColorPicker),this.appendChild(this._elContainer)),this.colorPicker=new ColorPicker(this.pickerId,this._cleanValue),this._colorChangedSubscription=this.colorPicker.colorChanged.subscribe(e=>{e.length>0&&this.colorPicker&&(this.redValuePrevious===e[0]&&this.greenValuePrevious===e[1]&&this.blueValuePrevious===e[2]||(this.redValue=e[0],this.greenValue=e[1],this.blueValue=e[2],this.debounceSendSignals(),this._dirty=!0,this.isSendReceiveSignalEqual&&(this._cleanValue=Ch5ColorUtils.rgbToHex(this.redValue,this.greenValue,this.blueValue))))}),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),customElements.whenDefined("ch5-color-picker").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()",e.ELEMENT_NAME),this._elColorPicker.replaceChildren(),this.removeEventListeners(),this.unsubscribeFromSignals(),null!==this._colorChangedSubscription&&(this._colorChangedSubscription.unsubscribe(),this._colorChangedSubscription=null),this.logger.stop()}setColor(){this.receiveingValue=!0,this.redValuePrevious===this.redValue&&this.greenValuePrevious===this.greenValue&&this.blueValuePrevious===this.blueValue&&!0===this._dirty&&(this.isSendReceiveSignalEqual=!0);const e=Ch5ColorUtils.rgbToHex(this.redValue,this.greenValue,this.blueValue);this._cleanValue=e,this.colorPicker&&this.colorPicker.picker.get().css()!==Ch5ColorUtils.hexToRgb(e)&&this.debounceSetColor()}createInternalHtml(){this.logger.start("createInternalHtml"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners()}removeEventListeners(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}handleSendSignals(){var e,t,i;if(this.sendingValue=!0,this.colorPicker){const e=Ch5ColorUtils.rgbFormat(this.colorPicker.picker.get().css());this.redValue=Number(e[0]),this.greenValue=Number(e[1]),this.blueValue=Number(e[2])}""!==this.sendEventColorRedOnChange&&this.redValue!==this.redValuePrevious&&(null==(e=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventColorRedOnChange))||e.publish(Ch5ColorUtils.getAnalogValue(this.redValue,this.maxValue))),""!==this.sendEventColorGreenOnChange&&this.greenValue!==this.greenValuePrevious&&(null==(t=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventColorGreenOnChange))||t.publish(Ch5ColorUtils.getAnalogValue(this.greenValue,this.maxValue))),""!==this.sendEventColorBlueOnChange&&this.blueValue!==this.blueValuePrevious&&(null==(i=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventColorBlueOnChange))||i.publish(Ch5ColorUtils.getAnalogValue(this.blueValue,this.maxValue))),this.receiveingValue||(this.sendingValue=!1)}};Ch5ColorPicker.registerCustomElement(),Ch5ColorPicker.registerSignalAttributeTypes();var Ch5AttrsLog=class{static info(e,t,...i){const s=(new Date).toISOString();e&&console.info(s,"Ch5CustomAttributes",":",t,i)}},Ch5AttrsMutationObserver=class{_mutationsObserver=null;_mutationsObserverConfig={};_skipedNodesNamesPrefix="ch5-";_skipedNodesNames=["script","link","style"];_nodeTypesToUse=[0,Node.ELEMENT_NODE];_isValidObserver(e){return e instanceof MutationObserver}startBodyMutationsObserver(){this._mutationsObserver&&this._isValidObserver(this._mutationsObserver)&&this._mutationsObserver.observe(document,this._mutationsObserverConfig)}stopBodyMutationsObserver(){this._mutationsObserver&&this._isValidObserver(this._mutationsObserver)&&this._mutationsObserver.disconnect()}_hasCh5Attributes(e){const t="function"==typeof e.getAttributeNames?e.getAttributeNames():[];return t.length>0&&t.some(e=>this._mutationsObserverConfig.attributeFilter.indexOf(e)>-1)}_viableForCh5Attributes(e){const t=e.nodeName.toLowerCase();return this._nodeTypesToUse.indexOf(e.nodeType)>-1&&-1===this._skipedNodesNames.indexOf(t)&&-1===t.search(this._skipedNodesNamesPrefix)}_getNodesViableForCh5Attributes(e){let t=[];for(const i of e){this._viableForCh5Attributes(i)&&this._hasCh5Attributes(i)&&t.push(i);const e=this.getChildElementsHavingCh5Attr(i);t=t.concat(e)}return t}_childNodesWereAdded(e){return"childList"===e.type&&e.addedNodes.length>0}_childNodesWereRemoved(e){return"childList"===e.type&&e.removedNodes.length>0}getAllRegularElementsHavingCh5Attr(){return this.getChildElementsHavingCh5Attr(document)}getChildElementsHavingCh5Attr(e){if(!e||void 0===e.querySelectorAll)return[];const t=this._mutationsObserverConfig.attributeFilter.map(e=>`[${e}]`).join(",");return Array.from(e.querySelectorAll(t)).filter(e=>this._viableForCh5Attributes(e))}getNewAttributeValue(e){const t=e.target.getAttribute(e.attributeName),i=e.target.getAttribute("debug");return Ch5AttrsLog.info(i,`The ${e.attributeName} attribute was modified to: \n ${t} (previous value: ${e.oldValue}`,e),t}},CustomAttribute=class{_type=null;get type(){if(!this._type)throw new Error("Type is null ");return this._type}set type(e){this._type=e}},Ch5AttrsShow=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME="data-ch5-show";static NOSHOW_VALUES=["visibility","display","remove"];static DEFAULT_NOSHOW_VALUE="display";static KEEP_SIG_SUBS_ATTR="data-ch5-keep-sig-subscription";static SIGNAL_SUBSCRIPTION_KEY_ATTR="data-ch5-show-subs-key";static checkAndSubscribeToSignal(t){if(t.hasAttribute(e.DATA_CH5_ATTR_NAME)){const i=t.hasAttribute("debug"),s=Ch5SignalFactory.getInstance(),n=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",r=Ch5Signal.getSubscriptionSignalName(n),a=s.getBooleanSignal(r);if(a){const s=a.subscribe(i=>{e.handleDataCh5ShowReceived(t,i)});Ch5AttrsLog.info(i,`Signal subscription complete... ${s}`,t),t.setAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR,s)}}}static handleElAddedToDOM(t){if(t.hasAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)){const i=t.hasAttribute("debug");Ch5AttrsLog.info(i,`Added node already has data-ch5-show \n subs: ${t.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)}`,t)}else e.checkAndSubscribeToSignal(t)}static elHasRemovableSigSubscription(t){return t.hasAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)&&t.hasAttribute(e.DATA_CH5_ATTR_NAME)&&!t.hasAttribute(e.KEEP_SIG_SUBS_ATTR)}static unsubscribeDataCh5ShowSig(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);s&&s.unsubscribe(t)}static removeSigSubscription(t){const i=t.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||"";Ch5AttrsLog.info(!0,`Node removed without using signal value... signal subscription: \n ${i} needs to be canceled`,t);const s=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"";e.unsubscribeDataCh5ShowSig(s,i)}static handleCh5ShowAttributeChange(t,i,s){const n=s.hasAttribute("debug"),r=s.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||"";"string"==typeof i&&""!==i&&""!==r&&(Ch5AttrsLog.info(n,`Unsubscribing ${r}`,s),this.unsubscribeDataCh5ShowSig(i,r),s.removeAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)),"string"==typeof t&&""!==t&&e.checkAndSubscribeToSignal(s)}static getNoShowType(t){let i="";if(t.hasAttribute("data-ch5-noshow-type"))i=t.getAttribute("data-ch5-noshow-type")||"";else switch(t.tagName.toLowerCase()){case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":i="display";break;case"div":i="remove";break;default:i="visibility"}return e.NOSHOW_VALUES.indexOf(i)>-1?i:e.DEFAULT_NOSHOW_VALUE}static handleDataCh5ShowReceived(t,i){if(i)e.showElement(t);else{const i=e.getNoShowType(t);e.hideElement(t,i)}}static hideElement(t,i){switch(Ch5AttrsLog.info(t.hasAttribute("debug"),`Hide element using NOSHOW_TYPE: ${i}`,t),i){case"display":t.classList.add("ch5-hide-dis"),t.classList.remove("ch5-hide-vis");break;case"visibility":t.classList.add("ch5-hide-vis"),t.classList.remove("ch5-hide-dis");break;default:t.setAttribute(e.KEEP_SIG_SUBS_ATTR,"");const i=t.parentElement,s=t.nextSibling;i&&(i.removeChild(t),t.cachedP=i),s&&(t.sib=s)}}static showElement(t){const i=t.cachedP;let s="Element visibility/display restored.";const n=[t];if(i){const r=t.sib;n.push(i),r&&i===r.parentElement?(i.insertBefore(t,r),s="Element re-stamped to DOM using cached parent and sibling elements. "+s,n.push(r),delete t.sib):(i.appendChild(t),s="Element re-stamped to DOM using only cached parent, no sibling element required. "+s),delete t.cachedP,t.removeAttribute(e.KEEP_SIG_SUBS_ATTR)}Ch5AttrsLog.info(t.hasAttribute("debug"),s,...n),t.classList.remove("ch5-hide-vis"),t.classList.remove("ch5-hide-dis")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addCustomAttributeEntry(e.DATA_CH5_ATTR_NAME,{direction:"state",booleanJoin:1,contractName:!0})}};Ch5AttrsShow.registerSignalAttributeTypes();var Ch5AttrsShowPulse=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME="data-ch5-showpulse";static NOSHOW_VALUES=["visibility","display","remove"];static DEFAULT_NOSHOW_VALUE="display";static KEEP_SIG_SUBS_ATTR="data-ch5-keep-sig-subscription";static SIGNAL_SUBSCRIPTION_KEY_ATTR="data-ch5-show-pulse-subs-key";static checkAndSubscribeToSignal(t){if(t.hasAttribute("data-ch5-noshow-type")){const i=e.getNoShowType(t);e.hideElement(t,i)}if(t.hasAttribute(e.DATA_CH5_ATTR_NAME)){const i=t.hasAttribute("debug"),s=Ch5SignalFactory.getInstance(),n=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",r=Ch5Signal.getSubscriptionSignalName(n),a=s.getBooleanSignal(r);if(null!==a){const s=a.subscribe(i=>{!1===a.prevValue&&!0===i&&e.handleDataCh5ShowPulseReceived(t,i)});Ch5AttrsLog.info(i,`Signal subscription complete... ${s}`,t),t.setAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR,s)}}}static handleElAddedToDOM(t){if(t.hasAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)){const i=t.hasAttribute("debug");Ch5AttrsLog.info(i,`Added node already has data-ch5-showpulse \n subs: ${t.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)}`,t)}else e.checkAndSubscribeToSignal(t)}static elHasRemovableSigSubscription(t){return t.hasAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)&&t.hasAttribute(e.DATA_CH5_ATTR_NAME)&&!t.hasAttribute(e.KEEP_SIG_SUBS_ATTR)}static unsubscribeDataCh5ShowPulseSig(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);s&&s.unsubscribe(t)}static removeSigSubscription(t){const i=t.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||"";Ch5AttrsLog.info(!0,`Node removed without using signal value... signal subscription: \n ${i} needs to be canceled`,t);const s=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"";e.unsubscribeDataCh5ShowPulseSig(s,i)}static handleCh5ShowPulseAttributeChange(t,i,s){const n=s.hasAttribute("debug"),r=s.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||"";"string"==typeof i&&""!==i&&""!==r&&(Ch5AttrsLog.info(n,`Unsubscribing ${r}`,s),this.unsubscribeDataCh5ShowPulseSig(i,r),s.removeAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)),"string"==typeof t&&""!==t&&e.checkAndSubscribeToSignal(s)}static handleDataCh5ShowPulseReceived(t,i){i&&e.showElement(t)}static showElement(t){const i=t.cachedP;let s="Element visibility/display restored.";const n=[t];if(i){const r=t.sib;n.push(i),r&&i===r.parentElement?(i.insertBefore(t,r),s="Element re-stamped to DOM using cached parent and sibling elements. "+s,n.push(r),delete t.sib):(i.appendChild(t),s="Element re-stamped to DOM using only cached parent, no sibling element required. "+s),delete t.cachedP,t.removeAttribute(e.KEEP_SIG_SUBS_ATTR)}Ch5AttrsLog.info(t.hasAttribute("debug"),s,...n),t.classList.remove("ch5-hide-vis"),t.classList.remove("ch5-hide-dis")}static getNoShowType(t){let i="";if(t.hasAttribute("data-ch5-noshow-type"))i=t.getAttribute("data-ch5-noshow-type")||"";else switch(t.tagName.toLowerCase()){case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":i="display";break;case"div":i="remove";break;default:i="visibility"}return e.NOSHOW_VALUES.indexOf(i)>-1?i:e.DEFAULT_NOSHOW_VALUE}static hideElement(t,i){switch(Ch5AttrsLog.info(t.hasAttribute("debug"),`Hide element using NOSHOW_TYPE: ${i}`,t),i){case"display":t.classList.add("ch5-hide-dis"),t.classList.remove("ch5-hide-vis");break;case"visibility":t.classList.add("ch5-hide-vis"),t.classList.remove("ch5-hide-dis");break;default:t.setAttribute(e.KEEP_SIG_SUBS_ATTR,"");const i=t.parentElement,s=t.nextSibling;i&&(i.removeChild(t),t.cachedP=i),s&&(t.sib=s)}}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addCustomAttributeEntry(e.DATA_CH5_ATTR_NAME,{direction:"state",booleanJoin:1,contractName:!0})}};Ch5AttrsShowPulse.registerSignalAttributeTypes();var Ch5AttrsHidePulse=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME="data-ch5-hidepulse";static NOSHOW_VALUES=["visibility","display","remove"];static DEFAULT_NOSHOW_VALUE="display";static KEEP_SIG_SUBS_ATTR="data-ch5-keep-sig-subscription";static SIGNAL_SUBSCRIPTION_KEY_ATTR="data-ch5-hide-pulse-subs-key";static checkAndSubscribeToSignal(t){if(t.hasAttribute(e.DATA_CH5_ATTR_NAME)){const i=t.hasAttribute("debug"),s=Ch5SignalFactory.getInstance(),n=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",r=Ch5Signal.getSubscriptionSignalName(n),a=s.getBooleanSignal(r);if(null!==a){const s=a.subscribe(i=>{!1===a.prevValue&&!0===i&&e.handleDataCh5HidePulseReceived(t,i)});Ch5AttrsLog.info(i,`Signal subscription complete... ${s}`,t),t.setAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR,s)}}}static handleElAddedToDOM(t){if(t.hasAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)){const i=t.hasAttribute("debug");Ch5AttrsLog.info(i,`Added node already has data-ch5-show \n subs: ${t.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)}`,t)}else e.checkAndSubscribeToSignal(t)}static elHasRemovableSigSubscription(t){return t.hasAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)&&t.hasAttribute(e.DATA_CH5_ATTR_NAME)&&!t.hasAttribute(e.KEEP_SIG_SUBS_ATTR)}static unsubscribeDataCh5HidePulseSig(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);s&&s.unsubscribe(t)}static removeSigSubscription(t){const i=t.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||"";Ch5AttrsLog.info(!0,`Node removed without using signal value... signal subscription: \n ${i} needs to be canceled`,t);const s=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"";e.unsubscribeDataCh5HidePulseSig(s,i)}static handleCh5HidePulseAttributeChange(t,i,s){const n=s.hasAttribute("debug"),r=s.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||"";"string"==typeof i&&""!==i&&""!==r&&(Ch5AttrsLog.info(n,`Unsubscribing ${r}`,s),this.unsubscribeDataCh5HidePulseSig(i,r),s.removeAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)),"string"==typeof t&&""!==t&&e.checkAndSubscribeToSignal(s)}static getNoShowType(t){let i="";if(t.hasAttribute("data-ch5-noshow-type"))i=t.getAttribute("data-ch5-noshow-type")||"";else switch(t.tagName.toLowerCase()){case"p":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":i="display";break;case"div":i="remove";break;default:i="visibility"}return e.NOSHOW_VALUES.indexOf(i)>-1?i:e.DEFAULT_NOSHOW_VALUE}static handleDataCh5HidePulseReceived(t,i){if(i){const i=e.getNoShowType(t);e.hideElement(t,i)}}static hideElement(t,i){switch(Ch5AttrsLog.info(t.hasAttribute("debug"),`Hide element using NOSHOW_TYPE: ${i}`,t),i){case"display":t.classList.add("ch5-hide-dis"),t.classList.remove("ch5-hide-vis");break;case"visibility":t.classList.add("ch5-hide-vis"),t.classList.remove("ch5-hide-dis");break;default:t.setAttribute(e.KEEP_SIG_SUBS_ATTR,"");const i=t.parentElement,s=t.nextSibling;i&&(i.removeChild(t),t.cachedP=i),s&&(t.sib=s)}}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addCustomAttributeEntry(e.DATA_CH5_ATTR_NAME,{direction:"state",booleanJoin:1,contractName:!0})}};Ch5AttrsHidePulse.registerSignalAttributeTypes();var Ch5AttrsTextContent=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME="data-ch5-textcontent";static CH5_ATTR_SIG_SUB_KEY="data-ch5-sub-key";static handleBeingAddedToDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.getAttribute(e.CH5_ATTR_SIG_SUB_KEY);""!==s&&e.handleUnsubscribe(t,i,s),e.handleSubscribe(t,i)}static handleBeingRemovedFromDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.getAttribute(e.CH5_ATTR_SIG_SUB_KEY);e.handleUnsubscribe(t,i,s)}static handleSubscribe(t,i){const s=t.hasAttribute("debug");if(Ch5AttrsLog.info(s,`handleSubscribe ${i}`,t),""===i)return"";let n=t.textContent;const r=Ch5Signal.getSubscriptionSignalName(i),a=Ch5SignalFactory.getInstance().getStringSignal(r);let l="";return null!==a&&(l=a.subscribe(e=>{t.textContent!==e&&(t.textContent=Ch5TranslationUtility.getInstance().translatedValue(e),Ch5AttrsLog.info(s,`textContent changed from ${n} to ${t.textContent}`,t),n=t.textContent)}),t.setAttribute(e.CH5_ATTR_SIG_SUB_KEY,l)),Ch5AttrsLog.info(s,` subscribed to ${i}, subKey is ${l}`,t),l}static handleUnsubscribe(e,t,i){const s=e.hasAttribute("debug");if(Ch5AttrsLog.info(s,`handleUnsubscribe ${t}`,e),""===t||""===i)return;Ch5AttrsLog.info(s,` preparing to unsubscribe from ${t} with subKey: ${i}`,e);const n=Ch5Signal.getSubscriptionSignalName(t),r=Ch5SignalFactory.getInstance().getStringSignal(n);null!==r&&""!==i&&(r.unsubscribe(i),Ch5AttrsLog.info(s,` unsubscribed from ${t} with subKey: ${i}`,e))}static handleCh5TextContentAttrChange(t,i,s){if("string"==typeof i&&""!==i){const t=s.getAttribute(e.CH5_ATTR_SIG_SUB_KEY)||"";""!==t&&e.handleUnsubscribe(s,i,t)}"string"==typeof t&&""!==t&&t!==i&&e.handleSubscribe(s,t)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addCustomAttributeEntry(e.DATA_CH5_ATTR_NAME,{direction:"state",stringJoin:1,contractName:!0})}};Ch5AttrsTextContent.registerSignalAttributeTypes();var Ch5AttrsInnerhtml=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME="data-ch5-innerhtml";static CH5_ATTR_SIG_SUB_KEY="data-ch5-innerhtml-sub-key";static handleBeingAddedToDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.getAttribute(e.CH5_ATTR_SIG_SUB_KEY);""!==s&&e.handleUnsubscribe(t,i,s),e.handleSubscribe(t,i)}static handleBeingRemovedFromDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.getAttribute(e.CH5_ATTR_SIG_SUB_KEY);e.handleUnsubscribe(t,i,s)}static handleSubscribe(t,i){if(""===i||null===i)return"";const s=t.hasAttribute("debug");Ch5AttrsLog.info(s,`handleSubscribe ${i}`,t);const n=Ch5Signal.getSubscriptionSignalName(i),r=Ch5SignalFactory.getInstance().getStringSignal(n);let a="";return null!==r&&(a=r.subscribe(e=>{t.innerHTML!==e&&(t.innerHTML=e,Ch5AttrsLog.info(s,`innerHTML updated to ${e}`,t))}),t.setAttribute(e.CH5_ATTR_SIG_SUB_KEY,a)),Ch5AttrsLog.info(s,` subscribed to ${i}, subKey is ${a}`,t),a}static handleUnsubscribe(e,t,i){if(""===t||""===i||null===t||null===i)return;const s=e.hasAttribute("debug");Ch5AttrsLog.info(s,`handleUnsubscribe: preparing to unsubscribe from ${t} with subKey: ${i}`,e);const n=Ch5Signal.getSubscriptionSignalName(t),r=Ch5SignalFactory.getInstance().getStringSignal(n);null!==r&&""!==i&&(r.unsubscribe(i),Ch5AttrsLog.info(s,` unsubscribed from ${t} with subKey: ${i}`,e))}static handleCh5InnerhtmlAttrChange(t,i,s){if("string"==typeof i&&""!==i){const t=s.getAttribute(e.CH5_ATTR_SIG_SUB_KEY)||"";""!==t&&e.handleUnsubscribe(s,i,t)}"string"==typeof t&&""!==t&&t!==i&&e.handleSubscribe(s,t)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addCustomAttributeEntry(e.DATA_CH5_ATTR_NAME,{direction:"state",stringJoin:1,contractName:!0})}};Ch5AttrsInnerhtml.registerSignalAttributeTypes();var Ch5AttrsAppendstyle=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME="data-ch5-appendstyle";static CH5_ATTR_SIG_SUB_KEY="data-ch5-appendstyle-sub-key";static handleBeingAddedToDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.getAttribute(e.CH5_ATTR_SIG_SUB_KEY);""!==s&&e.handleUnsubscribe(t,i,s),e.handleSubscribe(t,i)}static handleBeingRemovedFromDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.getAttribute(e.CH5_ATTR_SIG_SUB_KEY);e.handleUnsubscribe(t,i,s)}static handleSubscribe(t,i){if(""===i||null===i)return"";const s=t.hasAttribute("debug");Ch5AttrsLog.info(s,`handleSubscribe ${i}`,t);const n=Ch5Signal.getSubscriptionSignalName(i),r=Ch5SignalFactory.getInstance().getStringSignal(n);let a="";return null!==r&&(a=r.subscribe(e=>{t.style.cssText!==e&&(t.style.cssText=e,Ch5AttrsLog.info(s,`style updated to ${e}`,t))}),t.setAttribute(e.CH5_ATTR_SIG_SUB_KEY,a)),Ch5AttrsLog.info(s,` subscribed to ${i}, subKey is ${a}`,t),a}static handleUnsubscribe(e,t,i){if(""===t||""===i||null===t||null===i)return;const s=e.hasAttribute("debug");Ch5AttrsLog.info(s,`handleUnsubscribe: preparing to unsubscribe from ${t} with subKey: ${i}`,e);const n=Ch5Signal.getSubscriptionSignalName(t),r=Ch5SignalFactory.getInstance().getStringSignal(n);null!==r&&""!==i&&(r.unsubscribe(i),Ch5AttrsLog.info(s,` unsubscribed from ${t} with subKey: ${i}`,e))}static handleCh5AppendstyleAttrChange(t,i,s){if("string"==typeof i&&""!==i){const t=s.getAttribute(e.CH5_ATTR_SIG_SUB_KEY)||"";""!==t&&e.handleUnsubscribe(s,i,t)}"string"==typeof t&&""!==t&&t!==i&&e.handleSubscribe(s,t)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addCustomAttributeEntry(e.DATA_CH5_ATTR_NAME,{direction:"state",stringJoin:1,contractName:!0})}};Ch5AttrsAppendstyle.registerSignalAttributeTypes();var Ch5AttrsAppendclass=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME="data-ch5-appendclass";static CH5_ATTR_SIG_SUB_KEY="data-ch5-appendclass-sub-key";static handleBeingAddedToDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.getAttribute(e.CH5_ATTR_SIG_SUB_KEY);""!==s&&e.handleUnsubscribe(t,i,s),e.handleSubscribe(t,i)}static handleBeingRemovedFromDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.getAttribute(e.CH5_ATTR_SIG_SUB_KEY);e.handleUnsubscribe(t,i,s)}static handleSubscribe(t,i){if(""===i||null===i)return"";const s=t.hasAttribute("debug");Ch5AttrsLog.info(s,`handleSubscribe ${i}`,t);const n=Ch5Signal.getSubscriptionSignalName(i),r=Ch5SignalFactory.getInstance().getStringSignal(n);let a="";return null!==r&&(a=r.subscribe(e=>{const i=e.split(" "),n=t.currentCh5AppendclassVal;if("string"==typeof n&&""!==n){const e=n.split(" ");e.length>0&&e.forEach(e=>{""!==e&&t.classList.contains(e)&&-1===i.indexOf(e)&&t.classList.remove(e)})}i.length>0&&i.forEach(e=>{t.classList.contains(e)||""===e||t.classList.add(e)}),Ch5AttrsLog.info(s,`innerHTML updated to ${e}`,t),t.currentCh5AppendclassVal=e}),t.setAttribute(e.CH5_ATTR_SIG_SUB_KEY,a)),Ch5AttrsLog.info(s,` subscribed to ${i}, subKey is ${a}`,t),a}static handleUnsubscribe(e,t,i){if(""===t||""===i||null===t||null===i)return;const s=e.hasAttribute("debug");Ch5AttrsLog.info(s,`handleUnsubscribe: preparing to unsubscribe from ${t} with subKey: ${i}`,e);const n=Ch5Signal.getSubscriptionSignalName(t),r=Ch5SignalFactory.getInstance().getStringSignal(n);null!==r&&""!==i&&(r.unsubscribe(i),Ch5AttrsLog.info(s,` unsubscribed from ${t} with subKey: ${i}`,e))}static handleCh5AppendclassAttrChange(t,i,s){if("string"==typeof i&&""!==i){const t=s.getAttribute(e.CH5_ATTR_SIG_SUB_KEY)||"";""!==t&&e.handleUnsubscribe(s,i,t)}"string"==typeof t&&""!==t&&t!==i&&e.handleSubscribe(s,t)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addCustomAttributeEntry(e.DATA_CH5_ATTR_NAME,{direction:"state",stringJoin:1,contractName:!0})}};Ch5AttrsAppendclass.registerSignalAttributeTypes();var CH5_I18N_ATTRIBUTE_CONSTANT={dataCh5AttrName:"data-ch5-i18n",elementIdPrefix:"ch5_translate_",randomNumberLength:10,subAttributePosition:2,subAttributeType:"inner",defaultIndex:-1};function randomFixedInteger(e){let t=0;return t=Math.floor(Math.pow(10,e-1)+Math.random()*(Math.pow(10,e)-Math.pow(10,e-1)-1)),t}var Ch5AttrsI18n=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME=CH5_I18N_ATTRIBUTE_CONSTANT.dataCh5AttrName;static DATA_CH5_EL_ID_PREFIX=CH5_I18N_ATTRIBUTE_CONSTANT.elementIdPrefix;static RANDOM_NUMBER_LENGTH=CH5_I18N_ATTRIBUTE_CONSTANT.randomNumberLength;static EXPECTED_SUBATTRIBUTE_POSITION=CH5_I18N_ATTRIBUTE_CONSTANT.subAttributePosition;static SUBATTRIBUTE_TYPE=CH5_I18N_ATTRIBUTE_CONSTANT.subAttributeType;translatableData=[];initialIndexValue=CH5_I18N_ATTRIBUTE_CONSTANT.defaultIndex;updateOnChange(){this.removeExtraNode(),this.translatableData.map((e,t)=>{const i=document.getElementById(e.uniqueElementId),s=i.getAttribute(e.attributeName)||"";this.updateValueToDom(i,s,t)})}handleBeingAddedToDom(t){const i=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",s=t.hasAttribute("debug");if(!t.id){const i=e.DATA_CH5_EL_ID_PREFIX+randomFixedInteger(e.RANDOM_NUMBER_LENGTH).toString();t.setAttribute("id",i),Ch5AttrsLog.info(s,`unique id:-${i} added to element`,t)}this.updateValueToDom(t,i)}getTextDisplayInfo(t){const i={typeOfAttribute:"",attributeSelector:"",valueToTranslate:"",hasAttribute:!1},s=t.trim(),n=s.match(/\[(.*?)\]/);if(!s&&!n)return i;if(s.indexOf("[")===e.EXPECTED_SUBATTRIBUTE_POSITION){const[e,t]=s.match(/\[(.*?)\]/)[1].split("=");i.valueToTranslate=s.replace(s.match(/\[(.*?)\]/)[0],""),i.typeOfAttribute=e,i.attributeSelector=t,i.hasAttribute=!0}return i}updateValueToDom(t,i,s=this.initialIndexValue){const n=t.hasAttribute("debug");s===this.initialIndexValue&&this.translatableData&&this.removeExtraNode();const r=this.getTextDisplayInfo(i);let a="";if(r.hasAttribute)if(a=this.getTranslatedValue(t,r.valueToTranslate,s),r.typeOfAttribute===e.SUBATTRIBUTE_TYPE){t.querySelector(r.attributeSelector).innerHTML=a,Ch5AttrsLog.info(n,`updated value ${a} to inner html`,t)}else t.hasAttribute(r.attributeSelector)&&t.removeAttribute(r.attributeSelector),t.setAttribute(r.attributeSelector,a),Ch5AttrsLog.info(n,`updated value ${a} of atrribute ${r.attributeSelector}`,t);else a=this.getTranslatedValue(t,i,s),t.innerHTML=a,Ch5AttrsLog.info(n,`updated text content ${a} `,t)}checkElementExistInDom(e){return!!document.getElementById(e)}removeExtraNode(){this.translatableData=this.translatableData.filter(e=>this.checkElementExistInDom(e.uniqueElementId))}getTranslatedValue(t,i,s=this.initialIndexValue){const n={},r=Ch5TranslationUtility.getInstance().isTranslationIdentifier(i)?this.doTranslation(i):"";return r&&(n.uniqueElementId=t.id,n.attributeName=e.DATA_CH5_ATTR_NAME,n.attributeValue=i,s!==this.initialIndexValue?this.translatableData[s]=n:this.translatableData.push(n)),r}doTranslation(e){let t=e;const i=Ch5TranslationUtility.getInstance(),s=i.valuesToTranslation(e);return s&&s.length>0&&s.forEach(e=>{if(i.isTranslationIdentifier(e)){const s=i.stripDownTranslationCharacters(e);if(i.getTranslator().exists(s)){const n=i.getTranslator().t(s);t=t.replace(e,n)}}}),t}},Ch5AttrsEnable=class e extends CustomAttribute{static DATA_CH5_ATTR_NAME="data-ch5-enable";static KEEP_SIG_SUBS_ATTR="data-ch5-keep-sig-subscription";static SIGNAL_SUBSCRIPTION_KEY_ATTR="data-ch5-enable-subs-key";static checkAndSubscribeToSignal(t){if(t.hasAttribute(e.DATA_CH5_ATTR_NAME)){const i=t.hasAttribute("debug"),s=Ch5SignalFactory.getInstance(),n=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"",r=Ch5Signal.getSubscriptionSignalName(n),a=s.getBooleanSignal(r);if(a){const s=a.subscribe(i=>{e.handleDataCh5EnableReceived(t,i)});Ch5AttrsLog.info(i,`Signal subscription complete... ${s}`,t),t.setAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR,s)}}}static handleElAddedToDOM(t){t.hasAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||e.checkAndSubscribeToSignal(t)}static elHasRemovableSigSubscription(t){return t.hasAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)&&t.hasAttribute(e.DATA_CH5_ATTR_NAME)&&!t.hasAttribute(e.KEEP_SIG_SUBS_ATTR)}static unsubscribeDataCh5EnableSig(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);s&&s.unsubscribe(t)}static removeSigSubscription(t){const i=t.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||"";Ch5AttrsLog.info(!0,`Node removed without using signal value... signal subscription: \n ${i} needs to be canceled`,t);const s=t.getAttribute(e.DATA_CH5_ATTR_NAME)||"";e.unsubscribeDataCh5EnableSig(s,i)}static handleCh5EnableAttributeChange(t,i,s){const n=s.hasAttribute("debug"),r=s.getAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)||"";"string"==typeof i&&""!==i&&""!==r&&(Ch5AttrsLog.info(n,`Unsubscribing ${r}`,s),this.unsubscribeDataCh5EnableSig(i,r),s.removeAttribute(e.SIGNAL_SUBSCRIPTION_KEY_ATTR)),"string"==typeof t&&""!==t&&e.checkAndSubscribeToSignal(s)}static handleDataCh5EnableReceived(e,t){t?e.classList.remove("ch5-disabled"):e.classList.add("ch5-disabled")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addCustomAttributeEntry(e.DATA_CH5_ATTR_NAME,{direction:"state",booleanJoin:1,contractName:!0})}};Ch5AttrsEnable.registerSignalAttributeTypes();var Ch5CustomAttributes=class e extends Ch5AttrsMutationObserver{static preventUnsubscribe=!1;static _instance;static ch5AttrsI18nInstance;_mutationsObserverConfig={attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0,attributeFilter:[Ch5AttrsEnable.DATA_CH5_ATTR_NAME,Ch5AttrsShow.DATA_CH5_ATTR_NAME,Ch5AttrsShowPulse.DATA_CH5_ATTR_NAME,Ch5AttrsHidePulse.DATA_CH5_ATTR_NAME,Ch5AttrsTextContent.DATA_CH5_ATTR_NAME,Ch5AttrsInnerhtml.DATA_CH5_ATTR_NAME,Ch5AttrsAppendstyle.DATA_CH5_ATTR_NAME,Ch5AttrsAppendclass.DATA_CH5_ATTR_NAME,Ch5AttrsI18n.DATA_CH5_ATTR_NAME]};constructor(){super(),e.ch5AttrsI18nInstance=new Ch5AttrsI18n;const t=Ch5SignalFactory.getInstance().getStringSignal(languageChangedSignalName);t&&t.subscribe(t=>{""!==t&&e.ch5AttrsI18nInstance.updateOnChange()})}static getInstance(){return e._instance||(e._instance=new e),e._instance}initCh5Attributes(){"loading"!==document.readyState?this.initCh5AttributesOnLoad():document.addEventListener("DOMContentLoaded",this.initCh5AttributesOnLoad.bind(e._instance))}initCh5AttrsMutationsObserver(){this._mutationsObserver=new MutationObserver(this._mutationsCallback.bind(e._instance)),this.startBodyMutationsObserver()}_mutationsCallback(e){for(const t of e)if("attributes"===t.type)this.handleAttributeChanges(t);else{if(this._childNodesWereRemoved(t)){const e=this._getNodesViableForCh5Attributes(t.removedNodes);e.length&&this.handleNodesRemovalFromDOM(e)}if(this._childNodesWereAdded(t)){const e=this._getNodesViableForCh5Attributes(t.addedNodes);e.length&&this.handleNodesStampedIntoDOM(e)}}}initCh5AttributesOnLoad(){const t=this.getAllRegularElementsHavingCh5Attr();if(t.length>0)for(const i of t)i.hasAttribute(Ch5AttrsEnable.DATA_CH5_ATTR_NAME)&&Ch5AttrsEnable.checkAndSubscribeToSignal(i),i.hasAttribute(Ch5AttrsShow.DATA_CH5_ATTR_NAME)&&Ch5AttrsShow.checkAndSubscribeToSignal(i),i.hasAttribute(Ch5AttrsShowPulse.DATA_CH5_ATTR_NAME)&&Ch5AttrsShowPulse.checkAndSubscribeToSignal(i),i.hasAttribute(Ch5AttrsHidePulse.DATA_CH5_ATTR_NAME)&&Ch5AttrsHidePulse.checkAndSubscribeToSignal(i),i.hasAttribute(Ch5AttrsTextContent.DATA_CH5_ATTR_NAME)&&Ch5AttrsTextContent.handleBeingAddedToDom(i),i.hasAttribute(Ch5AttrsInnerhtml.DATA_CH5_ATTR_NAME)&&Ch5AttrsInnerhtml.handleBeingAddedToDom(i),i.hasAttribute(Ch5AttrsAppendstyle.DATA_CH5_ATTR_NAME)&&Ch5AttrsAppendstyle.handleBeingAddedToDom(i),i.hasAttribute(Ch5AttrsAppendclass.DATA_CH5_ATTR_NAME)&&Ch5AttrsAppendclass.handleBeingAddedToDom(i),i.hasAttribute(Ch5AttrsI18n.DATA_CH5_ATTR_NAME)&&e.ch5AttrsI18nInstance.handleBeingAddedToDom(i);this.initCh5AttrsMutationsObserver()}handleNodesStampedIntoDOM(t){t.forEach(t=>{t.hasAttribute(Ch5AttrsEnable.DATA_CH5_ATTR_NAME)&&Ch5AttrsEnable.handleElAddedToDOM(t),t.hasAttribute(Ch5AttrsShow.DATA_CH5_ATTR_NAME)&&Ch5AttrsShow.handleElAddedToDOM(t),t.hasAttribute(Ch5AttrsShowPulse.DATA_CH5_ATTR_NAME)&&Ch5AttrsShowPulse.handleElAddedToDOM(t),t.hasAttribute(Ch5AttrsHidePulse.DATA_CH5_ATTR_NAME)&&Ch5AttrsHidePulse.handleElAddedToDOM(t),t.hasAttribute(Ch5AttrsTextContent.DATA_CH5_ATTR_NAME)&&Ch5AttrsTextContent.handleBeingAddedToDom(t),t.hasAttribute(Ch5AttrsInnerhtml.DATA_CH5_ATTR_NAME)&&Ch5AttrsInnerhtml.handleBeingAddedToDom(t),t.hasAttribute(Ch5AttrsAppendstyle.DATA_CH5_ATTR_NAME)&&Ch5AttrsAppendstyle.handleBeingAddedToDom(t),t.hasAttribute(Ch5AttrsAppendclass.DATA_CH5_ATTR_NAME)&&Ch5AttrsAppendclass.handleBeingAddedToDom(t),t.hasAttribute(Ch5AttrsI18n.DATA_CH5_ATTR_NAME)&&e.ch5AttrsI18nInstance.handleBeingAddedToDom(t)})}handleNodesRemovalFromDOM(t){!0!==e.preventUnsubscribe?t.forEach(e=>{Ch5AttrsEnable.elHasRemovableSigSubscription(e)&&Ch5AttrsEnable.removeSigSubscription(e),Ch5AttrsShow.elHasRemovableSigSubscription(e)&&Ch5AttrsShow.removeSigSubscription(e),Ch5AttrsShowPulse.elHasRemovableSigSubscription(e)&&Ch5AttrsShowPulse.removeSigSubscription(e),Ch5AttrsHidePulse.elHasRemovableSigSubscription(e)&&Ch5AttrsHidePulse.removeSigSubscription(e),e.hasAttribute(Ch5AttrsTextContent.DATA_CH5_ATTR_NAME)&&Ch5AttrsTextContent.handleBeingRemovedFromDom(e),e.hasAttribute(Ch5AttrsInnerhtml.DATA_CH5_ATTR_NAME)&&Ch5AttrsInnerhtml.handleBeingRemovedFromDom(e),e.hasAttribute(Ch5AttrsAppendstyle.DATA_CH5_ATTR_NAME)&&Ch5AttrsAppendstyle.handleBeingRemovedFromDom(e),e.hasAttribute(Ch5AttrsAppendclass.DATA_CH5_ATTR_NAME)&&Ch5AttrsAppendclass.handleBeingRemovedFromDom(e)}):e.preventUnsubscribe=!0}handleAttributeChanges(e){const t=this.getNewAttributeValue(e);e.attributeName===Ch5AttrsEnable.DATA_CH5_ATTR_NAME&&Ch5AttrsEnable.handleCh5EnableAttributeChange(t,e.oldValue,e.target),e.attributeName===Ch5AttrsShow.DATA_CH5_ATTR_NAME&&Ch5AttrsShow.handleCh5ShowAttributeChange(t,e.oldValue,e.target),e.attributeName===Ch5AttrsShowPulse.DATA_CH5_ATTR_NAME&&Ch5AttrsShowPulse.handleCh5ShowPulseAttributeChange(t,e.oldValue,e.target),e.attributeName===Ch5AttrsHidePulse.DATA_CH5_ATTR_NAME&&Ch5AttrsHidePulse.handleCh5HidePulseAttributeChange(t,e.oldValue,e.target),e.attributeName===Ch5AttrsTextContent.DATA_CH5_ATTR_NAME&&Ch5AttrsTextContent.handleCh5TextContentAttrChange(t,e.oldValue,e.target),e.attributeName===Ch5AttrsInnerhtml.DATA_CH5_ATTR_NAME&&Ch5AttrsInnerhtml.handleCh5InnerhtmlAttrChange(t,e.oldValue,e.target),e.attributeName===Ch5AttrsAppendstyle.DATA_CH5_ATTR_NAME&&Ch5AttrsAppendstyle.handleCh5AppendstyleAttrChange(t,e.oldValue,e.target),e.attributeName===Ch5AttrsAppendclass.DATA_CH5_ATTR_NAME&&Ch5AttrsAppendclass.handleCh5AppendclassAttrChange(t,e.oldValue,e.target)}};Ch5CustomAttributes.getInstance().initCh5Attributes();import _16 from"lodash";var CH5DpadUtils=class{static sendEventOnClickSigCountToAdd={up:0,down:1,left:2,right:3,center:4};static contractSuffix={up:"Up",down:"Down",left:"Left",right:"Right",center:"Center"}},ComponentHelper=class e{static instance;constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}static getAttributeAsString(e,t,i=""){let s=i;return t=t.toLowerCase(),e&&e.hasAttribute([t])&&(s=e.getAttribute([t])),s}static getAttributeAsBool(e,t,i){let s=i;return t=t.toLowerCase(),e.hasAttribute([t])&&(s="true"===e.getAttribute([t])||!0===e.getAttribute([t])),s}static clearComponentContent(e){const t=e.getElementsByClassName(e.primaryCssClass);Array.from(t).forEach(e=>{e.remove()})}static isNullOrUndefined(e){return null==e}static setAttributeToElement(e,t,i){t=t.toLowerCase();let s=null===i?"":i;return!e.hasAttribute(t)&&s.length>0?e.setAttribute(t,s):e.hasAttribute(t)&&(s=e.getAttribute(t)),s}static getBoolFromString(t){return!e.isNullOrUndefined(t)&&"true"===t}static clearSignalValue(e,t,i,s){if(""!==t[i]&&""!==t[s]){const n=Ch5Signal.getSubscriptionSignalName(t[s]),r=e.getStringSignal(n);null!==r&&(r.unsubscribe(t[i]),t[s]="")}}static setAttributesBasedValue(e,t,i){return e?t:i}static setAttributeValueOnControl(e,t,i,s,n){const r="_"+t;i!==e[r]&&(s.indexOf(i)>=0?e[r]=i:e[r]=s[0],null!==e[r]&&e.setAttribute(t,e[r]),null!==n&&n())}static setAttributeValueOnControlAsBool(e,t,i,s,n){const r="_"+t;i!==e[r]&&(e[r]="boolean"==typeof i?i:s,null!==e[r]&&e.setAttribute(t,e[r].toString()),null!==n&&n())}};import _15 from"lodash";var Ch5DpadButtonBase=class e extends Ch5Common{_isDisabledOrHiddenButton=!1;_parentDpad;static DEFAULT_ICONS={up:"fa-caret-up",down:"fa-caret-down",left:"fa-caret-left",right:"fa-caret-right",center:"fa-circle"};static COMPONENT_PROPERTIES=[{default:"",name:"key",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"label",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"pressed",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnClick",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,sendeventonclick:{direction:"event",booleanJoin:1,contractName:!0}};PRESSED_CSS_CLASS_SUFFIX="--pressed";LABEL_CLASS="dpad-btn-label";primaryCssClass="";COMPONENT_NAME="";componentPrefix="ch5-dpad-button-";CSS_CLASS_LIST={commonBtnClass:"ch5-dpad-child",primaryIconClass:"fas",imageClassName:"image-url",primaryTagClass:"",defaultIconClass:"",defaultArrowClass:""};_ch5Properties;_icon={};buttonType=null;_pressable=null;_isPressedSubscription=null;_repeatDigitalInterval=null;set label(e){this._ch5Properties.set("label",e,()=>{this.label=this._getTranslatedValue("label",e),this.handleLabel()})}get label(){return this._ch5Properties.get("label")}set key(e){this._ch5Properties.set("key",e,()=>{this.handleKey()})}get key(){return this._ch5Properties.get("key")}set iconClass(e){const t=this.iconClass;this._ch5Properties.set("iconClass",e,()=>{this.handleIconClass(t)})}get iconClass(){return this._ch5Properties.get("iconClass")}set iconUrl(e){this._ch5Properties.set("iconUrl",e,()=>{this.handleIconUrl(e)})}get iconUrl(){return this._ch5Properties.get("iconUrl")}set sendEventOnClick(e){this._ch5Properties.set("sendEventOnClick",e)}get sendEventOnClick(){return this._ch5Properties.get("sendEventOnClick")}set pressed(e){this._ch5Properties.set("pressed",e,()=>{this.handlePressed()})}get pressed(){return this._ch5Properties.get("pressed")}constructor(t,i=!1){super(),this.logger.start("constructor()",this.COMPONENT_NAME),this._isDisabledOrHiddenButton=i,_15.isNil(t)?this._parentDpad=this.getParentDpad():this._parentDpad=t,this.ignoreAttributes=["show","disabled","receivestateenable","receivestateshow","receivestateshowpulse","receivestatehidepulse","receivestatecustomclass","receivestatecustomstyle","sendeventonshow"],this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),ComponentHelper.clearComponentContent(this),this.logger.stop()}initializeParams(e,t,i){this.buttonType=i,this.COMPONENT_NAME=this.componentPrefix+i,this.CSS_CLASS_LIST.primaryTagClass=i,this.CSS_CLASS_LIST.defaultIconClass=e,Ch5Common.isNotNil(t)&&(this.CSS_CLASS_LIST.defaultArrowClass=t),this.primaryCssClass=this.componentPrefix+i,!1===this.getDisabledOrHiddenDpadCenterButton()&&this.updatePressedClass(this.primaryCssClass+this.PRESSED_CSS_CLASS_SUFFIX)}getParentDpad(){const e=t=>{var i;return _15.isNil(t)||"CH5-DPAD"===t.nodeName.toString().toUpperCase()?t:e(null==(i=t.parentNode)?void 0:i.parentNode)};return e(this.parentElement)}getDisabledOrHiddenDpadCenterButton(){return!1===this._isDisabledOrHiddenButton&&"center"===this.key&&(!0!==this._parentDpad.hideCenterButton&&!0!==this._parentDpad.disableCenterButton||this.setDisabledOrHidden(!0)),this._isDisabledOrHiddenButton}setDisabledOrHidden(e){var t;this._isDisabledOrHiddenButton=e,!0===this._isDisabledOrHiddenButton?(this.pressed=!1,null!==this._pressable&&this._pressable.destroy(),this._unsubscribeFromPressableIsPressed(),this._pressable=null):(_15.isNil(this._pressable)&&(this._pressable=new Ch5Pressable(this,{cssTargetElement:this.getTargetElementForCssClassesAndStyle(),cssPressedClass:this.primaryCssClass+this.PRESSED_CSS_CLASS_SUFFIX,enableSwipe:this._parentDpad.swipeGestureEnabled,touchMove:!0}),null==(t=this._pressable)||t.init()),null===this._isPressedSubscription&&this._subscribeToPressableIsPressed())}updateSwipeGesture(){null===this._pressable||_15.isNil(this._pressable.options)||(this._pressable.options.enableSwipe=this._parentDpad.swipeGestureEnabled)}connectedCallback(){if(this.logger.start("connectedCallback() - start",this.COMPONENT_NAME),this.parentElement&&(!this.parentElement||"ch5-dpad"!==this.parentElement.nodeName.toLowerCase())){if(this.parentElement&&this.parentElement.parentElement&&!(this.parentElement.parentElement instanceof Ch5Dpad))throw new Error("Invalid parent element for ch5-dpad-button. \n Please ensure the parent tag is ch5-dpad, and other mandatory sibling \n elements are available too.");this.setAttribute("data-ch5-id",this.getCrId()),this.createElementsAndInitialize(),_15.isNil(this._pressable)||!1!==this.getDisabledOrHiddenDpadCenterButton()||(this._pressable.init(),this._subscribeToPressableIsPressed()),this.initAttributes(),customElements.whenDefined("ch5-dpad-button").then(()=>{this.initCommonMutationObserver(this)}),this.logger.stop()}}createIconTag(){(void 0===this._icon.classList||this._icon.classList.length<=0)&&(this._icon=document.createElement("span"))}createElementsAndInitialize(){this._wasInstatiated||this.createIconTag(),this.initAttributes(),this._wasInstatiated||(this.createHtmlElements(),this._wasInstatiated=!0),this.attachEventListeners(),this.updateCssClasses()}createHtmlElements(){this.logger.start("createHtmlElements",this.COMPONENT_NAME),Ch5Common.isNotNil(this.primaryCssClass)&&this.classList.add(this.primaryCssClass),this.classList.add(this.CSS_CLASS_LIST.commonBtnClass),Ch5Common.isNotNil(this.CSS_CLASS_LIST.primaryTagClass)&&this.classList.add(this.CSS_CLASS_LIST.primaryTagClass),Ch5Common.isNotNil(this.CSS_CLASS_LIST.defaultArrowClass)&&this.classList.add(this.CSS_CLASS_LIST.defaultArrowClass),this.iconUrl.length>0?(this._icon=this.getImageContainer(this.iconUrl),this._icon.style.backgroundImage=`url(${this.iconUrl})`):this.iconClass?(this._icon=this.getIconContainer(),this._icon.classList.add(...this.iconClass.split(" ").filter(e=>e))):this.label.length>0&&"center"===this.key?(this._icon=this.getLabelContainer(this.LABEL_CLASS),this._icon.innerHTML=this.label):(this._icon=this.getIconContainer(),this._icon.classList.add(this.CSS_CLASS_LIST.primaryIconClass),Ch5Common.isNotNil(this.CSS_CLASS_LIST.defaultIconClass)&&this._icon.classList.add(this.CSS_CLASS_LIST.defaultIconClass)),this._icon.parentElement!==this&&this.appendChild(this._icon),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback() - start",this.COMPONENT_NAME),this.removeEventListeners(),this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver(),this.logger.stop()}removeEventListeners(){this.logger.start("removeEventListeners() - start",this.COMPONENT_NAME),super.removeEventListeners(),this._unsubscribeFromPressableIsPressed(),null!==this._pressable&&this._pressable.destroy(),this.logger.stop()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.COMPONENT_NAME),this.logger.log("ch5-dpad-button key="+this.key+' attributeChangedCallback("'+t+'","'+i+'","'+s+'")'),i!==s){t=t.toLowerCase();const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}initAttributes(){var t,i;this.logger.start("initAttributes",this.COMPONENT_NAME),super.initAttributes(),ComponentHelper.setAttributeToElement(this,"role",Ch5RoleAttributeMapping.ch5DpadChild);const s=this;for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)if(!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[t].name.toLowerCase())){const i=e.COMPONENT_PROPERTIES[t].name;s[i]=this.getAttribute(i)}const n=this.buttonType;if(this.logger.log("btnType",n),this.parentElement&&this.parentElement.parentElement){const e=this.parentElement.parentElement,s=null==(t=ComponentHelper.getAttributeAsString(e,"contractname",""))?void 0:t.trim(),r=null==(i=ComponentHelper.getAttributeAsString(e,"sendeventonclickstart",""))?void 0:i.trim();s.length>0?this.sendEventOnClick=s+"."+CH5DpadUtils.contractSuffix[n]:s.length<=0&&r.length>0?this.sendEventOnClick=(parseInt(r,10)+CH5DpadUtils.sendEventOnClickSigCountToAdd[n]).toString():this.sendEventOnClick=""}this.hasAttribute("pressed")&&this._pressable&&this._pressable.setPressed(this.toBoolean(this.hasAttribute("pressed")&&"false"!==this.getAttribute("pressed"),!1)),this.logger.stop()}attachEventListeners(){var e;super.attachEventListeners(),_15.isNil(this._pressable)||!1!==this.getDisabledOrHiddenDpadCenterButton()||(null==(e=this._pressable)||e.init(),this._subscribeToPressableIsPressed())}updateCssClasses(){super.updateCssClasses()}updatePressedClass(e){this._pressable=new Ch5Pressable(this,{cssTargetElement:this.getTargetElementForCssClassesAndStyle(),cssPressedClass:e,enableSwipe:this._parentDpad.swipeGestureEnabled,touchMove:!0})}handleLabel(){void 0!==this._icon.innerHTML&&(this._icon.classList.remove("dpad-btn-icon","fas",e.DEFAULT_ICONS.center),this._icon.classList.add("dpad-btn-label"),this._icon.innerHTML=this.label)}handleKey(){this.createIconTag(),this.initializeParams(e.DEFAULT_ICONS[this.key],"center"===this.key?"":"direction-btn",this.key)}handleIconClass(e){this.createIconTag(),this.iconUrl.length<1&&(this.iconClass.length>0?(this._icon.classList.remove(this.CSS_CLASS_LIST.primaryIconClass),this.CSS_CLASS_LIST.defaultIconClass&&this._icon.classList.remove(this.CSS_CLASS_LIST.defaultIconClass),this._icon.classList.remove(...e.split(" ").filter(e=>e)),this._icon.classList.add(...this.iconClass.split(" ").filter(e=>e))):(this._icon.classList.remove(...e.split(" ").filter(e=>e)),this._icon.classList.add(this.CSS_CLASS_LIST.primaryIconClass),Ch5Common.isNotNil(this.CSS_CLASS_LIST.defaultIconClass)&&this._icon.classList.add(this.CSS_CLASS_LIST.defaultIconClass)))}handleIconUrl(e){this.createIconTag(),this.iconUrl.length>0?(this._icon.classList.add(this.CSS_CLASS_LIST.imageClassName),this._icon.style.backgroundImage=`url(${e})`):this._icon.classList.remove(this.CSS_CLASS_LIST.imageClassName)}handlePressed(){var e,t,i;const s=this.getDisabledOrHiddenDpadCenterButton();!1===s?(this.setDisabledOrHidden(s),(null==(e=this._pressable)?void 0:e._pressed)!==this.pressed&&(null==(t=this._pressable)||t.setPressed(this.pressed))):(null==(i=this._pressable)||i.setPressed(!1),this.setDisabledOrHidden(s))}_subscribeToPressableIsPressed(){if(null===this._isPressedSubscription&&null!==this._pressable){const e=200;this._isPressedSubscription=this._pressable.observablePressed.subscribe(t=>{this.logger.log(`Ch5DpadButton.pressableSubscriptionCb(${t})`),!1===t?(null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),this.sendValueForRepeatDigitalWorking(!1)):(this.sendValueForRepeatDigitalWorking(!0),null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),this._repeatDigitalInterval=window.setInterval(()=>{this.sendValueForRepeatDigitalWorking(!0)},e))})}}sendValueForRepeatDigitalWorking(e){if(this.logger.log(`Ch5Button.sendValueForRepeatDigital(${e})`),Ch5Common.isNotNil(this.sendEventOnClick)){const t=Ch5SignalFactory.getInstance().getObjectAsBooleanSignal(this.sendEventOnClick);if(t&&t.name)return void t.publish({[Ch5SignalBridge.REPEAT_DIGITAL_KEY]:e})}}_unsubscribeFromPressableIsPressed(){null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),null!==this._isPressedSubscription&&(this._isPressedSubscription.unsubscribe(),this._isPressedSubscription=null)}getIconContainer(){const e=document.createElement("span");return e.classList.add("dpad-btn-icon"),e.classList.add("fas"),e}getLabelContainer(e){const t=document.createElement("span");return t.classList.add(e),t}getImageContainer(e){const t=document.createElement("span");return t.classList.add("dpad-btn-icon"),t.classList.add("image-url"),t.setAttribute("data-img-url",e),t}},Ch5DpadButton=class e extends Ch5DpadButtonBase{static ELEMENT_NAME="ch5-dpad-button";static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(e.ELEMENT_NAME,e)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}constructor(e,t=!1){super(e,t)}};Ch5DpadButton.registerCustomElement(),Ch5DpadButton.registerSignalAttributeTypes();var Ch5Dpad=class e extends Ch5Common{static ELEMENT_NAME="ch5-dpad";static TYPES=["default","primary","info","text","danger","warning","success","secondary"];static SHAPES=["plus","circle"];static STRETCHES=["both","width","height"];static SIZES=["regular","x-small","small","large","x-large"];static CSS_CLASS_PREFIX_STRETCH="--stretch-";static CSS_CLASS_PREFIX_TYPE="--type-";static CSS_CLASS_PREFIX_SHAPE="--shape-";static CSS_CLASS_PREFIX_SIZE="--size-";static COMPONENT_PROPERTIES=[{default:"",name:"contractName",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.TYPES[0],enumeratedValues:e.TYPES,name:"type",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.TYPES[0],isObservableProperty:!0},{default:e.SHAPES[0],enumeratedValues:e.SHAPES,name:"shape",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SHAPES[0],isObservableProperty:!0},{default:e.SIZES[0],enumeratedValues:e.SIZES,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZES[0],isObservableProperty:!0},{default:null,enumeratedValues:e.STRETCHES,name:"stretch",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:!1,name:"useContractForEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:!1,name:"useContractForShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:!1,name:"useContractForCustomClass",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:!1,name:"useContractForCustomStyle",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:"",name:"sendEventOnClickStart",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"hideCenterButton",nameForSignal:"receiveStateHideCenterButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateHideCenterButton",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"disableCenterButton",nameForSignal:"receiveStateDisableCenterButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateDisableCenterButton",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"useContractForDisableCenterButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:!1,name:"useContractForHideCenterButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0}];static COMPONENT_DATA={TYPES:{default:e.TYPES[0],values:e.TYPES,key:"type",attribute:"type",classListPrefix:e.CSS_CLASS_PREFIX_TYPE},STRETCHES:{default:null,values:e.STRETCHES,key:"stretch",attribute:"stretch",classListPrefix:e.CSS_CLASS_PREFIX_STRETCH},SHAPES:{default:e.SHAPES[0],values:e.SHAPES,key:"shape",attribute:"shape",classListPrefix:e.CSS_CLASS_PREFIX_SHAPE},SIZES:{default:e.SIZES[0],values:e.SIZES,key:"size",attribute:"size",classListPrefix:e.CSS_CLASS_PREFIX_SIZE}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,sendeventonclickstart:{direction:"event",booleanJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1},receivestatehidecenterbutton:{direction:"state",booleanJoin:1,contractName:!0},receivestatedisablecenterbutton:{direction:"state",booleanJoin:1,contractName:!0}};primaryCssClass="ch5-dpad";_ch5Properties;isResizeInProgress=!1;RESIZE_DEBOUNCE=500;container={};containerClass="dpad-container";static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}set contractName(e){this._ch5Properties.set("contractName",e,()=>{this.updateContractNameBasedHandlers()})}get contractName(){var e;return null==(e=this._ch5Properties.get("contractName"))?void 0:e.trim()}set type(e){this._ch5Properties.set("type",e,()=>{this.updateCssClasses()})}get type(){return this._ch5Properties.get("type")}set shape(e){this._ch5Properties.set("shape",e,()=>{this.checkAndRestructureDomOfDpad()})}get shape(){return this._ch5Properties.get("shape")}set stretch(e){this._ch5Properties.set("stretch",e,()=>{this.stretchHandler()})}get stretch(){return this._ch5Properties.get("stretch")}set size(e){this._ch5Properties.set("size",e,()=>{this.updateCssClasses()})}get size(){return this._ch5Properties.get("size")}set sendEventOnClickStart(e){this._ch5Properties.set("sendEventOnClickStart",null==e?void 0:e.trim(),()=>{this.updateEventClickHandlers()})}get sendEventOnClickStart(){var e;return null==(e=this._ch5Properties.get("sendEventOnClickStart"))?void 0:e.trim()}set useContractForEnable(e){this._ch5Properties.set("useContractForEnable",e,()=>{const e=this.contractName;e.length>0&&!0===this.useContractForEnable&&(this.receiveStateEnable=e+".Enable")})}get useContractForEnable(){return this._ch5Properties.get("useContractForEnable")}set useContractForShow(e){this._ch5Properties.set("useContractForShow",e,()=>{const e=this.contractName;e.length>0&&!0===this.useContractForShow&&(this.receiveStateShow=e+".Show")})}get useContractForShow(){return this._ch5Properties.get("useContractForShow")}set useContractForCustomStyle(e){this._ch5Properties.set("useContractForCustomStyle",e,()=>{const e=this.contractName;e.length>0&&!0===this.useContractForCustomStyle&&(this.receiveStateCustomStyle=e+".CustomStyle")})}get useContractForCustomStyle(){return this._ch5Properties.get("useContractForCustomStyle")}set useContractForCustomClass(e){this._ch5Properties.set("useContractForCustomClass",e,()=>{const e=this.contractName;e.length>0&&!0===this.useContractForCustomClass&&(this.receiveStateCustomClass=e+".CustomClass")})}get useContractForCustomClass(){return this._ch5Properties.get("useContractForCustomClass")}set hideCenterButton(e){this._ch5Properties.set("hideCenterButton",e,()=>{this.handleHideCenterButton()})}get hideCenterButton(){return this._ch5Properties.get("hideCenterButton")}set receiveStateHideCenterButton(e){this._ch5Properties.set("receiveStateHideCenterButton",e,null,e=>{this._ch5Properties.setForSignalResponse("hideCenterButton",e,()=>{this.handleHideCenterButton()})})}get receiveStateHideCenterButton(){return this._ch5Properties.get("receiveStateHideCenterButton")}set disableCenterButton(e){this._ch5Properties.set("disableCenterButton",e,()=>{this.handleDisableCenterButton()})}get disableCenterButton(){return this._ch5Properties.get("disableCenterButton")}set receiveStateDisableCenterButton(e){this._ch5Properties.set("receiveStateDisableCenterButton",e,null,e=>{this._ch5Properties.setForSignalResponse("disableCenterButton",e,()=>{this.handleDisableCenterButton()})})}get receiveStateDisableCenterButton(){return this._ch5Properties.get("receiveStateDisableCenterButton")}set useContractForDisableCenterButton(e){this._ch5Properties.set("useContractForDisableCenterButton",e,()=>{const e=this.contractName;e.length>0&&!0===this.useContractForDisableCenterButton&&(this.receiveStateDisableCenterButton=e+".DisableCenterButton")})}get useContractForDisableCenterButton(){return this._ch5Properties.get("useContractForDisableCenterButton")}set useContractForHideCenterButton(e){this._ch5Properties.set("useContractForHideCenterButton",e,()=>{const e=this.contractName;e.length>0&&!0===this.useContractForHideCenterButton&&(this.receiveStateHideCenterButton=e+".HideCenterButton")})}get useContractForHideCenterButton(){return this._ch5Properties.get("useContractForHideCenterButton")}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),ComponentHelper.clearComponentContent(this),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.initCssClasses(),this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback() - start",e.ELEMENT_NAME),subscribeInViewPortChange(this,()=>{if(this.elementIsInViewPort&&!_16.isNil(this.stretch)&&this.parentElement){const{offsetHeight:e,offsetWidth:t}=this.parentElement,i=t<=e?t:e;this.container.style.height=i+"px",this.container.style.width=i+"px"}}),customElements.whenDefined("ch5-dpad").then(()=>{this._wasInstatiated||this.createHtmlElements(),this._wasInstatiated=!0,this.attachEventListeners(),this.initAttributes(),this.stretchHandler()}),this.logger.stop()}disconnectedCallback(){this.removeEvents(),this.unsubscribeFromSignals(),unSubscribeInViewPortChange(this),this.container&&this.container.style&&(this.container.style.removeProperty("height"),this.container.style.removeProperty("width")),this.disconnectCommonMutationObserver()}removeEvents(){super.removeEventListeners(),window.removeEventListener("resize",this.onWindowResizeHandler)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-dpad attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}createHtmlElements(){var t;this.logger.start("createHtmlElements",e.ELEMENT_NAME),this.classList.add(this.primaryCssClass);const i=this.children;if(0===i.length||0===i[0].children.length)_16.cloneDeep(null==(t=i[0])?void 0:t.children)?this.createAndAppendAllExistingButtonsUnderDpad(i):this.createAndAppendAllButtonsUnderDpad();else{this.checkIfOrderOfTagsAreInTheRightOrder(i[0].children)||this.createAndAppendAllExistingButtonsUnderDpad(i[0].children)}this.logger.stop()}updateHtmlElements(){var t;this.logger.start("updateHtmlElements",e.ELEMENT_NAME);const i=this.children;if(0===i.length||0===i[0].children.length)_16.cloneDeep(null==(t=i[0])?void 0:t.children)?this.createAndAppendAllExistingButtonsUnderDpad(i[0].children):this.createAndAppendAllButtonsUnderDpad();else{this.checkIfOrderOfTagsAreInTheRightOrder(i[0].children)?this.updatePropertiesForHideAndDisableCenterButton(i[0].children):this.createAndAppendAllExistingButtonsUnderDpad(i[0].children)}this.logger.stop()}createEmptyContainerDiv(){for((_16.isNil(this.container)||_16.isNil(this.container.classList)||0===this.container.classList.length)&&(this.container=document.createElement("div"),this.container.classList.add(this.containerClass)),this.container.parentElement!==this&&this.appendChild(this.container);this.container.firstChild;)this.container.removeChild(this.container.firstChild)}createAndAppendAllButtonsUnderDpad(){const e=this.disableCenterButton||this.hideCenterButton,t=new Ch5DpadButton(this,e);t.setAttribute("key","center");const i=new Ch5DpadButton(this);i.setAttribute("key","up");const s=new Ch5DpadButton(this);s.setAttribute("key","right");const n=new Ch5DpadButton(this);n.setAttribute("key","down");const r=new Ch5DpadButton(this);r.setAttribute("key","left"),this.createEmptyContainerDiv(),this.appendButtonsInRightOrder(t,i,r,s,n)}updatePropertiesForHideAndDisableCenterButton(e){let t=null;Array.from(e).forEach(e=>{if("center"===e.getAttribute("key")){t=e;const i=this.disableCenterButton||this.hideCenterButton;t.setDisabledOrHidden(i)}})}createAndAppendAllExistingButtonsUnderDpad(e){if(!e.length)return;let t=null,i=null,s=null,n=null,r=null;Array.from(e).forEach(e=>{switch(e.getAttribute("key")){case"center":t=e;break;case"up":i=e;break;case"right":s=e;break;case"down":n=e;break;case"left":r=e;break;default:throw new Error("Seems to be an invalid dpad Button value ")}});const a=this.disableCenterButton||this.hideCenterButton;t?t.setDisabledOrHidden(a):(t=new Ch5DpadButton(this,a),t.setAttribute("key","center")),i||(i=new Ch5DpadButton(this),i.setAttribute("key","up")),s||(s=new Ch5DpadButton(this),s.setAttribute("key","right")),n||(n=new Ch5DpadButton(this),n.setAttribute("key","down")),r||(r=new Ch5DpadButton(this),r.setAttribute("key","left")),this.createEmptyContainerDiv(),this.appendButtonsInRightOrder(t,i,r,s,n)}appendButtonsInRightOrder(t,i,s,n,r){if(this.container.appendChild(t),this.container.appendChild(i),this.shape===e.SHAPES[0])this.container.appendChild(s),this.container.appendChild(n);else{if(this.shape!==e.SHAPES[1])throw new Error("Seems to be an invalid shape. Must be 'plus' or 'circle' as values.");this.container.appendChild(n),this.container.appendChild(s)}this.container.appendChild(r)}checkIfOrderOfTagsAreInTheRightOrder(t){let i=!1;if(5===t.length){const s=this.shape===e.SHAPES[0]?"left":"right",n=this.shape===e.SHAPES[0]?"right":"left";i="center"===t[0].getAttribute("key")&&"up"===t[1].getAttribute("key")&&t[2].getAttribute("key")===s&&t[3].getAttribute("key")===n&&"down"===t[4].getAttribute("key")}else if(t.length>0)for(const e of Array.from(t))e.remove();return i}initAttributes(){this.logger.start("initAttributes",e.ELEMENT_NAME),super.initAttributes(),this.setAttribute("data-ch5-id",this.getCrId()),ComponentHelper.setAttributeToElement(this,"role",Ch5RoleAttributeMapping.ch5Dpad);const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty)if(this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}else{t[e.COMPONENT_PROPERTIES[i].name]=e.COMPONENT_PROPERTIES[i].default}this.handleHideCenterButton(),this.handleDisableCenterButton(),this.logger.stop()}attachEventListeners(){super.attachEventListeners(),window.addEventListener("resize",this.onWindowResizeHandler.bind(this))}updateCssClasses(){super.updateCssClasses();for(const t of e.TYPES)this.classList.remove(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_TYPE+t);this.classList.add(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_TYPE+this.type);for(const t of e.SHAPES)this.classList.remove(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_SHAPE+t);this.classList.add(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_SHAPE+this.shape);for(const t of e.SIZES)this.classList.remove(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_SIZE+t);this.classList.add(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_SIZE+this.size);for(const t of e.STRETCHES)this.classList.remove(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_STRETCH+t);this.stretch&&this.stretch.length>0&&(this.classList.add(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_STRETCH+this.stretch),this.size&&this.size.length)}initCssClasses(){this.classList.add(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_TYPE+this.type),this.classList.add(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_SHAPE+this.shape),this.classList.add(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_SIZE+this.size),this.stretch&&this.stretch.length>0&&(this.classList.add(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_STRETCH+this.stretch),this.size&&this.size.length>0&&this.classList.remove(e.ELEMENT_NAME+e.CSS_CLASS_PREFIX_SIZE+this.size))}checkAndRestructureDomOfDpad(){this.logger.start("checkAndRestructureDomOfDpad()",e.ELEMENT_NAME),this.updateHtmlElements(),this.updateCssClasses(),this.logger.stop()}updateEventClickHandlers(){const e=this.sendEventOnClickStart,t=this.contractName,i=this.getElementsByTagName("ch5-dpad-button");let s=null,n=null,r=null,a=null,l=null;if(i.length>0)for(let e=0;e<i.length;e++){const t=i[e].getAttribute("key");if(t)switch(t){case"center":default:s=i[e];break;case"up":n=i[e];break;case"left":l=i[e];break;case"right":r=i[e];break;case"down":a=i[e]}}if(Ch5Common.isNotNil(e)&&""!==(null==e?void 0:e.trim())){const i=parseInt(null==e?void 0:e.trim(),10);if(0===t.length&&!isNaN(i)){if(!Ch5Common.isNil(s)){const e=i+CH5DpadUtils.sendEventOnClickSigCountToAdd.center;s.setAttribute("sendEventOnClick",e.toString())}if(!Ch5Common.isNil(n)){const e=i+CH5DpadUtils.sendEventOnClickSigCountToAdd.up;n.setAttribute("sendEventOnClick",e.toString())}if(!Ch5Common.isNil(r)){const e=i+CH5DpadUtils.sendEventOnClickSigCountToAdd.right;r.setAttribute("sendEventOnClick",e.toString())}if(!Ch5Common.isNil(a)){const e=i+CH5DpadUtils.sendEventOnClickSigCountToAdd.down;a.setAttribute("sendEventOnClick",e.toString())}if(!Ch5Common.isNil(l)){const e=i+CH5DpadUtils.sendEventOnClickSigCountToAdd.left;l.setAttribute("sendEventOnClick",e.toString())}}}else 0===t.length&&(Ch5Common.isNil(s)||s.removeAttribute("sendEventOnClick"),Ch5Common.isNil(n)||n.removeAttribute("sendEventOnClick"),Ch5Common.isNil(r)||r.removeAttribute("sendEventOnClick"),Ch5Common.isNil(a)||a.removeAttribute("sendEventOnClick"),Ch5Common.isNil(l)||l.removeAttribute("sendEventOnClick"))}updateContractNameBasedHandlers(){const e=this.contractName,t=this.getElementsByTagName("ch5-dpad-button");let i=null,s=null,n=null,r=null,a=null;if(t.length>0)for(let e=0;e<t.length;e++){const l=t[e].getAttribute("key");if(l)switch(l){case"center":default:i=t[e];break;case"up":s=t[e];break;case"left":a=t[e];break;case"right":n=t[e];break;case"down":r=t[e]}}if(e.length>0){if(!0===this.useContractForEnable&&(this.receiveStateEnable=e+".Enable"),!0===this.useContractForShow&&(this.receiveStateShow=e+".Show"),!0===this.useContractForDisableCenterButton&&(this.receiveStateDisableCenterButton=e+".DisableCenterButton"),!0===this.useContractForHideCenterButton&&(this.receiveStateHideCenterButton=e+".HideCenterButton"),!Ch5Common.isNil(i)){const t=e+"."+CH5DpadUtils.contractSuffix.center;i.setAttribute("sendEventOnClick",t.toString())}if(!Ch5Common.isNil(s)){const t=e+"."+CH5DpadUtils.contractSuffix.up;s.setAttribute("sendEventOnClick",t.toString())}if(!Ch5Common.isNil(n)){const t=e+"."+CH5DpadUtils.contractSuffix.right;n.setAttribute("sendEventOnClick",t.toString())}if(!Ch5Common.isNil(r)){const t=e+"."+CH5DpadUtils.contractSuffix.down;r.setAttribute("sendEventOnClick",t.toString())}if(!Ch5Common.isNil(a)){const t=e+"."+CH5DpadUtils.contractSuffix.left;a.setAttribute("sendEventOnClick",t.toString())}}else this.updateEventClickHandlers()}stretchHandler(){this.logger.start(e.ELEMENT_NAME+" > stretchHandler"),this.updateCssClasses();const t=this.offsetHeight,i=this.offsetWidth;let s=Math.min(t,i);if(this.stretch&&0===this.stretch.length&&(s=0),this.container&&this.container.style){0===s&&(this.container.style.removeProperty("height"),this.container.style.removeProperty("width"));const e=this.parentElement;this.stretch&&this.stretch.trim().length>0&&e&&(s=Math.min(e.offsetHeight,e.offsetWidth),this.container.style.height=s+"px",this.container.style.width=s+"px")}this.logger.stop()}handleHideCenterButton(){const e=this.querySelector(".ch5-dpad-button-center");null==e||e.classList.remove("ch5-hide-child-button"),this.hideCenterButton&&(null==e||e.classList.add("ch5-hide-child-button")),this.checkAndRestructureDomOfDpad()}handleDisableCenterButton(){const e=this.querySelector(".ch5-dpad-button-center");null==e||e.classList.remove("ch5-disable-child-button"),this.disableCenterButton&&(null==e||e.classList.add("ch5-disable-child-button")),this.checkAndRestructureDomOfDpad()}onWindowResizeHandler(){this.stretch&&this.stretch.length>0&&!this.isResizeInProgress&&(this.isResizeInProgress=!0,setTimeout(()=>{this.stretchHandler(),this.isResizeInProgress=!1},this.RESIZE_DEBOUNCE))}};Ch5Dpad.registerCustomElement(),Ch5Dpad.registerSignalAttributeTypes();import{capitalize}from"lodash";var monthsAbbr=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],monthsFull=["january","february","march","april","may","june","july","august","september","october","november","december"],daysAbbr=["sun","mon","tue","wed","thu","fri","sat"],daysFull=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],appendZeroForSingleDigit=e=>e<10?"0"+e:String(e),replaceDateContent=(e,t,i)=>-1!==e.indexOf(t)?e.replace(t,String(i)):e,toFormat=(e,t)=>{const i=e.getHours()%12?e.getHours()%12:12;return t=replaceDateContent(t,"YYYY",e.getFullYear()),t=replaceDateContent(t,"YY",String(e.getFullYear()).slice(-2)),t=replaceDateContent(t,"MMMM",monthsFull[e.getMonth()]),t=replaceDateContent(t,"MMM",monthsAbbr[e.getMonth()]),t=replaceDateContent(t,"MM",appendZeroForSingleDigit(e.getMonth()+1)),t=replaceDateContent(t,"MI",appendZeroForSingleDigit(e.getMinutes())),t=replaceDateContent(t,"M",e.getMonth()+1),t=replaceDateContent(t,"DDDD",daysFull[e.getDay()]),t=replaceDateContent(t,"DDD",daysAbbr[e.getDay()]),t=replaceDateContent(t,"DD",appendZeroForSingleDigit(e.getDate())),t=replaceDateContent(t,"D",e.getDate()),t=replaceDateContent(t,"HH24",appendZeroForSingleDigit(e.getHours())),t=replaceDateContent(t,"H24",e.getHours()),t=replaceDateContent(t,"HH",appendZeroForSingleDigit(i)),t=replaceDateContent(t,"H",i),t=(t=replaceDateContent(t,"SS",appendZeroForSingleDigit(e.getSeconds()))).split(" ").map(capitalize).join(" "),t=replaceDateContent(t,"Pp",e.getHours()>=12?"PM":"AM")},Ch5DateTime=class e extends Ch5Common{static STYLE_FOR_DATE=["MM-dd-yyyy","M-dd-yyyy","M-d-yyyy","MM-dd-yy","M-dd-yy","M-d-yy","dd_MM_yyyy","d_MM_yyyy","d_M_yyyy","dd_MM_yy","d_MM_yy","d_M_yy","d MMM yyyy","MMM d yyyy","d MMMM yyyy","MMMM d yyyy","yyyy-MM-dd","yyyy_MM_dd","MMM d, yyyy","yyyy MM, dd","yyyy MMMM, dd","MMMM d, yyyy"];static HORIZONTAL_ALIGNMENT=["center","left","right"];static DISPLAY_TYPE=["datetime","date","time"];static COMPONENT_DATA={STYLE_FOR_DATE:{default:e.STYLE_FOR_DATE[0],values:e.STYLE_FOR_DATE,key:"styleForDate",attribute:"styleForDate"},HORIZONTAL_ALIGNMENT:{default:e.HORIZONTAL_ALIGNMENT[0],values:e.HORIZONTAL_ALIGNMENT,key:"horizontalAlignment",attribute:"horizontalAlignment",classListPrefix:"--horizontal-alignment-"},DISPLAY_TYPE:{default:e.DISPLAY_TYPE[0],values:e.DISPLAY_TYPE,key:"displayType",attribute:"displayType"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateoffsettime:{direction:"state",numericJoin:1,contractName:!0},receivestatedisplay24hourformat:{direction:"state",booleanJoin:1,contractName:!0},receivestatedisplayampm:{direction:"state",booleanJoin:1,contractName:!0},receivestatedisplayseconds:{direction:"state",booleanJoin:1,contractName:!0},receivestatedisplaytwodigitshour:{direction:"state",booleanJoin:1,contractName:!0},receivestatestylefordate:{direction:"state",stringJoin:1,contractName:!0},receivestatedisplaytype:{direction:"state",stringJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:!1,name:"display24HourFormat",nameForSignal:"receiveStateDisplay24HourFormat",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!0,name:"displayAmPm",nameForSignal:"receiveStateDisplayAmPm",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"displayTwoDigitsHour",nameForSignal:"receiveStateDisplayTwoDigitsHour",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"displaySeconds",nameForSignal:"receiveStateDisplaySeconds",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.STYLE_FOR_DATE[0],enumeratedValues:e.STYLE_FOR_DATE,name:"styleForDate",nameForSignal:"receiveStateStyleForDate",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.STYLE_FOR_DATE[0],isObservableProperty:!0},{default:e.HORIZONTAL_ALIGNMENT[0],enumeratedValues:e.HORIZONTAL_ALIGNMENT,name:"horizontalAlignment",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.HORIZONTAL_ALIGNMENT[0],isObservableProperty:!0},{default:e.DISPLAY_TYPE[0],enumeratedValues:e.DISPLAY_TYPE,name:"displayType",nameForSignal:"receiveStateDisplayType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.DISPLAY_TYPE[0],isObservableProperty:!0},{default:0,name:"timeOffsetHours",removeAttributeOnNull:!0,nameForSignal:"receiveStateOffsetTime",type:"number",valueOnAttributeEmpty:null,numberProperties:{min:-32768,max:32767,conditionalMin:-32768,conditionalMax:32767,conditionalMinValue:-32768,conditionalMaxValue:32767},isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateOffsetTime",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateDisplay24HourFormat",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateDisplayAmPm",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateDisplaySeconds",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateDisplayTwoDigitsHour",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateStyleForDate",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateDisplayType",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-datetime";primaryCssClass="ch5-datetime";_ch5Properties;_elContainer={};dateTimeId=null;componentFormat="";debounceRender=this.debounce(()=>{this.render()},50);set display24HourFormat(e){this._ch5Properties.set("display24HourFormat",e,()=>{this.debounceRender()})}get display24HourFormat(){return this._ch5Properties.get("display24HourFormat")}set displayAmPm(e){this._ch5Properties.set("displayAmPm",e,()=>{this.debounceRender()})}get displayAmPm(){return this._ch5Properties.get("displayAmPm")}set displayTwoDigitsHour(e){this._ch5Properties.set("displayTwoDigitsHour",e,()=>{this.debounceRender()})}get displayTwoDigitsHour(){return this._ch5Properties.get("displayTwoDigitsHour")}set displaySeconds(e){this._ch5Properties.set("displaySeconds",e,()=>{this.debounceRender()})}get displaySeconds(){return this._ch5Properties.get("displaySeconds")}set styleForDate(e){this._ch5Properties.set("styleForDate",e,()=>{this.debounceRender()})}get styleForDate(){return this._ch5Properties.get("styleForDate")}set horizontalAlignment(e){this._ch5Properties.set("horizontalAlignment",e,()=>{this.updateCssClass()})}get horizontalAlignment(){return this._ch5Properties.get("horizontalAlignment")}set displayType(e){this._ch5Properties.set("displayType",e,()=>{this.debounceRender()})}get displayType(){return this._ch5Properties.get("displayType")}set timeOffsetHours(e){this._ch5Properties.set("timeOffsetHours",e,()=>{this.changeTime()})}get timeOffsetHours(){return this._ch5Properties.get("timeOffsetHours")}set receiveStateOffsetTime(e){this._ch5Properties.set("receiveStateOffsetTime",e,null,e=>{const t=this.convertAnalogValueBasedOnSignalResponse(e)/100;this._ch5Properties.setForSignalResponse("timeOffsetHours",t,()=>{this.changeTime()})})}get receiveStateOffsetTime(){return this._ch5Properties.get("receiveStateOffsetTime")}set receiveStateDisplay24HourFormat(e){this._ch5Properties.set("receiveStateDisplay24HourFormat",e,null,e=>{this._ch5Properties.setForSignalResponse("display24HourFormat",e,()=>{this.debounceRender()})})}get receiveStateDisplay24HourFormat(){return this._ch5Properties.get("receiveStateDisplay24HourFormat")}set receiveStateDisplayAmPm(e){this._ch5Properties.set("receiveStateDisplayAmPm",e,null,e=>{this._ch5Properties.setForSignalResponse("displayAmPm",e,()=>{this.debounceRender()})})}get receiveStateDisplayAmPm(){return this._ch5Properties.get("receiveStateDisplayAmPm")}set receiveStateDisplaySeconds(e){this._ch5Properties.set("receiveStateDisplaySeconds",e,null,e=>{this._ch5Properties.setForSignalResponse("displaySeconds",e,()=>{this.debounceRender()})})}get receiveStateDisplaySeconds(){return this._ch5Properties.get("receiveStateDisplaySeconds")}set receiveStateDisplayTwoDigitsHour(e){this._ch5Properties.set("receiveStateDisplayTwoDigitsHour",e,null,e=>{this._ch5Properties.setForSignalResponse("displayTwoDigitsHour",e,()=>{this.debounceRender()})})}get receiveStateDisplayTwoDigitsHour(){return this._ch5Properties.get("receiveStateDisplayTwoDigitsHour")}set receiveStateStyleForDate(e){this._ch5Properties.set("receiveStateStyleForDate",e,null,e=>{this._ch5Properties.setForSignalResponse("styleForDate",e,()=>{this.debounceRender()})})}get receiveStateStyleForDate(){return this._ch5Properties.get("receiveStateStyleForDate")}set receiveStateDisplayType(e){this._ch5Properties.set("receiveStateDisplayType",e,null,e=>{this._ch5Properties.setForSignalResponse("displayType",e,()=>{this.debounceRender()})})}get receiveStateDisplayType(){return this._ch5Properties.get("receiveStateDisplayType")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=["disabled","appendClassWhenInViewPort","sendEventOnShow","receiveStateEnable","receiveStateHidePulse","receiveStateShowPulse"],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-datetime attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5DateTime),this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-datetime"),this.appendChild(this._elContainer)),this.initAttributes(),this.debounceRender(),this.updateCssClass(),this.initCommonMutationObserver(this),customElements.whenDefined("ch5-datetime").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id),this.changeTime()}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.unsubscribeFromSignals(),null!==this.dateTimeId&&window.clearTimeout(this.dateTimeId),this.componentFormat="",this.logger.stop()}changeTime(){if(null!==this.dateTimeId&&window.clearTimeout(this.dateTimeId),""!==this.componentFormat){const e=new Date,t=this.calculateTimeOffset(e);this._elContainer.textContent=toFormat(t,this.componentFormat),this.dateTimeId=window.setTimeout(()=>{this.changeTime()},1e3)}}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),Array.from(e.HORIZONTAL_ALIGNMENT).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.HORIZONTAL_ALIGNMENT.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.HORIZONTAL_ALIGNMENT.classListPrefix+this.horizontalAlignment),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}render(){const t=this.styleForDate.replaceAll("d","D").replaceAll("y","Y").replaceAll("_","/");let i="";[e.DISPLAY_TYPE[0],e.DISPLAY_TYPE[2]].includes(this.displayType)&&(i="H:MI",this.display24HourFormat&&(i=i.replace("H","H24")),this.displaySeconds&&(i=`${i}:SS`),this.displayAmPm&&!this.display24HourFormat&&(i=`${i} PP`),this.displayTwoDigitsHour&&(i=i.replace("H","HH")));let s="";"datetime"===this.displayType?s=t+" "+i:"date"===this.displayType?s=t:"time"===this.displayType&&(s=i),this.componentFormat=s.trim(),this.changeTime()}calculateTimeOffset(e){const t=this.timeOffsetHours;if(t&&0!==t&&t>=-32768&&t<=32767){const i=e;return i.setMinutes(i.getMinutes()+Math.round(60*t)),i}return e}};Ch5DateTime.registerCustomElement(),Ch5DateTime.registerSignalAttributeTypes();import{isNull,isUndefined as isUndefined2,isBoolean,isString,isNumber,isObject}from"lodash";var Ch5Emulator=class e{static _instance;static _scenario={};constructor(){}static getInstance(){return isUndefined2(e._instance)&&(e._instance=new e),e._instance}static clear(){e._instance=void 0,e._scenario={}}loadScenario(t){if(!e._instance)throw new Error("The Ch5Emulator instance is not created");if(e._scenario=t,isUndefined2(t.cues))throw new Error("The loaded scenario has no cues");t.cues.forEach(e._instance.processCue)}getScenario(){return e._scenario}processCue(t,i){let s,n;if(isUndefined2(t.event))throw new Error('Property "signal" is not set in cue.');if(isUndefined2(t.actions)||"function"!=typeof t.actions.forEach)throw new Error('Property "actions" is not set in cue.');const r=t.event;switch(t.type){case"b":case"boolean":if(s=Ch5SignalFactory.getInstance().getBooleanSignal(r),isNull(s))throw new Error(`Error processing boolean type signal named ${r}`);n=i=>{const n=e.getInstance();!isNull(n)&&n.isTriggered(t.trigger,i,s)&&t.actions.forEach((e,t,s)=>{n.processAction(e,t,s,i)})},s.subscribe(n);break;case"s":case"string":if(s=Ch5SignalFactory.getInstance().getStringSignal(r),isNull(s))throw new Error(`Error processing boolean type signal named ${r}`);n=i=>{const n=e.getInstance();!isNull(n)&&n.isTriggered(t.trigger,i,s)&&t.actions.forEach((e,t,s)=>{n.processAction(e,t,s,i)})},s.subscribe(n);break;case"n":case"numeric":case"number":if(s=Ch5SignalFactory.getInstance().getNumberSignal(r),isNull(s))throw new Error(`Error processing boolean type signal named ${r}`);n=i=>{const n=e.getInstance();!isNull(n)&&n.isTriggered(t.trigger,i,s)&&t.actions.forEach((e,t,s)=>{n.processAction(e,t,s,i)})},s.subscribe(n);break;case"o":case"object":if(s=Ch5SignalFactory.getInstance().getObjectSignal(r),isNull(s))throw new Error(`Error processing object type signal named ${r}`);n=i=>{const n=e.getInstance();!isNull(n)&&n.isTriggered(t.trigger,i,s)&&t.actions.forEach((e,t,s)=>{n.processAction(e,t,s,i)})},s.subscribe(n);break;default:throw new Error(`Invalid cue type: ${t.type}`)}}isTriggered(e,t,i){let s=t;const n=s[Ch5SignalBridge.REPEAT_DIGITAL_KEY];isObject(s)&&!isUndefined2(n)&&(s=n);let r=!1;switch(typeof e){case"boolean":case"number":r=e===s;break;case"string":r="&change"===e?isObject(s)?!isNull(i)&&JSON.stringify(i.prevValue)!==JSON.stringify(s):!isNull(i)&&i.prevValue!==s:e===s;break;case"object":r=JSON.stringify(e)===JSON.stringify(s)}return r}processAction(e,t,i,s){setTimeout(()=>this.processActionAsync(e,t,i,s),30)}processActionAsync(e,t,i,s){if(isUndefined2(e.state))throw new Error('Property "state" is not set in action.');switch(e.type){case"b":case"boolean":this.processBooleanAction(e,s);break;case"s":case"string":this.processStringAction(e,s);break;case"n":case"numeric":case"number":this.processNumberAction(e,s);break;case"o":case"object":this.processObjectAction(e,s);break;default:throw new Error(`Invalid cue type: ${e.type}`)}}castToBoolean(e){let t=!1;if("string"==typeof e)switch(e.toLowerCase().trim()){case"true":case"yes":case"1":t=!0;break;case"false":case"no":case"0":t=!1;break;default:t=Boolean(e)}else t=Boolean(e);return t}processBooleanAction(e,t){const i=Ch5Signal.getSubscriptionSignalName(e.state),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);if(isNull(s))throw new Error(`Error processing boolean type signal named ${i}`);switch(e.logic){case"set":isUndefined2(e.value)||bridgeReceiveBooleanFromNative(i,e.value);break;case"link":bridgeReceiveBooleanFromNative(i,this.castToBoolean(t));break;case"toggle":bridgeReceiveBooleanFromNative(i,!s.value);break;case"pulse":bridgeReceiveBooleanFromNative(i,!0),bridgeReceiveBooleanFromNative(i,!1)}}processNumberAction(e,t){const i=Ch5Signal.getSubscriptionSignalName(e.state),s=Ch5SignalFactory.getInstance().getNumberSignal(i);if(isNull(s))throw new Error(`Error processing numeric type signal named ${i}`);switch(e.logic){case"set":isNumber(e.value)&&bridgeReceiveIntegerFromNative(i,e.value);break;case"link":let n=parseInt(""+t,10);isNaN(n)&&(n=0),bridgeReceiveIntegerFromNative(i,n);break;case"increment":let r=1;isUndefined2(e.offset)||(r=e.offset),bridgeReceiveIntegerFromNative(i,+s.value+r);break;case"decrement":let a=1;isUndefined2(e.offset)||(a=e.offset),bridgeReceiveIntegerFromNative(i,+s.value-a);break;case"rcb":isUndefined2(e.value)||isUndefined2(e.time)||setTimeout((e,t)=>{isNull(e)||bridgeReceiveIntegerFromNative(i,t)},e.time,s,e.value)}}processStringAction(e,t){const i=Ch5Signal.getSubscriptionSignalName(e.state),s=Ch5SignalFactory.getInstance().getStringSignal(i);if(isNull(s))throw new Error(`Error processing string type signal named ${i}`);switch(e.logic){case"set":bridgeReceiveStringFromNative(i,String(e.value));break;case"link":bridgeReceiveStringFromNative(i,String(t))}}processObjectAction(e,t){const i=Ch5Signal.getSubscriptionSignalName(e.state),s=Ch5SignalFactory.getInstance().getObjectSignal(i);if(isNull(s))throw new Error(`Error processing object type signal named ${i}`);switch(e.logic){case"set":isUndefined2(e.value)||bridgeReceiveObjectFromNative(i,e.value);break;case"link":bridgeReceiveObjectFromNative(i,t)}}run(){if(isUndefined2(e._scenario)||isUndefined2(e._scenario.cues))throw new Error("You must load a scenario before trying to run one.");isUndefined2(e._scenario.onStart)||isUndefined2(e._scenario.onStart.forEach)||e._scenario.onStart.forEach(e=>{const t=Ch5Signal.getSubscriptionSignalName(e.state);let i;switch(e.type){case"b":case"boolean":if(i=Ch5SignalFactory.getInstance().getBooleanSignal(t),isNull(i)||!isBoolean(e.value))throw new Error(`Error when setting initial value (${e.value}) for state: ${t}`);bridgeReceiveBooleanFromNative(t,e.value);break;case"n":case"numeric":case"number":i=Ch5SignalFactory.getInstance().getNumberSignal(t);const s=Number(e.value);if(isNull(i)||isNaN(s))throw new Error(`Error when setting initial value (${e.value}) for state: ${t}`);bridgeReceiveIntegerFromNative(t,s);break;case"s":case"string":if(i=Ch5SignalFactory.getInstance().getStringSignal(t),isNull(i)||!isString(e.value))throw new Error(`Error when setting initial value (${e.value}) for state: ${t}`);bridgeReceiveStringFromNative(t,e.value);break;case"o":case"object":if(i=Ch5SignalFactory.getInstance().getObjectSignal(t),isNull(i)||!isObject(e.value))throw new Error(`Error when setting initial value (${e.value}) for signal: ${t}`);bridgeReceiveObjectFromNative(t,e.value);break;default:throw new Error(`Invalid 'onStart' type: ${e.type}`)}})}};import{isEmpty as isEmpty3,isNil as isNil6}from"lodash";var Ch5Form=class e extends Ch5Common{static ELEMENT_NAME="ch5-form";static SUBMIT_LABEL="Submit";static CANCEL_LABEL="Cancel";static SUBMIT_TYPE="default";static CANCEL_TYPE="warning";static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES};static COMPONENT_PROPERTIES=[{default:!1,name:"hideCancelButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"hideSubmitButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];_ch5Properties;set hideCancelButton(e){this._ch5Properties.set("hideCancelButton",e,()=>{this.hideCancelButton?this.cancelButton.setAttribute("hidden",""):this.cancelButton.removeAttribute("hidden")})}get hideCancelButton(){return this._ch5Properties.get("hideCancelButton")}set hideSubmitButton(e){this._ch5Properties.set("hideSubmitButton",e,()=>{this.hideSubmitButton?this.submitButton.setAttribute("hidden",""):this.submitButton.removeAttribute("hidden")})}get hideSubmitButton(){return this._ch5Properties.get("hideSubmitButton")}get inputElements(){return this._inputElements}get submitButton(){return this._submitButton}set submitButton(e){this._submitButton=e}get cancelButton(){return this._cancelButton}set cancelButton(e){this._cancelButton=e}get submitButtonLabel(){return this._submitButtonLabel}set submitButtonLabel(t){this.info('Ch5Form set submitButtonLabel("'+t+'")'),Ch5Common.isNil(t)&&(t=e.SUBMIT_LABEL);const i=this._getTranslatedValue("submitbuttonlabel",t);i!==this.submitButtonLabel&&(this._submitButtonLabel=t,this.submitButton.setAttribute("label",i),this.setAttribute("submitbuttonlabel",i))}get submitButtonIcon(){return this._submitButtonIcon}set submitButtonIcon(e){if(this.info('Ch5Form set submitButtonIcon("'+e+'")'),this._submitButtonIcon!==e){Ch5Common.isNil(e)&&(e="");const t=`${e} ${this.primaryCssClass}__submit__icon`;this._submitButtonIcon=e,this.setAttribute("submitbuttonicon",e),this.submitButton.setAttribute("iconClass",t)}}get submitButtonStyle(){return this._submitButtonStyle}set submitButtonStyle(e){this.info('Ch5Form set submitButtonStyle("'+e+'")'),this._submitButtonStyle!==e&&(Ch5Common.isNil(e)&&(e=""),this._submitButtonStyle=e,this.setAttribute("submitbuttonstyle",e),this.submitButton.setAttribute("customStyle",e))}get submitButtonType(){return this._submitButtonType}set submitButtonType(e){this.info('Ch5Form set submitButtonType("'+e+'")'),this._submitButtonType!==e&&(Ch5Common.isNil(e)&&(e="default"),this._submitButtonType=e,this.setAttribute("submitbuttontype",e),this.submitButton.setAttribute("type",e))}get cancelButtonLabel(){return this._cancelButtonLabel}set cancelButtonLabel(t){this.info('Ch5Form set cancelButtonLabel("'+t+'")'),Ch5Common.isNil(t)&&(t=e.CANCEL_LABEL);const i=this._getTranslatedValue("cancelButtonLabel",t);i!==this.cancelButtonLabel&&(this._cancelButtonLabel=i,this.cancelButton.setAttribute("label",i),this.setAttribute("cancelbuttonlabel",i))}get cancelButtonIcon(){return this._cancelButtonIcon}set cancelButtonIcon(e){if(this.info('Ch5Form set cancelButtonIcon("'+e+'")'),this._cancelButtonIcon!==e){Ch5Common.isNil(e)&&(e="");const t=`${e} ${this.primaryCssClass}__cancel__icon`;this._cancelButtonIcon=e,this.setAttribute("cancelbuttonicon",e),this.cancelButton.setAttribute("iconclass",t)}}get cancelButtonStyle(){return this._cancelButtonStyle}set cancelButtonStyle(e){this.info('Ch5Form set cancelButtonStyle("'+e+'")'),this._cancelButtonStyle!==e&&(null!=e&&""!==e||(e=""),this._cancelButtonStyle=e,this.setAttribute("cancelbuttonstyle",e),this.cancelButton.setAttribute("customstyle",e))}get cancelButtonType(){return this._cancelButtonType}set cancelButtonType(e){this.info('Ch5Form set cancelButtonType("'+e+'")'),this._cancelButtonType!==e&&(isNil6(e)&&(e="default"),this._cancelButtonType=e,this.setAttribute("cancelbuttontype",e),this.cancelButton.setAttribute("type",e))}get submitId(){return this._submitId}set submitId(e){this.info('Ch5Form set submitId("'+e+'")'),this._submitId===e||isNil6(e)||(this._submitId=e)}get cancelId(){return this._cancelId}set cancelId(e){this.info('Ch5Form set cancelId("'+e+'")'),this._cancelId===e||isNil6(e)||(this._cancelId=e)}constructor(){super(),this._onClickSubmitButton=this._onClickSubmitButton.bind(this),this._onClickCancelButton=this._onClickCancelButton.bind(this),this._checkIfCancelOrSubmitShouldBeDisabled=this._checkIfCancelOrSubmitShouldBeDisabled.bind(this),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this._initFormButtons(),this.ready=Promise.all([customElements.whenDefined("ch5-button"),customElements.whenDefined("ch5-toggle"),customElements.whenDefined("ch5-slider"),customElements.whenDefined("ch5-select"),customElements.whenDefined("ch5-list"),customElements.whenDefined("ch5-textinput"),customElements.whenDefined("ch5-spinner")]).then(()=>{this._linkInputElements(),this._linkFormButtons(),this._wasInstatiated=!0})}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(["submitbuttonlabel","submitbuttonicon","submitbuttonstyle","submitbuttontype","cancelbuttonlabel","cancelbuttonicon","cancelbuttonstyle","cancelbuttontype","submitid","cancelid"].concat(i))}primaryCssClass="ch5-form";_submitButtonLabel="";_submitButtonIcon="";_submitButtonStyle="";_submitButtonType="default";_cancelButtonLabel="";_cancelButtonIcon="";_cancelButtonStyle="";_cancelButtonType="default";_submitId="";_cancelId="";_inputElements=[];_submitButton={};_cancelButton={};_submitShouldBeDisable=!0;_cancelShouldBeDisabled=!0;_customCancelButtonRef=null;_customSubmitButtonRef=null;ready;static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}setCustomCancelBtn(){isNil6(this.cancelId)||isEmpty3(this.cancelId)||(this.info(`Ch5Form setCustomCancelBtn with id :${this.cancelId} ready`),this._customCancelButtonRef=document.getElementById(this.cancelId),isNil6(this._customCancelButtonRef)?this.info(`Ch5Form Cannot find cancel button with id :${this.cancelId}`):(this._customCancelButtonRef.removeEventListener("click",this._onClickCancelButton),this._customCancelButtonRef.addEventListener("click",this._onClickCancelButton),this.info(`Ch5Form canel button with ${this.cancelId} found, events added`)))}setCustomSubmitBtn(){isNil6(this.submitId)||isEmpty3(this.submitId)||(this.info(`Ch5Form setCustomSubmitBtn with id :${this.submitId} ready`),this._customSubmitButtonRef=document.getElementById(this.submitId),isNil6(this._customSubmitButtonRef)?this.info(`Ch5Form cannot find submit button with id :${this.submitId}`):(this._customSubmitButtonRef.addEventListener("click",this._onClickSubmitButton),this.info(`Ch5Form submit button with ${this.submitId} found, events added`)))}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Form),this.ready.then(()=>{this.cacheComponentChildrens(),this.initAttributes(),this.appendChild(this.submitButton),this.appendChild(this.cancelButton),this.attachEventListeners(),this.initCommonMutationObserver(this),this.setCustomCancelBtn(),this.setCustomSubmitBtn(),this.checkIfCustomSubmitShouldBeDisabled(!0),this.checkIfCustomCancelShouldBeDisabled(!0)})}disconnectedCallback(){this.removeEvents(),this.disconnectCommonMutationObserver()}attributeChangedCallback(t,i,s){if(i===s)return;this.info('Ch5Form attributeChangedCallback("'+t+'","'+i+'","'+s+')"');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else switch(t){case"submitbuttonlabel":this.hasAttribute("submitbuttonlabel")?this.submitButtonLabel=s:this.submitButtonLabel="";break;case"submitbuttonicon":this.hasAttribute("submitbuttonicon")?this.submitButtonIcon=s:this.submitButtonIcon="";break;case"submitbuttonstyle":this.hasAttribute("submitbuttonstyle")?this.submitButtonStyle=s:this.submitButtonStyle="";break;case"submitbuttontype":this.hasAttribute("submitbuttontype")?this.submitButtonType=s:this.submitButtonType="default";break;case"cancelbuttonlabel":this.hasAttribute("cancelbuttonlabel")?this.cancelButtonLabel=s:this.cancelButtonLabel="";break;case"cancelbuttonicon":this.hasAttribute("cancelbuttonicon")?this.cancelButtonIcon=s:this.cancelButtonIcon="";break;case"cancelbuttonstyle":this.hasAttribute("cancelbuttonstyle")?this.cancelButtonStyle=s:this.cancelButtonStyle="";break;case"cancelbuttontype":this.hasAttribute("cancelbuttontype")?this.cancelButtonType=s:this.cancelButtonType="default";break;case"submitid":this.hasAttribute("submitid")?this.submitId=s:this.submitId="";break;case"cancelid":this.hasAttribute("cancelid")?this.cancelId=s:this.cancelId="";break;default:super.attributeChangedCallback(t,i,s)}}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this._upgradeProperty("submitButtonLabel"),this._upgradeProperty("submitButtonIcon"),this._upgradeProperty("submitButtonStyle"),this._upgradeProperty("submitButtonType"),this._upgradeProperty("cancelButtonLabel"),this._upgradeProperty("cancelButtonIcon"),this._upgradeProperty("cancelButtonStyle"),this._upgradeProperty("cancelButtonType"),this._upgradeProperty("submitId"),this._upgradeProperty("cancelId")}attachEventListeners(){super.attachEventListeners(),this.submitButton.addEventListener("click",this._onClickSubmitButton),this.cancelButton.addEventListener("click",this._onClickCancelButton),this._inputElements.forEach(e=>{e.addEventListener("dirty",this._checkIfCancelOrSubmitShouldBeDisabled),e.addEventListener("validitychange",this._checkIfCancelOrSubmitShouldBeDisabled),e.addEventListener("clean",this._checkIfCancelOrSubmitShouldBeDisabled)})}removeEvents(){super.removeEventListeners(),this.submitButton.removeEventListener("click",this._onClickSubmitButton),this.cancelButton.removeEventListener("click",this._onClickCancelButton),this._inputElements.forEach(e=>{e.removeEventListener("dirty",this._checkIfCancelOrSubmitShouldBeDisabled),e.removeEventListener("validitychange",this._checkIfCancelOrSubmitShouldBeDisabled),e.removeEventListener("clean",this._checkIfCancelOrSubmitShouldBeDisabled)}),isNil6(this._customSubmitButtonRef)||this._customSubmitButtonRef.removeEventListener("click",this._onClickSubmitButton),isNil6(this._customCancelButtonRef)||this._customCancelButtonRef.removeEventListener("click",this._onClickSubmitButton)}updateSwipeGesture(){this.submitButton&&(this.submitButton.swipeGestureEnabled=this.swipeGestureEnabled),this.cancelButton&&(this.cancelButton.swipeGestureEnabled=this.swipeGestureEnabled)}submit(){this._submitShouldBeDisable||this._inputElements.forEach(e=>{e.submit()})}cancel(){this.submitButton.setAttribute("disabled","true"),this._inputElements.forEach(e=>{e.reset()})}_linkInputElements(){this._inputElements=Array.from(this.querySelectorAll("[feedbackmode='submit']"))}_getInputElements(){return this._inputElements}_initFormButtons(){this.submitButton=this._createButton(e.SUBMIT_LABEL,e.SUBMIT_TYPE,"submit",!0),this.cancelButton=this._createButton(e.CANCEL_LABEL,e.CANCEL_TYPE,"cancel",!0)}_linkFormButtons(){const e=this.querySelector("[formtype='submit']"),t=this.querySelector("[formtype='cancel']");null!==e&&(e.setAttribute("disabled","true"),this.submitButton=e),null!==t&&(this.cancelButton=t)}_checkIfCancelOrSubmitShouldBeDisabled(){const e=this._inputElements.every(e=>!1===e.getDirty());if(this._cancelShouldBeDisabled=e,this._cancelShouldBeDisabled?(this.cancelButton.setAttribute("disabled","true"),this.cancelButton.classList.add(this.primaryCssClass+"__submit--disabled")):(this.cancelButton.removeAttribute("disabled"),this.cancelButton.classList.remove(this.primaryCssClass+"__submit--disabled")),this.checkIfCustomCancelShouldBeDisabled(this._cancelShouldBeDisabled),this._inputElements.forEach(e=>{if(!0===e.getDirty())return this._submitShouldBeDisable=!1,void this.checkIfCustomSubmitShouldBeDisabled(this._submitShouldBeDisable)}),this._submitShouldBeDisable=e,this._submitShouldBeDisable&&this.checkIfCustomSubmitShouldBeDisabled(this._submitShouldBeDisable),this._inputElements.forEach(e=>{if(void 0!==e.getValid&&!1===e.getValid())return this._submitShouldBeDisable=!0,void this.checkIfCustomSubmitShouldBeDisabled(this._submitShouldBeDisable)}),this._submitShouldBeDisable)return this.submitButton.setAttribute("disabled","true"),void this.submitButton.classList.add(this.primaryCssClass+"__submit--disabled");this.submitButton.removeAttribute("disabled"),this.submitButton.classList.remove(this.primaryCssClass+"__submit--disabled")}checkIfCustomSubmitShouldBeDisabled(e){isNil6(this._customSubmitButtonRef)||(e?this._customSubmitButtonRef.classList.add("ch5-button--disabled"):this._customSubmitButtonRef.classList.remove("ch5-button--disabled"))}checkIfCustomCancelShouldBeDisabled(e){isNil6(this._customCancelButtonRef)||(e?this._customCancelButtonRef.classList.add("ch5-button--disabled"):this._customCancelButtonRef.classList.remove("ch5-button--disabled"))}_createButton(e,t,i,s=!1){const n=new Ch5Button;return n.setAttribute("label",e),n.setAttribute("type",t),n.setAttribute("formType",i),n.classList.add(this.primaryCssClass+"__"+i),s&&(n.setAttribute("disabled","true"),n.classList.add(this.primaryCssClass+"__"+i+"--disabled")),n}_onClickSubmitButton(){this.submit()}_onClickCancelButton(){this.cancel()}_upgradeProperty(e){if(this.constructor.prototype.hasOwnProperty(e)){const t=this[e];delete this[e],this[e]=t}}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5Form.ELEMENT_NAME,Ch5Form),Ch5Form.registerSignalAttributeTypes();import{isNil as isNil7,isEmpty as isEmpty4}from"lodash";import _17 from"lodash";var Ch5Image=class e extends Ch5Common{static ELEMENT_NAME="ch5-image";_ch5Properties;isDragging=!1;static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateurl:{direction:"state",stringJoin:1,contractName:!0},receivestatemode:{direction:"state",numericJoin:1,contractName:!0},sendeventonclick:{direction:"event",booleanJoin:1,contractName:!0},sendeventontouch:{direction:"event",booleanJoin:1,contractName:!0},sendeventonerror:{direction:"event",stringJoin:1,contractName:!0},receivestateallowvaluesonmove:{direction:"state",booleanJoin:1,contractName:!0},receivestateallowpositiondatatobesent:{direction:"state",booleanJoin:1,contractName:!0},sendeventxposition:{direction:"event",numericJoin:1,contractName:!0},sendeventyposition:{direction:"event",numericJoin:1,contractName:!0}};static COMPONENT_DATA={DIRECTIONS:{default:Ch5Common.DIRECTION[0],values:Ch5Common.DIRECTION,key:"direction",classListPrefix:"--dir--"}};static COMPONENT_PROPERTIES=[{default:!1,name:"allowValuesOnMove",nameForSignal:"receiveStateAllowValuesOnMove",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:!1,name:"allowPositionDataToBeSent",nameForSignal:"receiveStateAllowPositionDataToBeSent",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateAllowValuesOnMove",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateAllowPositionDataToBeSent",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventXPosition",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventYPosition",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];MODES={MIN_LENGTH:0,MAX_LENGTH:99};get alt(){return this._alt}set alt(e){null==e&&(e="");const t=this._getTranslatedValue("alt",e);this._alt===t&&this._img.alt===t||(this._alt=t,this._img.alt=t,this.setAttribute("alt",t),this._img.setAttribute("alt",t))}get height(){return this._height}set height(e){this._height!==e&&(this._height=e||"",this.style.height=e||"",this.setAttribute("height",this._height))}get width(){return this._width}set width(e){this._width!==e&&(this._width=e||"",this.style.width=e||"",this.setAttribute("width",this._width))}get refreshRate(){return this._refreshRate}set refreshRate(e){e=Number(e),isNaN(e)&&(e=0),this._refreshRate!==e&&(this._refreshRate=e)}get url(){return this._url}set url(e){var t;(_17.isNil(this.receiveStateUrl)||""===this.receiveStateUrl)&&(this._url||null==(t=this._img)||t.removeAttribute("src"),this._url!==e&&this.setImageDisplay(e))}set allowPositionDataToBeSent(e){this._ch5Properties.set("allowPositionDataToBeSent",e,null)}get allowPositionDataToBeSent(){return this._ch5Properties.get("allowPositionDataToBeSent")}set allowValuesOnMove(e){this._ch5Properties.set("allowValuesOnMove",e,null)}get allowValuesOnMove(){return this._ch5Properties.get("allowValuesOnMove")}set sendEventXPosition(e){this._ch5Properties.set("sendEventXPosition",e)}get sendEventXPosition(){return this._ch5Properties.get("sendEventXPosition")}set sendEventYPosition(e){this._ch5Properties.set("sendEventYPosition",e)}get sendEventYPosition(){return this._ch5Properties.get("sendEventYPosition")}set receiveStateAllowValuesOnMove(e){this._ch5Properties.set("receiveStateAllowValuesOnMove",e,null,e=>{this._ch5Properties.setForSignalResponse("allowValuesOnMove",e,null)})}get receiveStateAllowValuesOnMove(){return this._ch5Properties.get("receiveStateAllowValuesOnMove")}set receiveStateAllowPositionDataToBeSent(e){this._ch5Properties.set("receiveStateAllowPositionDataToBeSent",e,null,e=>{this._ch5Properties.setForSignalResponse("allowPositionDataToBeSent",e,null)})}get receiveStateAllowPositionDataToBeSent(){return this._ch5Properties.get("receiveStateAllowPositionDataToBeSent")}get direction(){return this._direction}set direction(e){e!==this._direction&&(null==e&&(e=Ch5Common.DIRECTION[0]),Ch5Common.DIRECTION.indexOf(e)>=0?this._direction=e:this._direction=Ch5Common.DIRECTION[0],this.setAttribute("dir",e))}set mode(e){if(this.logger.log('set mode("'+e+'")'),this._mode!==e){if(Number.isNaN(e))this._mode=0;else if(e>=this.MODES.MIN_LENGTH&&e<=this.MODES.MAX_LENGTH){const t=this.getElementsByTagName("ch5-image-mode");t&&t.length>0&&e<t.length?this._mode=e:this._mode=0}else this._mode=0;this.setAttribute("mode",String(this._mode)),this.setImageDisplay()}}get mode(){return this._mode}set receiveStateUser(e){if(this.info("set receiveStateUser('"+e+"')"),""===e||this._sigNameReceiveUser===e||null==e)return;if(this.user="",""!==this._sigNameReceiveUser&&void 0!==this._sigNameReceiveUser&&null!==this._sigNameReceiveUser){const e=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveUser),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&t.unsubscribe(this._subReceiveUser)}this._sigNameReceiveUser=e,this.setAttribute("receiveStateUser",e);const t=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveUser),i=Ch5SignalFactory.getInstance().getStringSignal(t);null!==i&&(this._subReceiveUser=i.subscribe(e=>{""!==e&&e!==this._user&&(this.setAttribute("user",e),this.user=e,this._initRefreshRate())}))}get receiveStateUser(){return this._attributeValueAsString("receiveStateUser")}set receiveStatePassword(e){if(this.info("set receiveStatePassword('"+e+"')"),""===e||this._sigNameReceivePassword===e||null==e)return;if(this.password="",""!==this._sigNameReceivePassword&&void 0!==this._sigNameReceivePassword&&null!==this._sigNameReceivePassword){const e=Ch5Signal.getSubscriptionSignalName(this._sigNameReceivePassword),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&t.unsubscribe(this._subReceivePassword)}this._sigNameReceivePassword=e,this.setAttribute("receivestatepassword",e);const t=Ch5Signal.getSubscriptionSignalName(this._sigNameReceivePassword),i=Ch5SignalFactory.getInstance().getStringSignal(t);null!==i&&(this._subReceivePassword=i.subscribe(e=>{""!==e&&e!==this._password&&(this.setAttribute("password",e),this.password=e,this._initRefreshRate())}))}get receiveStatePassword(){return this._attributeValueAsString("receiveStatePassword")}get receiveStateUrl(){return this._attributeValueAsString("receivestateurl")}set receiveStateUrl(e){if(this.info("set receiveStateUrl('"+e+"')"),""===e||this._sigNameReceiveUrl===e||null==e)return;if(this.url="",""!==this._sigNameReceiveUrl&&void 0!==this._sigNameReceiveUrl&&null!==this._sigNameReceiveUrl){const e=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveUrl),t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&t.unsubscribe(this._subReceiveUrl)}this._sigNameReceiveUrl=e,this.setAttribute("receivestateurl",e);const t=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveUrl),i=Ch5SignalFactory.getInstance().getStringSignal(t);null!==i&&(this._subReceiveUrl=i.subscribe(e=>{e===this._url&&""!==e||(this.logger.log("value from signal is ",e),""===e&&""!==this.sendEventOnError&&(e=this.receiveStateUrl),this.setUrlByInput(e),this.canProcessUri()&&this.processUri())}))}get receiveStateMode(){return this._attributeValueAsString("receivestatemode")}set receiveStateMode(e){if(this.info("set receivestatemode('"+e+"')"),""===e||this._sigNameReceiveMode===e||null==e)return;if(this.mode=0,""!==this._sigNameReceiveMode&&void 0!==this._sigNameReceiveMode&&null!==this._sigNameReceiveMode){const e=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveMode),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&t.unsubscribe(this._subReceiveMode)}this._sigNameReceiveMode=e,this.setAttribute("receivestatemode",e);const t=Ch5Signal.getSubscriptionSignalName(this._sigNameReceiveMode),i=Ch5SignalFactory.getInstance().getNumberSignal(t);null!==i&&(this._subReceiveMode=i.subscribe(e=>{e!==this.mode&&(this.mode=Number(e),this._initRefreshRate())}))}get sendEventOnClick(){return this._sigNameSendOnClick}set sendEventOnClick(e){this.info("set sendEventOnClick('"+e+"')"),""!==e&&this._sigNameSendOnClick!==e&&(this._sigNameSendOnClick=e,this.setAttribute("sendeventonclick",e))}set sendEventOnError(e){this.info("set sendEventOnError('"+e+"')"),""!==e&&this._sigNameSendOnError!==e&&(this._sigNameSendOnError=e,this.setAttribute("sendeventonerror",e))}get sendEventOnError(){return this._sigNameSendOnError}set sendEventOnTouch(e){this.info("set sendEventOnTouch('"+e+"')"),""!==e&&this._sigNameSendOnTouch!==e&&(this._sigNameSendOnTouch=e,this.setAttribute("sendeventontouch",e))}get sendEventOnTouch(){return this._sigNameSendOnTouch}set user(e){isNil7(e)||this.user===e||(this._user=e,this.canProcessUri()&&this.processUri())}get user(){return this._user}set password(e){(isNil7(e)||this.password!==e)&&(this._password=e,this.canProcessUri()&&this.processUri())}get password(){return this._password}set protocol(e){isNil7(e)||(this._protocol=e)}get protocol(){return this._protocol}constructor(){super(),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.errorEvent=new CustomEvent("error",{bubbles:!0,cancelable:!1,detail:"ch5-image triggered error CustomEvent"}),void 0===this._img.classList&&(this._img=document.createElement("img")),this._img.classList.add(this.primaryCssClass),this._img.classList.add(this.primaryCssClass+"__img"),this._img.setAttribute("draggable","false")}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=["alt","width","height","user","password","url","refreshrate","dir","mode","allowpositiondatatobesent","allowvaluesonmove","receivestateurl","receivestateallowvaluesonmove","receivestateallowpositiondatatobesent","sendeventonclick","sendeventonerror","sendeventontouch","sendeventxposition","sendeventyposition"];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}primaryCssClass="ch5-image";_img={};_alt="";_height="";_width="";_refreshRate=0;_url="";_direction=Ch5Common.DIRECTION[0];_sigNameReceiveUrl="";_sigNameReceiveUser="";_sigNameReceivePassword="";_sigNameReceiveMode="";_subReceiveUrl="";_subReceiveUser="";_subReceivePassword="";_subReceiveMode="";_sigNameSendOnClick="";_sigNameSendOnError="";_sigNameSendOnTouch="";_pressable=null;errorEvent;_timerIdForTouch=null;_longTouch=!1;_intervalIdForOnTouch=null;_intervalTimeoutForOnTouch=500;_intervalIdForRefresh=null;_imageWasLoaded=!1;_user="";_password="";_protocol="";_isPressedSubscription=null;_buttonPressedInPressable=!1;_repeatDigitalInterval=0;STATE_CHANGE_TIMEOUTS=500;_mode=0;static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}connectedCallback(){this.info(" connectedCallback() - start"),this._pressable=new Ch5Pressable(this),this._onClick=this._onClick.bind(this),this._pointerDown=this._pointerDown.bind(this),this._pointerUp=this._pointerUp.bind(this),this._pointerCancel=this._pointerCancel.bind(this),this._pointerMove=this._pointerMove.bind(this),this._onError=this._onError.bind(this),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Image),this.setAttribute("data-ch5-id",this.getCrId()),null!==this._pressable&&(this._pressable.init(),this._subscribeToPressableIsPressed()),customElements.whenDefined("ch5-image").then(()=>{this.cacheComponentChildrens();const e=this.querySelector("img");e&&e.remove(),this._img.parentElement!==this&&this.appendChild(this._img),this.style.overflow="hidden",this.initAttributes(),this.attachEventListeners(),this.updateCssClasses(),this._initRefreshRate(),this.initCommonMutationObserver(this),this.info(" connectedCallback() - end")}),subscribeInViewPortChange(this,()=>{this.logger.log("subscribeInViewPortChange: "+this.elementIsInViewPort)})}disconnectedCallback(){this.removeEvents(),this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver(),null!==this._intervalIdForRefresh&&(window.clearInterval(this._intervalIdForRefresh),Ch5CoreIntersectionObserver.getInstance()instanceof Ch5CoreIntersectionObserver&&Ch5CoreIntersectionObserver.getInstance().unobserve(this)),null!==this._timerIdForTouch&&(window.clearTimeout(this._timerIdForTouch),this._timerIdForTouch=null),null!==this._intervalIdForOnTouch&&(window.clearInterval(this._intervalIdForOnTouch),this._intervalIdForOnTouch=null)}attributeChangedCallback(t,i,s){if(i===s)return;this.info('ch5-image attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}switch(t){case"url":this.hasAttribute("url")?this.url=s:this.url="";break;case"alt":this.hasAttribute("alt")?(this.alt=s,this.setAttribute("aria-label",this.alt)):(this.alt="",this.removeAttribute("aria-label"));break;case"width":this.hasAttribute("width")?this.width=s:this.width="";break;case"height":this.hasAttribute("height")?this.height=s:this.height="";break;case"mode":this.mode=parseFloat(s);break;case"refreshrate":this.hasAttribute("refreshrate")?(this.refreshRate=Number(s),null!==this._refreshRate&&0!==this._refreshRate&&Ch5CoreIntersectionObserver.getInstance().observe(this,this.updateElementInViewportChange)):this.refreshRate=0,this._initRefreshRate();break;case"receivestateuser":this.hasAttribute("receivestateuser")&&(this.receiveStateUser=s);break;case"receivestatepassword":this.hasAttribute("receivestatepassword")&&(this.receiveStatePassword=s);break;case"receivestateurl":this.hasAttribute("receivestateurl")?this.receiveStateUrl=s:this.receiveStateUrl="";break;case"receivestatemode":this.hasAttribute("receivestatemode")?this.receiveStateMode=s:this.receiveStateMode="";break;case"sendeventonclick":this.hasAttribute("sendeventonclick")?this.sendEventOnClick=s:this.sendEventOnClick="";break;case"sendeventontouch":this.hasAttribute("sendeventontouch")?this.sendEventOnTouch=s:this.sendEventOnTouch="";break;case"sendeventonerror":this.hasAttribute("sendeventonerror")?this.sendEventOnError=s:this.sendEventOnError="";break;case"dir":this.hasAttribute("dir")?this.direction=s.toLowerCase():this.direction=Ch5Common.DIRECTION[0],this._img.classList.add(this.primaryCssClass+"--dir--"+this.direction);break;case"user":this.hasAttribute("user")?this.user=s:this.user="";break;case"password":this.hasAttribute("password")?this.password=s:this.password="";break;default:super.attributeChangedCallback(t,i,s)}}unsubscribeFromSignals(){super.unsubscribeFromSignals();const e=Ch5SignalFactory.getInstance();if(""!==this._subReceiveUrl&&""!==this._sigNameReceiveUrl){const t=e.getStringSignal(this._sigNameReceiveUrl);null!==t&&(t.unsubscribe(this._subReceiveUrl),this._sigNameReceiveUrl="")}}setImageDisplay(e=""){if(!this.hasAttribute("receivestateurl")){const t=this.getElementsByTagName("ch5-image-mode");if(t&&t.length>0){const i=t[this.mode];if(i){const t=_17.isNil(i.getAttribute("url"))||""===i.getAttribute("url")?_17.isNil(e)||""===e?"":e:i.getAttribute("url");this.setUrlByInput(t)}}else{const t=_17.isNil(e)||""===e?this.getAttribute("url"):e;this.setUrlByInput(t)}this.canProcessUri()&&this.processUri()}}setUrlByInput(e){this.logger.log("setUrlByInput url: ",e),this._url=e,this.setAttribute("url",this._url),this._maybeLoadImage()}processUri(){const e={protocol:this.protocol,user:this.user,password:this.password,url:this._url},t=Ch5Common.processUri(e);t&&(this._url=t,this.setAttribute("url",this._url),this._maybeLoadImage())}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this.hasAttribute("receiveStateUrl")&&(this.receiveStateUrl=this.getAttribute("receiveStateUrl")),this.hasAttribute("receivestateuser")&&(this.receiveStateUser=this.getAttribute("receivestateuser")),this.hasAttribute("receivestatepassword")&&(this.receiveStatePassword=this.getAttribute("receivestatepassword")),this.hasAttribute("receivestatemode")&&(this.receiveStateMode=this.getAttribute("receivestatemode"))}attachEventListeners(){super.attachEventListeners(),this.addEventListener("click",this._onClick),this.addEventListener("pointerdown",this._pointerDown,{passive:!0}),this.addEventListener("pointerup",this._pointerUp),this.addEventListener("pointermove",this._pointerMove,{passive:!0}),this.addEventListener("pointercancel",this._pointerCancel),this._img.addEventListener("error",this._onError)}updateCssClasses(){super.updateCssClasses()}_subscribeToPressableIsPressed(){null===this._isPressedSubscription&&null!==this._pressable&&(this._isPressedSubscription=this._pressable.observablePressed.subscribe(e=>{this.info(`Ch5Button.pressableSubscriptionCb(${e})`),e!==this._buttonPressedInPressable&&(this._buttonPressedInPressable=e,!1===e?(null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),this.sendValueForRepeatDigitalWorking(!1),this.isDragging=!1):(this.sendValueForRepeatDigitalWorking(!0),null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),this._repeatDigitalInterval=window.setInterval(()=>{this.sendValueForRepeatDigitalWorking(!0)},200)))}))}sendValueForRepeatDigitalWorking(e){if(this.info(`Ch5Button.sendValueForRepeatDigital(${e})`),!this._sigNameSendOnTouch&&!this._sigNameSendOnClick)return;const t=Ch5SignalFactory.getInstance().getObjectAsBooleanSignal(this._sigNameSendOnTouch),i=Ch5SignalFactory.getInstance().getObjectAsBooleanSignal(this._sigNameSendOnClick);i&&t&&i.name===t.name?i.publish({[Ch5SignalBridge.REPEAT_DIGITAL_KEY]:e}):(t&&t.name&&t.publish({[Ch5SignalBridge.REPEAT_DIGITAL_KEY]:e}),i&&i.name&&i.publish({[Ch5SignalBridge.REPEAT_DIGITAL_KEY]:e}))}enableImageLoading(){this.info("enableImageLoading()"),this._imageWasLoaded||(this._img.src="",null===this.refreshRate||0===this.refreshRate?this._maybeLoadImage(!1):this._initRefreshRate())}disableImageLoading(){this.info("disableImageLoading()"),null!==this._intervalIdForRefresh&&(window.clearInterval(this._intervalIdForRefresh),this._imageWasLoaded=!1)}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}canProcessUri(){return!(isNil7(this.password)||isEmpty4(this.password)||isNil7(this.user)||isEmpty4(this.user)||isNil7(this._url)||isEmpty4(this._url))}isVisible(){return function e(t){const i=t.parentNode;return!!function(e){for(;e=e.parentNode;)if(e===document)return!0;return!1}(t)&&(9===i.nodeType||!(!function(e){let t={};if(document&&document.defaultView&&(t=document.defaultView.getComputedStyle(e),"0"===t.opacity||"hidden"===t.visibility||"none"===t.display))return!1;return!0}(t)||t.hasAttribute("inert"))&&(!i||e(i)))}(this)}afterHandlingShow(){this.info("afterHandlingShow()"),null===this.refreshRate||0===this.refreshRate?this._maybeLoadImage(!1):this._initRefreshRate()}afterHandlingHide(){this.info("afterHandlingHide()"),null!==this._intervalIdForRefresh&&window.clearInterval(this._intervalIdForRefresh),this._img.src=""}removeEvents(){super.removeEventListeners(),this.removeEventListener("click",this._onClick),this.removeEventListener("pointerdown",this._pointerDown),this.removeEventListener("pointerup",this._pointerUp),this.removeEventListener("pointermove",this._pointerMove),this.removeEventListener("pointercancel",this._pointerCancel),this._img.removeEventListener("error",this._onError),null!==this._pressable&&this._pressable.destroy(),null!==this._isPressedSubscription&&(this._isPressedSubscription.unsubscribe(),this._isPressedSubscription=null)}_maybeLoadImage(e){if(null!==this._url&&""!==this.url&&!0===this.show){const t=e?this._insertParamToUrl("__cr_avoid_cache",(new Date).getTime().toString()):this._url;this._img.src=t,this._imageWasLoaded=!0,this.info("image source ",this._img.src)}}_initRefreshRate(){this.info("initRefreshRate"),this._intervalIdForRefresh&&window.clearInterval(this._intervalIdForRefresh),null!==this._url&&""!==this._url&&null!==this._refreshRate&&0!==this._refreshRate&&(this._maybeLoadImage(!0),this._intervalIdForRefresh=window.setInterval(()=>{this._maybeLoadImage(!0)},1e3*this._refreshRate))}_pointerDown(e){this.info("Ch5Image._pointerDown()"),this.isDragging=!0,this._timerIdForTouch&&window.clearTimeout(this._timerIdForTouch)}handleAllowPositionDataToBeSent(e){var t,i;const s=this.getBoundingClientRect(),n=Math.round(e.clientX-s.x),r=Math.round(e.clientY-s.y),a=this.getAnalogValue(n,this.clientWidth),l=this.getAnalogValue(r,this.clientHeight);this.sendEventXPosition&&this.sendEventYPosition&&(null==(t=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventXPosition))||t.publish(a),null==(i=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventYPosition))||i.publish(l))}getAnalogValue(e,t){return Math.min(Math.max(Math.round(65535*e/t),0),65535)}_pointerUp(e){this.info("Ch5Image._pointerUp()"),this.allowPositionDataToBeSent&&this.sendEventXPosition&&this.sendEventYPosition&&(this.isDragging=!1,this.handleAllowPositionDataToBeSent(e)),this._stopSendSignalOnTouch()}_pointerMove(e){this.allowPositionDataToBeSent&&this.allowValuesOnMove&&this.sendEventXPosition&&this.sendEventYPosition&&this.isDragging&&this.handleAllowPositionDataToBeSent(e),this._stopSendSignalOnTouch()}_pointerCancel(e){this.isDragging=!1,this._stopSendSignalOnTouch()}_onClick(e){this.info("Ch5Image._onClick()")}_onError(e){this.logger.log("onError called"),this.dispatchEvent(this.errorEvent);const t="Error loading image with src: "+this._url;this._sendValueForErrorSignal(t)}_onLongTouch(){this._longTouch||(this._longTouch=!0),this._sendValueForTouchSignal(!0),this._intervalIdForOnTouch&&window.clearInterval(this._intervalIdForOnTouch),this._intervalIdForOnTouch=window.setInterval(()=>this._sendValueForTouchSignal(!0),this._intervalTimeoutForOnTouch)}_stopSendSignalOnTouch(){this._longTouch&&(this._sendValueForTouchSignal(!1),this._longTouch=!1),null!==this._timerIdForTouch&&(window.clearTimeout(this._timerIdForTouch),this._timerIdForTouch=null),null!==this._intervalIdForOnTouch&&(window.clearInterval(this._intervalIdForOnTouch),this._intervalIdForOnTouch=null)}_sendValueForTouchSignal(e){if(""!==this._sigNameSendOnTouch&&!isNil7(this._sigNameSendOnTouch)){const t=Ch5SignalFactory.getInstance().getObjectAsBooleanSignal(this._sigNameSendOnTouch);null!==t&&t.publish({[Ch5SignalBridge.REPEAT_DIGITAL_KEY]:e})}}_sendValueForClickSignal(){let e=null;""!==this._sigNameSendOnClick&&void 0!==this._sigNameSendOnClick&&null!==this._sigNameSendOnClick&&(e=Ch5SignalFactory.getInstance().getBooleanSignal(this._sigNameSendOnClick),null!==e&&(e.publish(!0),e.publish(!1)))}_sendValueForErrorSignal(e){let t=null;""!==this._sigNameSendOnError&&void 0!==this._sigNameSendOnError&&null!==this._sigNameSendOnError&&(t=Ch5SignalFactory.getInstance().getStringSignal(this._sigNameSendOnError),null!==t&&t.publish(e))}_insertParamToUrl(e,t){if(e=encodeURI(e),t=encodeURI(t),0===this._getUrlVars().size)return this._url+"?"+e+"="+t;const i=this.url.split("&");let s,n=i.length;for(;n--;)if(s=i[n].split("="),s[0]===e){s[1]=t,i[n]=s.join("=");break}return n<0&&(i[i.length]=[e,t].join("=")),i.join("&")}_getUrlVars(){const e=new Map;let t;const i=this._url.indexOf("?");if(i>1){const s=this._url.slice(i+1).split("&");for(const i of s)t=i.split("="),e.set(t[0],t[1])}return e}updateElementInViewportChange(e){e&&this._maybeLoadImage(!0)}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5Image.ELEMENT_NAME,Ch5Image),Ch5Image.registerSignalAttributeTypes();import _18 from"lodash";var Ch5ImageMode=class extends Ch5Log{static ELEMENT_NAME="ch5-image-mode";_url="";_parentCh5Image;set url(e){e&&this._url!==e&&(this._url=e,this.setAttribute("url",e),this._parentCh5Image.setImageDisplay())}get url(){return this._url}static get observedAttributes(){return Ch5Log.observedAttributes.concat(["url"])}constructor(){super(),this.logger.start("constructor()"),this._parentCh5Image=this.getParentImage(),this.logger.stop()}attributeChangedCallback(e,t,i){if(i!==t&&"url"===e)this.url=i}getParentImage(){const e=t=>_18.isNil(t)||"CH5-IMAGE"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5ImageMode.ELEMENT_NAME,Ch5ImageMode);import _19 from"lodash";import isNil8 from"lodash/isNil";var Ch5ImportHtmlSnippet=class e extends Ch5Common{static ELEMENT_NAME="ch5-import-htmlsnippet";static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES};_elContainer={};_url="";_sigNameReceiveState="";_subReceiveState="";_sigNameSendOnError="";errorEvent;sigNameSendOnLoad="";_sendEventOnShowSigName="";constructor(){super(),this._elContainer=document.createElement("div"),this.errorEvent=new CustomEvent("error",{bubbles:!0,cancelable:!1}),this._onError=this._onError.bind(this)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}get url(){return this._url}set url(e){this._url=e}get sendEventOnShow(){return this._sendEventOnShowSigName}set sendEventOnShow(e){this.info("set sendEventOnShow('"+e+"')"),""!==e&&this._sendEventOnShowSigName!==e&&(this._sendEventOnShowSigName=e,this.setAttribute("sendeventonshow",e))}static get observedAttributes(){return Ch5Common.observedAttributes.concat(["url"])}attributeChangedCallback(e,t,i){switch(e){case"url":this.hasAttribute("url")&&!_19.isNil(this.getAttribute("url"))&&""!==this.getAttribute("url")&&this.url!==i?(this.url=i,this.loadHTMLContent(this.url)):this.url="";break;case"sendeventonshow":this.hasAttribute("sendeventonshow")?this.sendEventOnShow=i:this.sendEventOnShow="";break;default:super.attributeChangedCallback(e,t,i)}}unsubscribeFromSignals(){super.unsubscribeFromSignals();const e=Ch5SignalFactory.getInstance();if(!isNil8(this._subReceiveState)&&!isNil8(this._sigNameReceiveState)){const t=e.getStringSignal(this._sigNameReceiveState);t&&(t.unsubscribe(this._subReceiveState),this._sigNameReceiveState="")}}connectedCallback(){this.info("Ch5ImportHTMLSnippet.connectedCallback()"),this.initAttributes(),customElements.whenDefined("ch5-import-htmlsnippet").then(()=>{this.cacheComponentChildrens(),this.firstChild!==this._elContainer&&this.appendChild(this._elContainer),this._sendSignalValueOnShow(),this.info("ch5-import-htmlsnippet connectedCallback() - end")})}disconnectedCallback(){this.info("Ch5ImportHTMLSnippet.disconnectedCallback()"),this.unsubscribeFromSignals()}sendValueOnLoadSignal(e){let t=null;isNil8(this.sigNameSendOnLoad)||(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sigNameSendOnLoad),t&&t.publish(e))}onLoadAction(e){this.sigNameSendOnLoad=e;let t=null;isNil8(this.sigNameSendOnLoad)||(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sigNameSendOnLoad),t&&(t.publish(!0),t.publish(!1))),this.sendValueOnLoadSignal(!1)}async loadHTMLContent(e){try{const t=await this.asyncLoadContent(e);this._elContainer.innerHTML=t,publishEvent("object",`ch5-import-htmlsnippet:${this.id}`,{loaded:!0,url:e,id:this.id})}catch(t){this.info(`ch5-import-htmlsnippet failed to load the URL: ${e}, ${t}`)}}asyncLoadContent(e){return new Promise((t,i)=>{const s=new XMLHttpRequest;s.open("GET",e),s.onload=()=>{s.status<300&&null!==s.response&&(""===s.responseType||"text"===s.responseType)?t(s.responseText):i(`load failed with status ${s.status}, statusText ${s.statusText}, responseType ${s.responseType}`)},s.onerror=()=>{i("There was a network error.")},s.send()})}_sendSignalValueOnShow(){this.info("Ch5ImportHTMLSnippet._sendSignalValueOnShow()");let e=null;""!==this._sendEventOnShowSigName&&void 0!==this._sendEventOnShowSigName&&null!==this._sendEventOnShowSigName&&(e=Ch5SignalFactory.getInstance().getBooleanSignal(this._sendEventOnShowSigName),null!==e&&(e.publish(!0),e.publish(!1)))}_onError(e){this.dispatchEvent(this.errorEvent);const t=`Error loading URL: ${this._url}`;this._sendValueForErrorSignal(t)}_sendValueForErrorSignal(e){let t=null;isNil8(this._sigNameSendOnError)||(t=Ch5SignalFactory.getInstance().getStringSignal(this._sigNameSendOnError),t&&t.publish(e))}initAttributes(){super.initAttributes(),this.hasAttribute("url")&&(this._url=this.getAttribute("url"))}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5ImportHtmlSnippet.ELEMENT_NAME,Ch5ImportHtmlSnippet),Ch5ImportHtmlSnippet.registerSignalAttributeTypes();var Ch5JoinToTextBoolean=class e extends Ch5Common{static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatevalue:{direction:"state",booleanJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static COMPONENT_PROPERTIES=[{default:!1,name:"value",nameForSignal:"receiveStateValue",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",name:"textWhenTrue",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"textWhenFalse",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateValue",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-jointotext-boolean";_ch5Properties;set value(e){this._ch5Properties.set("value",e,()=>{this.toggleText()})}get value(){return this._ch5Properties.get("value")}set textWhenTrue(e){this._ch5Properties.set("textWhenTrue",e,()=>{this.toggleText()})}get textWhenTrue(){return this._ch5Properties.get("textWhenTrue")}set textWhenFalse(e){this._ch5Properties.set("textWhenFalse",e,()=>{this.toggleText()})}get textWhenFalse(){return this._ch5Properties.get("textWhenFalse")}set receiveStateValue(e){this._ch5Properties.set("receiveStateValue",e,null,e=>{this._ch5Properties.setForSignalResponse("value",e,()=>{this.toggleText()})})}get receiveStateValue(){return this._ch5Properties.get("receiveStateValue")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}connectedCallback(){this.initAttributes(),customElements.whenDefined(e.ELEMENT_NAME).then(()=>{this.toggleText()})}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}disconnectedCallback(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-jointotext-boolean attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}toggleText(){!0!==this.value?!1!==this.value?this.textContent="":this.textContent=this._getTranslatedValue("textwhenfalse",this.textWhenFalse):this.textContent=this._getTranslatedValue("textwhentrue",this.textWhenTrue)}};Ch5JoinToTextBoolean.registerCustomElement(),Ch5JoinToTextBoolean.registerSignalAttributeTypes();import{isNil as isNil9}from"lodash";var NumericFormat=class{};import _20 from"lodash";var FloatFormat=class e extends NumericFormat{static MAX_ANALOG=65535;static HALF_MAX_ANALOG=32767;static MIN_ANALOG=-65535;static HALF_MIN_ANALOG=-32768;format(t,{decimalLength:i,length:s}){if(isNaN(t))return"0".padStart(s-i,"0")+"."+"0".padEnd(i,"0");let n=_20.isNil(t)||""===String(t)||isNaN(t)?"":t<0?"-":"";t>e.HALF_MAX_ANALOG?(n="-",t=t>e.MAX_ANALOG?e.MAX_ANALOG:t,t-=e.MAX_ANALOG+1):t<e.HALF_MIN_ANALOG&&(n="",t=t>e.MIN_ANALOG?t:e.MIN_ANALOG,t+=e.MAX_ANALOG+1);return n+((t=Math.abs(t))/Math.pow(10,i)).toFixed(i).padStart(s+1,"0")}},HexFormat=class extends NumericFormat{format(e,t){const{length:i}=t;if(isNaN(e))return"0".padStart(i,"0");const s=65535,n=-65535;e>s?e=s:e<n&&(e=n),e<0&&(e+=65536);return e.toString(16).toUpperCase().padStart(i,"0")}};import{isNaN as isNaN2}from"lodash";var PercentageFormat=class extends NumericFormat{format(e,t){const{min:i,max:s,length:n,decimalLength:r}=t;if(isNaN2(e)||s<i)return"".padStart(n,"0")+"."+"".padEnd(r,"0");let a=s;if(a=s,(0===a||isNaN2(a))&&(a=s),e>a&&(e=a),i===e&&s===e)return"100".padStart(n,"0")+"."+"".padEnd(r,"0");const l=((100*(e-i)+Number.EPSILON)/(s-i)).toFixed(r);return 0===r?l.padStart(n,"0"):l.padStart(n+r+1,"0")}},RawFormat=class extends NumericFormat{format(e,t){return isNaN(e)?"0":(e=(e=Math.abs(e))>65535?65535:e).toString()}};import _21 from"lodash";var SignedFormat=class extends NumericFormat{format(e,t){const{length:i}=t;if(isNaN(e))return"".padStart(i,"0");let s=_21.isNil(e)||""===String(e)||isNaN(e)?"":e<0?"-":"";const n=65535,r=-65535;let a="";return e>32767?(s="-",e=e>n?n:e,e-=65536):e<-32768&&(s="",e=e>r?e:r,e+=65536),a=s+Math.abs(e).toString().padStart(i,"0"),a}},TimeFormat=class extends NumericFormat{format(e,t){if(isNaN(e)||e<0)return"00:00";let i="";const s=Math.floor(Math.floor(e/60)/60)%24,n=Math.floor(e/60)%60,r=Math.round(e%60);return i+=(0===s?"":(s<10?"0"+s:s)+":")+(n<10?"0"+n:n)+":"+(r<10?"0"+r:r),i}},UnsignedFormat=class extends NumericFormat{format(e,t){const{length:i}=t;return isNaN(e)?"".padStart(i,"0"):(e=(e=Math.abs(e))>65535?65535:e).toString().padStart(i,"0")}},NumericFormatFactory=class e{static INSTANCE;constructor(){}static getInstance(){return this.INSTANCE instanceof e||(this.INSTANCE=new e),this.INSTANCE}getFormat(e){switch(e.trim().toLowerCase()){case"float":return new FloatFormat;case"percentage":return new PercentageFormat;case"hex":return new HexFormat;case"raw":return new RawFormat;case"unsigned":return new UnsignedFormat;case"signed":default:return new SignedFormat;case"time":return new TimeFormat}}};import _22 from"lodash";var Ch5JoinToTextNumeric=class e extends Ch5Common{static PERCENTAGE_MAX=65535;static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatevalue:{direction:"state",numericJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static ELEMENT_NAME="ch5-jointotext-numeric";static NUMERIC_FORMAT_TYPES=["signed","float","percentage","hex","raw","unsigned","time"];_receiveStateValue="";_subReceiveStateValue="";_value="";_decimalLength=0;_length=0;_min=0;_max=e.PERCENTAGE_MAX;_formattedValue=null;_type="signed";_numericFormatFactory=NumericFormatFactory.getInstance();_currentNumericFormat;formatValue=this.debounce(()=>{this.formatValueDebounce()},30);set receiveStateValue(e){if(isNil9(e))return;if(""!==this.receiveStateValue&&void 0!==this.receiveStateValue&&null!==this.receiveStateValue){const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&t.unsubscribe(this._subReceiveStateValue)}this._receiveStateValue=e,this.setAttribute("receivestatevalue",e);const t=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),i=Ch5SignalFactory.getInstance().getNumberSignal(t);null!==i&&(this._subReceiveStateValue=i.subscribe(e=>{e!==parseFloat(this.value)&&this.setAttribute("value",e+"")}))}get receiveStateValue(){return this._receiveStateValue}set value(e){this._value!==e&&(_22.isNil(e)&&(e=""),this._value=e,this.setAttribute("value",e),this.formatValue())}get value(){return this._value}set type(t){this._type!==t&&((_22.isNil(t)||e.NUMERIC_FORMAT_TYPES.indexOf(t)<0)&&(t=e.NUMERIC_FORMAT_TYPES[0]),this._type=t,this.setAttribute("type",t),this._currentNumericFormat=this._numericFormatFactory.getFormat(t),this.formatValue())}get type(){return this._type}set decimalLength(e){if(this._decimalLength!==e){const t=Number(e);isNaN(t)||_22.isNil(t)?this._decimalLength=0:this._decimalLength=t>5?5:t,this.setAttribute("decimalLength",this._decimalLength+""),this.formatValue()}}get decimalLength(){return this._decimalLength}set length(e){if(this._length!==e){const t=Number(e);isNaN(t)||_22.isNil(t)?this._length=0:this._length=t>5?5:t,this.setAttribute("length",this._length+""),this.formatValue()}}get length(){return this._length}set min(e){if(this._min!==e){if(isNil9(e))return this._min=0,void("percentage"===this.type&&(this.setAttribute("min",e+""),this.formatValue()));this._min=e,this.setAttribute("min",e+""),this.formatValue()}}get min(){return this._min}set max(t){if(this._max!==t){if(isNil9(t))return this._max=e.PERCENTAGE_MAX,void("percentage"===this.type&&(this.setAttribute("max",t),this.formatValue()));this._max=t,this.setAttribute("max",t+""),this.formatValue()}}get max(){return this._max}set formattedValue(e){this._formattedValue!==e&&(this._formattedValue=e,this.textContent=e+"")}get formattedValue(){return this._formattedValue}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this._currentNumericFormat=this._numericFormatFactory.getFormat(this.type)}static get observedAttributes(){return Ch5Common.observedAttributes.concat(["receivestatevalue","value","type","length","decimallength","min","max"])}attributeChangedCallback(e,t,i){if(t!==i)switch(e){case"value":this.value=i;break;case"receivestatevalue":this.receiveStateValue=i;break;case"type":this.type=i;break;case"decimallength":this.decimalLength=parseFloat(i);break;case"length":this.length=parseFloat(i);break;case"min":this.min=parseFloat(i);break;case"max":this.max=parseFloat(i);break;default:super.attributeChangedCallback(e,t,i)}}connectedCallback(){this.initAttributes(),customElements.whenDefined(e.ELEMENT_NAME).then(()=>{this.formatValue()})}initAttributes(){super.initAttributes(),this.hasAttribute("value")&&(this.value=this.getAttribute("value")+""),this.hasAttribute("receivestatevalue")&&(this.receiveStateValue=this.getAttribute("receivestatevalue")+""),this.hasAttribute("type")&&(this.type=this.getAttribute("type"))}disconnectedCallback(){const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&(t.unsubscribe(this._subReceiveStateValue),this._receiveStateValue="")}formatValueDebounce(){this.formattedValue=this._currentNumericFormat.format(Number(this.value),{decimalLength:this.decimalLength,length:this.length,min:this.min,max:this.max})}};Ch5JoinToTextNumeric.registerCustomElement(),Ch5JoinToTextNumeric.registerSignalAttributeTypes();import{isNil as isNil10}from"lodash";var Ch5JoinToTextString=class e extends Ch5Common{static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatevalue:{direction:"state",stringJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static ELEMENT_NAME="ch5-jointotext-string";_receiveStateValue="";_textWhenEmpty="";_value="";_subReceiveStateValue="";set textWhenEmpty(e){this._textWhenEmpty!==e&&(isNil10(e)&&(e=""),this._textWhenEmpty=e,this.setAttribute("textWhenEmpty",e)),this.setTextContent()}get textWhenEmpty(){return this._textWhenEmpty}set receiveStateValue(e){if(this._receiveStateValue!==e){if(isNil10(e))return;if(""!==this.receiveStateValue&&void 0!==this.receiveStateValue&&null!==this.receiveStateValue){const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&t.unsubscribe(this._subReceiveStateValue)}this._receiveStateValue=e,this.setAttribute("receivestatevalue",e);const t=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),i=Ch5SignalFactory.getInstance().getStringSignal(t);if(null===i)return;this._subReceiveStateValue=i.subscribe(e=>{e!==this.value&&this.setAttribute("value",e+"")})}}get receiveStateValue(){return this._receiveStateValue}set value(e){this._value!==e&&(isNil10(e)&&(e=""),this._value=e,this.setAttribute("value",e+"")),this.setTextContent()}get value(){return this._value}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}static get observedAttributes(){return Ch5Common.observedAttributes.concat(["value","textwhenempty","receivestatevalue"])}connectedCallback(){this.initAttributes(),customElements.whenDefined(e.ELEMENT_NAME).then(()=>{this.setTextContent()})}initAttributes(){super.initAttributes(),this.hasAttribute("textwhenempty")?this.textWhenEmpty=this.getAttribute("textwhenempty"):this.textWhenEmpty="",this.hasAttribute("value")?this.value=this.getAttribute("value"):this.value="",this.hasAttribute("receivestatevalue")&&(this.receiveStateValue=this.getAttribute("receivestatevalue"))}disconnectedCallback(){const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&(t.unsubscribe(this._subReceiveStateValue),this._receiveStateValue="")}attributeChangedCallback(e,t,i){if(t===i)return;switch(e.toLowerCase()){case"value":this.value=i;break;case"textwhenempty":this.textWhenEmpty=i;break;case"receivestatevalue":this.receiveStateValue=i;break;default:super.attributeChangedCallback(e,t,i)}}setTextContent(){this.value&&""!==this.value?this.textContent=this._getTranslatedValue("value",this.value):this.textContent=this._getTranslatedValue("textWhenEmpty",this.textWhenEmpty)}};Ch5JoinToTextString.registerCustomElement(),Ch5JoinToTextString.registerSignalAttributeTypes();var CH5KeypadUtils=class{static KEYPAD_BUTTON_KEY=["button1","button2","button3","button4","button5","button6","button7","button8","button9","buttonstar","button0","buttonhash","buttonextra"];static CONTRACT_SEND_EVENT_ON_CLICK=["Press1","Press2","Press3","Press4","Press5","Press6","Press7","Press8","Press9","PressStar","Press0","PressHash","PressExtraButton"];static KEYPAD_DEFAULT_VALUES=[{key:"button1",iconClass:"",labelMajor:"1",labelMinor:" ",pressed:!1,index:0,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"button2",iconClass:"",labelMajor:"2",labelMinor:"ABC",pressed:!1,index:1,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"button3",iconClass:"",labelMajor:"3",labelMinor:"DEF",pressed:!1,index:2,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"button4",iconClass:"",labelMajor:"4",labelMinor:"GHI",pressed:!1,index:3,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"button5",iconClass:"",labelMajor:"5",labelMinor:"JKL",pressed:!1,index:4,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"button6",iconClass:"",labelMajor:"6",labelMinor:"MNO",pressed:!1,index:5,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"button7",iconClass:"",labelMajor:"7",labelMinor:"PQRS",pressed:!1,index:6,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"button8",iconClass:"",labelMajor:"8",labelMinor:"TUV",pressed:!1,index:7,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"button9",iconClass:"",labelMajor:"9",labelMinor:"WXYZ",pressed:!1,index:8,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"buttonstar",iconClass:"",labelMajor:"*",labelMinor:"",pressed:!1,index:9,defaultClasses:["misc-btn","misc-btn-one"],sendEventOnClick:""},{key:"button0",iconClass:"",labelMajor:"0",labelMinor:"+",pressed:!1,index:10,defaultClasses:["number-btn"],sendEventOnClick:""},{key:"buttonhash",iconClass:"",labelMajor:"#",labelMinor:"",pressed:!1,index:11,defaultClasses:["misc-btn","misc-btn-two"],sendEventOnClick:""},{key:"buttonextra",iconClass:"fas fa-phone",labelMajor:"",labelMinor:"",pressed:!1,index:12,defaultClasses:["extra-btn"],sendEventOnClick:""}]};import _23 from"lodash";var Ch5KeypadButton=class e extends Ch5Common{static ELEMENT_NAME="ch5-keypad-button";static COMPONENT_PROPERTIES=[{default:"",name:"key",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelMajor",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelMinor",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"sendEventOnClick",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"pressed",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];primaryCssClass="keypad-btn";pressedCssClassPostfix="-pressed";labelHasIconCssClass="has-icon";_ch5Properties;labelMajorCssClass="label-major";labelMinorCssClass="label-minor";_elButton={};_elMajorSpan={};_elMinorSpan={};_elIcon={};defaultValue=null;_pressable=null;_pressableIsPressedSubscription=null;static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(e.ELEMENT_NAME,e)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}set labelMajor(e){this._ch5Properties.set("labelMajor",e,()=>{""===this.labelMajor.trim()?this.setAttribute("labelMajor",this.getDefaultValue("labelMajor")):this.labelMajor=this._getTranslatedValue("labelMajor",e),this.handleIconLabelMajor()})}get labelMajor(){return this._ch5Properties.get("labelMajor")}set labelMinor(e){this._ch5Properties.set("labelMinor",e,()=>{""===this.labelMinor.trim()?this.setAttribute("labelMinor",this.getDefaultValue("labelMinor")):this.labelMinor=this._getTranslatedValue("labelMinor",e)}),this.handleLabelMinor()}get labelMinor(){return this._ch5Properties.get("labelMinor")}set iconClass(e){this._ch5Properties.set("iconClass",e,()=>{this.handleIconLabelMajor()})}get iconClass(){return this._ch5Properties.get("iconClass")}set sendEventOnClick(e){this._ch5Properties.set("sendEventOnClick",e)}get sendEventOnClick(){return this._ch5Properties.get("sendEventOnClick")}set key(e){this._ch5Properties.set("key",e)}get key(){return this._ch5Properties.get("key")}set pressed(e){this._ch5Properties.set("pressed",e,()=>{this.handlePressed()})}get pressed(){return this._ch5Properties.get("pressed")}constructor(t){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=["show","disabled","receivestateenable","receivestateshow","receivestateshowpulse","receivestatehidepulse","receivestatecustomclass","receivestatecustomstyle","sendeventonshow"],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this.defaultValue=t,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.logger.stop()}initAttributes(){this.logger.start("initAttributes",e.ELEMENT_NAME),super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty)if(this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}else{const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getDefaultValue(s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback() - start",e.ELEMENT_NAME),this.parentElement&&!1===this.parentElement.classList.contains("ch5-keypad")||(this._elButton.parentElement!==this&&(this.classList.add("keypad-btn"),this.appendChild(this._elButton)),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5KeypadChild),this.setAttribute("data-ch5-id",this.getCrId()),this.initPressable(this.primaryCssClass+this.pressedCssClassPostfix),this.initAttributes(),this.setDefaultClasses(),this.initCommonMutationObserver(this)),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback() - start",e.ELEMENT_NAME),null!==this._pressable&&(this._pressable.destroy(),this._pressable=null),null!==this._pressableIsPressedSubscription&&this._pressableIsPressedSubscription.unsubscribe(),this._pressableIsPressedSubscription=null,this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver(),this.logger.stop()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",e.ELEMENT_NAME),i!==s){this.logger.log('ch5-keypad attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elButton=document.createElement("button"),this._elMajorSpan=document.createElement("span"),this._elMinorSpan=document.createElement("span"),this._elIcon=document.createElement("span"),this._elMajorSpan.classList.add(this.labelMajorCssClass),this._elMinorSpan.classList.add(this.labelMinorCssClass),this._elButton.appendChild(this._elMajorSpan),this._elButton.appendChild(this._elMinorSpan),this.logger.stop()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}initPressable(e){var t;const i=null==(t=this.parentElement)?void 0:t.parentElement;i&&(this._pressable=new Ch5Pressable(this,{cssTargetElement:this.getTargetElementForCssClassesAndStyle(),cssPressedClass:e,enableSwipe:i.swipeGestureEnabled,touchMove:!0}),this._pressable&&(this._pressable.init(),this._subscribeToPressableIsPressed()))}updateSwipeGesture(){var e;const t=null==(e=this.parentElement)?void 0:e.parentElement;t&&(null===this._pressable||_23.isNil(this._pressable.options)||(this._pressable.options.enableSwipe=t.swipeGestureEnabled))}handleSendEventOnClick(){var e,t;this.sendEventOnClick&&(null==(e=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick))||e.publish(!0),null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick))||t.publish(!1))}_subscribeToPressableIsPressed(){null!==this._pressableIsPressedSubscription&&(this._pressableIsPressedSubscription.unsubscribe(),this._pressableIsPressedSubscription=null),null===this._pressableIsPressedSubscription&&null!==this._pressable&&(this._pressableIsPressedSubscription=this._pressable.observablePressed.subscribe(e=>{!1===e&&this.handleSendEventOnClick()}))}handleIconLabelMajor(){this.iconClass.trim()?(this._elIcon.setAttribute("class",""),this.iconClass.trim().split(" ").forEach(e=>this._elIcon.classList.add(e)),this._elMajorSpan.innerText="",this._elMajorSpan.appendChild(this._elIcon),this._elMajorSpan.classList.add(this.labelHasIconCssClass)):(this._elIcon.remove(),this._elMajorSpan.innerText=this.labelMajor,this._elMajorSpan.classList.remove(this.labelHasIconCssClass))}handleLabelMinor(){var e;const t=null==(e=this.parentElement)?void 0:e.parentElement;if(t&&!1===t.displayLabelMajorOnly&&(!this.labelMinor||""===this.labelMinor.trim())){""!==this.getDefaultValue("labelMinor")&&(this.labelMinor=" ")}this._elMinorSpan.innerHTML=this.labelMinor}handlePressed(){this._pressable&&this._pressable._pressed!==this.pressed&&this._pressable.setPressed(this.pressed)}getDefaultValue(e){if(this.defaultValue){const t=this.defaultValue;if(t.hasOwnProperty(e))return t[e]}const t=this.getAttribute("key")||"",i=CH5KeypadUtils.KEYPAD_BUTTON_KEY.findIndex(e=>e===t);if(-1===i)return"";const s=CH5KeypadUtils.KEYPAD_DEFAULT_VALUES[i];return s.hasOwnProperty(e)?s[e]:void 0}setDefaultClasses(){var e;const t=this.getAttribute("key")||"",i=CH5KeypadUtils.KEYPAD_BUTTON_KEY.findIndex(e=>e===t);if(-1===i)return;const s=CH5KeypadUtils.KEYPAD_DEFAULT_VALUES[i];s.hasOwnProperty("defaultClasses")&&s.defaultClasses.forEach(e=>this.classList.add(e));const n=null==(e=this.parentElement)?void 0:e.parentElement;n&&(n.hideAsteriskButton&&9===i&&this.classList.add("ch5-hide-vis"),n.hidePoundButton&&11===i&&this.classList.add("ch5-hide-vis"))}};Ch5KeypadButton.registerSignalAttributeTypes(),Ch5KeypadButton.registerCustomElement();var Ch5Keypad=class e extends Ch5Common{static ELEMENT_NAME="ch5-keypad";static TOTAL_KEYPAD_BUTTONS=13;static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateextrabuttonshow:{direction:"state",booleanJoin:1,contractName:!0},receivestatehideasteriskbutton:{direction:"state",booleanJoin:1,contractName:!0},receivestatehidepoundbutton:{direction:"state",booleanJoin:1,contractName:!0},sendeventonclickstart:{direction:"event",booleanJoin:1,contractName:!0}};static TYPES=["default","primary","info","text","danger","warning","success","secondary"];static SHAPES=["rounded-rectangle","square","circle"];static STRETCHES=["both","width","height"];static TEXT_ORIENTATIONS=["top","right","bottom","left"];static SIZES=["regular","x-small","small","large","x-large"];static COMPONENT_DATA={TYPE:{default:e.TYPES[0],values:e.TYPES,key:"type",attribute:"type",classListPrefix:"--type-"},STRETCH:{default:null,values:e.STRETCHES,key:"stretch",attribute:"stretch",classListPrefix:"--stretch-"},SHAPE:{default:e.SHAPES[0],values:e.SHAPES,key:"shape",attribute:"shape",classListPrefix:"--shape-"},TEXT_ORIENTATION:{default:e.TEXT_ORIENTATIONS[0],values:e.TEXT_ORIENTATIONS,key:"textOrientation",attribute:"textOrientation",classListPrefix:"--orientation-"},SIZE:{default:e.SIZES[0],values:e.SIZES,key:"size",attribute:"size",classListPrefix:"--size-"}};static COMPONENT_PROPERTIES=[{default:e.TYPES[0],enumeratedValues:e.TYPES,name:"type",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.TYPES[0],isObservableProperty:!0},{default:e.SHAPES[0],enumeratedValues:e.SHAPES,name:"shape",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SHAPES[0],isObservableProperty:!0},{default:e.SIZES[0],enumeratedValues:e.SIZES,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZES[0],isObservableProperty:!0},{default:null,enumeratedValues:e.STRETCHES,name:"stretch",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.STRETCHES[0],isObservableProperty:!0,isNullable:!0},{default:!1,name:"showExtraButton",nameForSignal:"receiveStateExtraButtonShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateExtraButtonShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.TEXT_ORIENTATIONS[0],enumeratedValues:e.TEXT_ORIENTATIONS,name:"textOrientation",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.TEXT_ORIENTATIONS[0],isObservableProperty:!0},{default:!1,name:"useContractForEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomStyle",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomClass",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForExtraButtonShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",name:"contractName",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnClickStart",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"hidePoundButton",nameForSignal:"receiveStateHidePoundButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"hideAsteriskButton",nameForSignal:"receiveStateHideAsteriskButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateHideAsteriskButton",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateHidePoundButton",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"useContractForHideAsteriskButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForHidePoundButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"displayLabelMajorOnly",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];primaryCssClass="ch5-keypad";displayLabelMajorOnlyCssClass="--display-label-major-only-";_ch5Properties;_elContainer={};keypadButtons=new Array(e.TOTAL_KEYPAD_BUTTONS).fill(null);signalNameOnContract={contractName:"",receiveStateEnable:"",receiveStateShow:"",receiveStateCustomClass:"",receiveStateCustomStyle:"",receiveStateExtraButtonShow:"",receiveStateHideAsteriskButton:"",receiveStateHidePoundButton:""};static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(e.ELEMENT_NAME,e)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}set contractName(e){this._ch5Properties.set("contractName",e,()=>{this.debounceContract()})}get contractName(){var e;return null==(e=this._ch5Properties.get("contractName"))?void 0:e.trim()}set type(e){this._ch5Properties.set("type",e,()=>{this.handleType()})}get type(){return this._ch5Properties.get("type")}set shape(e){this._ch5Properties.set("shape",e,()=>{this.handleShape()})}get shape(){return this._ch5Properties.get("shape")}set stretch(e){this._ch5Properties.set("stretch",e,()=>{this.handleStretch()})}get stretch(){return this._ch5Properties.get("stretch")}set size(e){this._ch5Properties.set("size",e,()=>{this.handleSize()})}get size(){return this._ch5Properties.get("size")}set textOrientation(e){this._ch5Properties.set("textOrientation",e,()=>{this.handleTextOrientation()})}get textOrientation(){return this._ch5Properties.get("textOrientation")}set showExtraButton(e){this._ch5Properties.set("showExtraButton",e,()=>{this.handleShowExtraButton()})}get showExtraButton(){return this._ch5Properties.get("showExtraButton")}set sendEventOnClickStart(e){this._ch5Properties.set("sendEventOnClickStart",e,()=>{this.handleSendEventOnClickStart()})}get sendEventOnClickStart(){return this._ch5Properties.get("sendEventOnClickStart")}set useContractForEnable(e){this._ch5Properties.set("useContractForEnable",e,()=>{this.debounceContract()})}get useContractForEnable(){return this._ch5Properties.get("useContractForEnable")}set useContractForShow(e){this._ch5Properties.set("useContractForShow",e,()=>{this.debounceContract()})}get useContractForShow(){return this._ch5Properties.get("useContractForShow")}set useContractForCustomStyle(e){this._ch5Properties.set("useContractForCustomStyle",e,()=>{this.debounceContract()})}get useContractForCustomStyle(){return this._ch5Properties.get("useContractForCustomStyle")}set useContractForCustomClass(e){this._ch5Properties.set("useContractForCustomClass",e,()=>{this.debounceContract()})}get useContractForCustomClass(){return this._ch5Properties.get("useContractForCustomClass")}set useContractForExtraButtonShow(e){this._ch5Properties.set("useContractForExtraButtonShow",e,()=>{this.debounceContract()})}get useContractForExtraButtonShow(){return this._ch5Properties.get("useContractForExtraButtonShow")}set receiveStateExtraButtonShow(e){this._ch5Properties.set("receiveStateExtraButtonShow",e,null,e=>{this._ch5Properties.setForSignalResponse("showExtraButton",e,()=>{this.handleShowExtraButton()})})}get receiveStateExtraButtonShow(){return this._ch5Properties.get("receiveStateExtraButtonShow")}set hidePoundButton(e){this._ch5Properties.set("hidePoundButton",e,()=>{this.handleHidePoundButton()})}get hidePoundButton(){return this._ch5Properties.get("hidePoundButton")}set hideAsteriskButton(e){this._ch5Properties.set("hideAsteriskButton",e,()=>{this.handleHideAsteriskButton()})}get hideAsteriskButton(){return this._ch5Properties.get("hideAsteriskButton")}set receiveStateHideAsteriskButton(e){this._ch5Properties.set("receiveStateHideAsteriskButton",e,null,e=>{this._ch5Properties.setForSignalResponse("hideAsteriskButton",e,()=>{this.handleHideAsteriskButton()})})}get receiveStateHideAsteriskButton(){return this._ch5Properties.get("receiveStateHideAsteriskButton")}set receiveStateHidePoundButton(e){this._ch5Properties.set("receiveStateHidePoundButton",e,null,e=>{this._ch5Properties.setForSignalResponse("hidePoundButton",e,()=>{this.handleHidePoundButton()})})}get receiveStateHidePoundButton(){return this._ch5Properties.get("receiveStateHidePoundButton")}set useContractForHidePoundButton(e){this._ch5Properties.set("useContractForHidePoundButton",e,()=>{this.debounceContract()})}get useContractForHidePoundButton(){return this._ch5Properties.get("useContractForHidePoundButton")}set useContractForHideAsteriskButton(e){this._ch5Properties.set("useContractForHideAsteriskButton",e,()=>{this.debounceContract()})}get useContractForHideAsteriskButton(){return this._ch5Properties.get("useContractForHideAsteriskButton")}set displayLabelMajorOnly(e){this._ch5Properties.set("displayLabelMajorOnly",e,()=>{this.handleDisplayLabelMajorOnly()})}get displayLabelMajorOnly(){return this._ch5Properties.get("displayLabelMajorOnly")}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=[],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),resizeObserver(this._elContainer,this.resizeHandler),this.updateCssClass()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}initAttributes(){this.logger.start("initAttributes",e.ELEMENT_NAME),super.initAttributes(),this.setAttribute("data-ch5-id",this.getCrId());const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Keypad),this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-keypad"),this.appendChild(this._elContainer)),this.buildRuntimeChildButtonList(),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.createKeyPadButtons(),customElements.whenDefined("ch5-keypad").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this.logger.stop()}handleDisplayLabelMajorOnly(){[!0,!1].forEach(e=>{this._elContainer.classList.remove(this.primaryCssClass+this.displayLabelMajorOnlyCssClass+e.toString())}),this._elContainer.classList.add(this.primaryCssClass+this.displayLabelMajorOnlyCssClass+this.displayLabelMajorOnly)}createKeyPadButtons(){this._elContainer.innerHTML="";for(let t=0;t<e.TOTAL_KEYPAD_BUTTONS;t++){const e=CH5KeypadUtils.KEYPAD_DEFAULT_VALUES[t],i=this.keypadButtons[t];if(null===i){const t=new Ch5KeypadButton(e);this._elContainer.appendChild(t)}else this._elContainer.appendChild(i)}this.handleSendEventOnClickStart()}disconnectedCallback(){this.logger.log("disconnectedCallback"),this.removeEvents(),this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver()}removeEvents(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-keypad attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}attachEventListeners(){super.attachEventListeners()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this.logger.stop()}buildRuntimeChildButtonList(){var e;const t=Array.from(this.children);if(t.length>0){const i=CH5KeypadUtils.KEYPAD_BUTTON_KEY;for(const s of t)if("ch5-keypad-button"===s.tagName.toLowerCase()){const t=(null==(e=s.getAttribute("key"))?void 0:e.trim().toLowerCase())||"",n=i.findIndex(e=>e===t);-1!==n&&null===this.keypadButtons[n]?this.keypadButtons[n]=s:s.remove()}}}handleType(){Array.from(e.COMPONENT_DATA.TYPE.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.TYPE.classListPrefix+t)}),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.TYPE.classListPrefix+this.type)}handleShape(){Array.from(e.COMPONENT_DATA.SHAPE.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.SHAPE.classListPrefix+t)}),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SHAPE.classListPrefix+this.shape)}handleStretch(){Array.from(e.COMPONENT_DATA.STRETCH.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.STRETCH.classListPrefix+t)}),"both"!==this.stretch&&"height"!==this.stretch&&"width"!==this.stretch||this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.STRETCH.classListPrefix+this.stretch),this.handleStretchResize()}handleTextOrientation(){Array.from(e.COMPONENT_DATA.TEXT_ORIENTATION.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.TEXT_ORIENTATION.classListPrefix+t)}),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.TEXT_ORIENTATION.classListPrefix+this.textOrientation)}handleSize(){Array.from(e.COMPONENT_DATA.SIZE.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+t)}),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+this.size)}handleShowExtraButton(){!0===this.showExtraButton?this._elContainer.classList.add(this.primaryCssClass+"--show-extra-button"):this._elContainer.classList.remove(this.primaryCssClass+"--show-extra-button")}handleContract(){0===this.contractName.length?(this.signalNameOnContract.contractName="",this.receiveStateShow=this.signalNameOnContract.receiveStateShow||this.receiveStateShow,this.receiveStateEnable=this.signalNameOnContract.receiveStateEnable||this.receiveStateEnable,this.receiveStateCustomStyle=this.signalNameOnContract.receiveStateCustomStyle||this.receiveStateCustomStyle,this.receiveStateCustomClass=this.signalNameOnContract.receiveStateCustomClass||this.receiveStateCustomClass,this.receiveStateExtraButtonShow=this.signalNameOnContract.receiveStateExtraButtonShow||this.receiveStateExtraButtonShow,this.receiveStateHideAsteriskButton=this.signalNameOnContract.receiveStateHideAsteriskButton||this.receiveStateHideAsteriskButton,this.receiveStateHidePoundButton=this.signalNameOnContract.receiveStateHidePoundButton||this.receiveStateHidePoundButton):""===this.signalNameOnContract.contractName&&(this.signalNameOnContract.contractName=this.contractName,this.signalNameOnContract.receiveStateShow=this.receiveStateShow,this.signalNameOnContract.receiveStateEnable=this.receiveStateEnable,this.signalNameOnContract.receiveStateCustomStyle=this.receiveStateCustomStyle,this.signalNameOnContract.receiveStateCustomClass=this.receiveStateCustomClass,this.signalNameOnContract.receiveStateExtraButtonShow=this.receiveStateExtraButtonShow,this.signalNameOnContract.receiveStateHideAsteriskButton=this.receiveStateHideAsteriskButton,this.signalNameOnContract.receiveStateHidePoundButton=this.receiveStateHidePoundButton),this.contractDefaultHelper(),this.handleSendEventOnClickStart()}contractDefaultHelper(){""!==this.contractName&&(!0===this.useContractForCustomStyle&&(this.receiveStateCustomStyle=this.contractName+".CustomStyle"),!0===this.useContractForCustomClass&&(this.receiveStateCustomClass=this.contractName+".CustomClass"),!0===this.useContractForEnable&&(this.receiveStateEnable=this.contractName+".Enable"),!0===this.useContractForShow&&(this.receiveStateShow=this.contractName+".Show"),!0===this.useContractForHideAsteriskButton&&(this.receiveStateHideAsteriskButton=this.contractName+".HideAsteriskButton"),!0===this.useContractForHidePoundButton&&(this.receiveStateHidePoundButton=this.contractName+".HidePoundButton"),!0===this.useContractForExtraButtonShow&&(this.receiveStateExtraButtonShow=this.contractName+".ExtraButtonShow"))}handleSendEventOnClickStart(){const e=Array.from(this._elContainer.children);if(""!==this.contractName)return void e.forEach((e,t)=>{const i=this.contractName+"."+CH5KeypadUtils.CONTRACT_SEND_EVENT_ON_CLICK[t];e.setAttribute("sendEventOnClick",i)});const t=parseInt(this.sendEventOnClickStart,10);isNaN(t)?e.forEach(e=>e.removeAttribute("sendEventOnClick")):e.forEach((e,i)=>{10===i?e.setAttribute("sendEventOnClick",t+""):11===i||12===i?e.setAttribute("sendEventOnClick",t+i+""):e.setAttribute("sendEventOnClick",t+i+1+"")})}handleStretchResize(){if(null===this.stretch||"both"!==this.stretch&&"height"!==this.stretch&&"width"!==this.stretch)return this._elContainer.style.removeProperty("width"),this._elContainer.style.removeProperty("height"),void this.style.removeProperty("display");if(!this.parentElement)return;const{offsetHeight:e,offsetWidth:t}=this.parentElement;(this.showExtraButton?e/5:e/4)/(t/3)<1?(this._elContainer.style.width="unset",this._elContainer.style.height=e+"px"):this._elContainer.style.width=t+"px",this.style.display="block"}handleHidePoundButton(){const e=this.querySelector(".keypad-btn.misc-btn-two");null==e||e.classList.remove("ch5-hide-vis"),this.hidePoundButton&&(null==e||e.classList.add("ch5-hide-vis"))}handleHideAsteriskButton(){const e=this.querySelector(".keypad-btn.misc-btn-one");null==e||e.classList.remove("ch5-hide-vis"),this.hideAsteriskButton&&(null==e||e.classList.add("ch5-hide-vis"))}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.TYPE.classListPrefix+this.type),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SHAPE.classListPrefix+this.shape),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.TEXT_ORIENTATION.classListPrefix+this.textOrientation),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this._elContainer.classList.add(this.primaryCssClass+this.displayLabelMajorOnlyCssClass+this.displayLabelMajorOnly),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}resizeHandler=()=>{this.handleStretchResize()};debounceContract=this.debounce(()=>{this.handleContract()},10)};Ch5Keypad.registerSignalAttributeTypes(),Ch5Keypad.registerCustomElement();var Ch5Label=class e extends Ch5Common{constructor(t){super(),this._parent=t,this.logger.start("constructor()",e.ELEMENT_NAME),this._wasInstatiated||this.createInternalHtml(),t&&(this.parentElem=t),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass()}_parent;static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatelabel:{direction:"state",stringJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static COMPONENT_PROPERTIES=[{default:"",name:"label",nameForSignal:"receiveStateLabel",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateLabel",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelInnerHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-label";primaryCssClass="ch5-label";_ch5Properties;_elContainer={};templateElement={};parentElem="";labelRec="";set label(e){this._ch5Properties.set("label",e,()=>{this.label=this._getTranslatedValue("label",this.label),this.handleLabel()})}get label(){return this._ch5Properties.get("label")}set labelInnerHTML(e){this._ch5Properties.set("labelInnerHTML",e,()=>{this.handleLabel()})}get labelInnerHTML(){return this._ch5Properties.get("labelInnerHTML")}set receiveStateLabel(e){this._ch5Properties.set("receiveStateLabel",e,null,e=>{this._ch5Properties.setForSignalResponse("label",e,()=>{this.labelRec=e,this.handleLabel()})})}get receiveStateLabel(){return this._ch5Properties.get("receiveStateLabel")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-label attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role"),this._elContainer.parentElement!==this&&""===this.parentElem&&(this._elContainer.classList.add("ch5-label"),this.appendChild(this._elContainer)),this.attachEventListeners(),this.initAttributes(),this.updateCssClass(),this.initCommonMutationObserver(this),this.handleLabel(),customElements.whenDefined("ch5-label").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners()}removeEventListeners(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleLabel(){if(this.templateElement instanceof HTMLTemplateElement||(this.templateElement=this.getElementsByTagName("template")[0]),Array.from(this._elContainer.children).forEach(e=>e.remove()),this._elContainer.innerText="",null!==this.receiveStateLabel&&""!==this.receiveStateLabel.trim())this._elContainer.innerText=this.label;else if(Ch5Common.isNotNil(this.labelInnerHTML))this._elContainer.innerHTML=this.decodeInnerHTMLForAttribute(this.labelInnerHTML);else if(this.templateElement instanceof HTMLTemplateElement){const e=document.createElement("template");e.innerHTML=this.templateElement.innerHTML,this._elContainer.appendChild(e.content)}else this._elContainer.innerText=this.label}decodeInnerHTMLForAttribute(e){return e.replace("&","&").replace("<","<").replace(">",">").replace(""",'/"').replace("'","/'")}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this._elContainer.classList.add("ch5-label"),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};Ch5Label.registerCustomElement(),Ch5Label.registerSignalAttributeTypes();import isNil15 from"lodash/isNil";function clamp(e,t=e,i=e){let s=e;if(t>i)throw new RangeError(`'min' ${t} should be lower than 'max' ${i}`);return e<t&&(s=t),e>i&&(s=i),s}function intSetter(e,t,i){e.setAttribute(t,i.toString())}function intGetter(e,t,i=0){const s=e.getAttribute(t);return null===s?i:parseInt(s,10)}function normalizeEvent(e){if("touchstart"===e.type||"touchmove"===e.type||"touchend"===e.type){const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY,id:t.identifier,event:e,targetElement:t.target}}return{x:e.clientX,y:e.clientY,id:null,event:e,targetElement:e.target}}function getCSSCustomProperty(e,t){const i=getComputedStyle(e);return String(i.getPropertyValue(t)).trim()}import isNil11 from"lodash/isNil";var Ch5ListAbstractHelper=class{_list={};_templateHelper={};_eventManager={};_animationHelper={};constructor(e){this._list=e}addTemplateHelper(e){this._templateHelper=e}addAnimationHelper(e){this._animationHelper=e}addEventManager(e){this._eventManager=e}},Ch5ListSizeResolver=class{elements=[];viewPortSize=0;fullListSize=0;hiddenListSize=0;orientation="horizontal";constructor(e,t){this.elements=Array.from(e),this.orientation=t,this.init()}getItemsPerPage(){let e=0,t=Array.from(this.elements).reduce((t,i)=>e<=this.viewPortSize?(e+=this.getElementSize(i),++t):t,0);return t-=1,t}getTotalSize(){return Array.from(this.elements).reduce((e,t)=>e+this.getElementSize(t),0)}getOverflowSize(){return this.getTotalSize()-this.viewPortSize}getFullSize(){return this.viewPortSize+this.getOverflowSize()}updateViewport(e){const t=e.getBoundingClientRect();"horizontal"===this.orientation?this.viewPortSize=t.width:this.viewPortSize=t.height,this.fullListSize=this.getFullSize(),this.hiddenListSize=this.getOverflowSize()}init(){this.fullListSize=this.getFullSize(),this.hiddenListSize=this.getOverflowSize()}getElementSize(e){return"horizontal"===this.orientation?e.offsetWidth:e.offsetHeight}},Ch5ListTemplate=class extends Ch5ListAbstractHelper{scrollbarSize=0;cachedListFullSize;endless=!1;_tmplString="";_scrollbarElement={};_lastScrollbarPosition=0;resizeDebouncer={};initializationTask;resetListLayoutTask;set scrollbarElement(e){void 0===e&&null===e||(this._scrollbarElement=e)}get scrollbarElement(){return this._scrollbarElement}checkForTemplate(){let e;e=this._list.templateElement instanceof HTMLTemplateElement?this._list.templateElement:this._list.templateElement=this._list.getElementsByTagName("template")[0];let t="";return e&&e.innerHTML&&e.innerHTML.length>0?(this._list.info("ch5-list-template - tpEL.innerHtml ",e.innerHTML),t=e.innerHTML):e&&e.firstElementChild&&e.firstElementChild.outerHTML&&e.firstElementChild.outerHTML.length>0&&(this._list.info("ch5-list-template - tplEl.firstElementChild.outerHTML ",e.firstElementChild.outerHTML),t=e.firstElementChild.outerHTML),this._tmplString=t,t}updateTemplateString(e){this._tmplString=e}processTemplate(e,t,i){this._list.info("ch5-list-template - processTemplate");const s=document.createElement("div");s.id=`${e}_${t}`,s.classList.add(Ch5List.ITEMCLASS);const n=document.createElement("template");n.innerHTML=this._tmplString,null!==this._list.indexId&&(Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(n,t,this._list.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(n,t,this._list.indexId));const r=null==n?void 0:n.content;if(this.setCustomAttributesInChildComponents(r),s.appendChild(r),Ch5AugmentVarSignalsNames.differentiateTmplElemsAttrs(s,this._list.getAttribute("contractname")||"",parseInt(this._list.getAttribute("booleanjoinoffset")||"0",10)||0,parseInt(this._list.getAttribute("numericJoinOffset")||"0",10)||0,parseInt(this._list.getAttribute("stringJoinOffset")||"0",10)||0),null!==i&&""!==i){const e=JSON.parse(i);s.innerHTML=this.processTemplateForVars(s.innerHTML,e[t])}return this._list.isDebug()&&this._list.info(`after update ${s.innerHTML}`),s}setCustomAttributesInChildComponents(e){const t=[],i=e.querySelectorAll("*");for(const e of i){e.tagName.startsWith("CH5-")&&(e.setAttribute("swipeGestureEnabled","true"),t.push(e))}return t}listItemCSS(){this._list.info("ch5-list-template - listItemCSS, process list item CSS");return{display:this._list.orientation===Ch5List.ORIENTATION[0]?"":"inline-block",width:null==this._list.itemWidth?"":this._list.itemWidth,height:null==this._list.itemHeight?"":this._list.itemHeight}}attachCSS(){this._list.info("ch5-list-template - attachCSS");const e=this._list.getElementsByTagName("style"),t=0===e.length?document.createElement("style"):e[0];0===e.length&&this._list.appendChild(t),t.innerHTML=this.prepareStyleSheet().toString()}updateListMainElStyle(){this._list.info("ch5-list-template - updateListMainElStyle");let e="";this._list.minWidth&&(e+=`min-width: ${this._list.minWidth};`),this._list.maxWidth&&(e+=`max-width: ${this._list.maxWidth};`),this._list.minHeight&&(e+=`min-height: ${this._list.minHeight};`),this._list.maxHeight&&(e+=`max-height: ${this._list.maxHeight};`),e&&(this._list.style.cssText+=e)}resizeList(e,t,i=!1){this._list.info("ch5-list-template - resizeList()"),this._list.animationHelper.minOffsetTranslate=0,this._list.isHorizontal&&!isNaN(this._list.currentXPosition)&&this._list.getItemSize()>0?(this._list.currentXPosition=this.computeItemLocation(this._list.currentXPosition),this.setWrapperTranslateX(this._list.currentXPosition),this.updateScrollBarPosition(this._list.currentXPosition)):!this._list.isHorizontal&&!isNaN(this._list.currentYPosition)&&this._list.getItemSize()>0&&(this._list.currentYPosition=this.computeItemLocation(this._list.currentYPosition),this.setWrapperTranslateY(this._list.currentYPosition),this.updateScrollBarPosition(this._list.currentYPosition));const s=this._list.getCrId(),n=this._list.orientation===Ch5List.ORIENTATION[0]?"ch5-list-vertical-scrollbar":"ch5-list-horizontal-scrollbar",r=this._list.orientation===Ch5List.ORIENTATION[0]?"ch5-list-vertical":"ch5-list-horizontal",a=!0===this._list.scrollbar?n:"";if(e.id=s,e.className=`${a} ${r}`,isNil11(e.parentElement)&&this._list.appendChild(e),0===this._list.size)return;if(this.attachCSS(),this.updateListMainElStyle(),this.checkAndSetSizes(),i)this._list.items=this._list.items.map(e=>(e.element.style.transform="",{...e,translateX:0,translateY:0}));else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(this.processTemplate(s,0,t));const i=this._list.getFirstRenderVisibleItemsNr(!0);this._list._appendPosition=i;const n=document.createDocumentFragment();for(let e=1;e<i;e++)n.appendChild(this.processTemplate(s,e,t));e.appendChild(n),this._list._bufferedItems.bufferActive=this._list._canUseBufferAmount(i),this._list._bufferedItems.bufferActive&&(this._list._bufferedItems.bufferForwardStartIndex=i,null!==this._list.size&&(this._list._bufferedItems.bufferBackwardsStartIndex=Number(this._list.size))),this._list.bufferdItemsHelper.bufferItems()}if(this._list.onResizeList(),!1!==this._list.scrollbar){const e=this._list.isHorizontal?this._list.currentXPosition:this._list.currentYPosition-this.scrollbarSize;this.updateScrollBarPosition(e)}this._list.previousSize=this._list.size;const l=this._list.items.map(e=>e.element);this._list.sizeResolver=new Ch5ListSizeResolver(l,this._list.orientation),clearTimeout(this.initializationTask),this.initializationTask=window.setTimeout(()=>{this._list.sizeResolver.updateViewport(this._list),this.customScrollbar(e);const{fullListSize:t,viewPortSize:i}=this._list.sizeResolver;this._list.animationHelper.maxOffsetTranslate=void 0,this._list.endless})}resetListLayout(){clearTimeout(this.resetListLayoutTask),this.resetListLayoutTask=window.setTimeout(()=>{if(!(this._list.sizeResolver instanceof Ch5ListSizeResolver))return void clearTimeout(this.resetListLayoutTask);this.checkAndSetSizes(),this._list.sizeResolver.updateViewport(this._list),this.resetItemsTransform(),this._list.items.sort((e,t)=>e.layoutIndex-t.layoutIndex),this._list.endless&&this._list.animationHelper.stop(),this._list.animationHelper.minOffsetTranslate=0,this._list.animationHelper.maxOffsetTranslate=-this._list.sizeResolver.hiddenListSize,this._list.isHorizontal?this._list.currentXPosition=this._list.currentXPosition%this._list.sizeResolver.fullListSize:this._list.currentYPosition=this._list.currentYPosition%this._list.sizeResolver.fullListSize,this.isPositionExceedingMaximumBoundary()&&(this._list.isHorizontal?this._list.currentXPosition=this._list.animationHelper.maxOffsetTranslate:this._list.currentYPosition=this._list.animationHelper.maxOffsetTranslate),this._list.sizeResolver.viewPortSize>0&&this._list.templateHelper.customScrollbar(this._list.divList);const e=this._list.isHorizontal?this._list.currentXPosition:this._list.currentYPosition;this._list.templateHelper.updateScrollBarPosition(e),this._list.animationHelper.updateDragPosition(e);const{fullListSize:t,viewPortSize:i}=this._list.sizeResolver;t>0&&i>0&&t<=i&&this.resetItemsTransform();const s=!isNil11(this._list.bufferAmount);if(t<=i)return this._list.setCurrentPosition(0),this._list.templateHelper.setWrapperTranslateX(0),void this._list.templateHelper.setWrapperTranslateY(0);if(!this._list.endless&&(this._list.animationHelper.maxOffsetTranslate=this._list.animationHelper.adjustMaxOffset(s),this._list.animationHelper.maxOffsetTranslate)){let e=this._list.isHorizontal?this._list.currentXPosition:this._list.currentYPosition;e<this._list.animationHelper.maxOffsetTranslate&&(e=this._list.animationHelper.maxOffsetTranslate,this._list.animationHelper.updateDragPosition(e))}})}triggerResizeDueWidthAndHeightUpdates(){debounce(this.resizeDebouncer,()=>{this.updateListMainElStyle(),this.checkAndSetSizes(),this.customScrollbar(this._list.divList)})}removeScrollbar(){null!==this._scrollbarElement&&this._scrollbarElement instanceof HTMLElement&&(null!==this._scrollbarElement.parentElement&&this._scrollbarElement.parentElement.remove(),this._scrollbarElement.remove(),this._scrollbarElement=null)}customScrollbar(e){if(this.createScrollbar(),this._list.scrollbar&&null!==this._list.size&&void 0!==e&&void 0!==e.children&&this._scrollbarElement&&void 0!==this._scrollbarElement.parentElement){const e=this._list.getLayoutInfo(),t=e.fullListSize,i=this._scrollbarElement.parentElement,s=new Event("scroll"),n=this._scrollbarElement,r=e.viewPortSize;if(null!==i&&e.fullListSize<=e.viewPortSize)return i.remove(),void(this._scrollbarElement=null);const a=Math.ceil(r/t*100);void 0!==n&&(i.addEventListener("scroll",()=>{void 0!==n.style&&i&&(i.style.display=100===a?"none":"block",this._list.isHorizontal?n.style.width=a+"%":n.style.height=a+"%")}),this.scrollbarSize=a/100*r,window.addEventListener("resize",i.dispatchEvent.bind(i,s)),i.dispatchEvent(s))}else this.removeScrollbar()}updateScrollBarPosition(e,t){if(null!==this._list.size){const i=this._list.getLayoutInfo(),s=i.viewPortSize,n=i.fullListSize;let r=i.viewPortSize;this._list.endless&&(r-=this.scrollbarSize);const a=s;let l=this.getRelativeScrollbarPosition(e,n,r),o=-l;if(l<0&&Math.abs(l)>a&&(l=o=0),this.scrollbarElement instanceof HTMLElement)if(void 0===t)this._list.isHorizontal?(this._list.direction===Ch5Common.DIRECTION[1]&&(this.scrollbarElement.style.transform=`translate3d(${-o}px, 0, 0)`),this.scrollbarElement.style.transform=`translate3d(${o}px, 0, 0)`):this.scrollbarElement.style.transform=`translate3d(0, ${o}px, 0)`;else{const e=this._list.isHorizontal?Ch5List.ORIENTATION[1]:Ch5List.ORIENTATION[0];t(this.scrollbarElement,o,e,-this._lastScrollbarPosition)}this._lastScrollbarPosition=l}}setWrapperTranslateX(e,t){isNil11(this._list)||(void 0===t?(this._list.divList.style.transform=`translate3d(${e}px, 0, 0)`,this._list.wrapperTranslateX=e):(t(this._list.divList,e,Ch5List.ORIENTATION[1],this._list.wrapperTranslateX),this._list.wrapperTranslateX=e))}setWrapperTranslateY(e,t){isNil11(this._list)||(void 0===t?(this._list.wrapperTranslateY=e,this._list.divList.style.transform=`translate3d(0, ${e}px, 0)`):(t(this._list.divList,e,Ch5List.ORIENTATION[0],this._list.wrapperTranslateY),this._list.wrapperTranslateY=e))}setItemTranslateX(e,t){isNil11(t)||(t.translateX=e,t.element.style.transform=`translateX(${t.translateX}px)`)}setItemTranslateY(e,t){isNil11(t)||(t.translateY=e,t.element.style.transform=`translateY(${t.translateY}px)`)}computePage(e,t,i){const s=this._list.getItemSize()*this._list.getVisibleItemsPerPage();let n=0,r=this._list.currentPage;return Math.abs(e)<=0||(isNil11(t)||isNil11(i)||(n=Math.abs(t)-Math.abs(i)),e<0?!isNil11(t)&&!isNil11(i)&&n<0?this._list.currentPage=r=Math.floor(e/s):this._list.currentPage=r=Math.ceil(e/s):!isNil11(t)&&!isNil11(i)&&n<0?this._list.currentPage=r=Math.ceil(e/s):this._list.currentPage=r=Math.floor(e/s)),r}checkAndSetSizes(){if(this._list.divList.childElementCount>0){const e=this._list.divList.getBoundingClientRect(),t=this._list.divList.children[0];this._list.divListWidth=e.width,this._list.divListHeight=e.height,this.updateViewportSize(),"vertical"===this._list.orientation&&(this._list.style.width="100%"),setTimeout(()=>{this._list.itemOffsetHeight=t.offsetHeight,this._list.itemOffsetWidth=t.offsetWidth,this._list.divListWidth=e.width,this._list.divListHeight=e.height,this._list.sizeResolver.fullListSize>this._list.sizeResolver.viewPortSize&&(this._list.style.width="100%"),this.updateViewportSize()}),t instanceof HTMLElement&&(this._list.itemOffsetHeight=t.offsetHeight,this._list.itemOffsetWidth=t.offsetWidth),this._list.storedOffsetWidth=this._list.offsetWidth,this._list.storedOffsetHeight=this._list.offsetHeight}}updateViewportSize(e=0){if(!e){const t=this._list.getBoundingClientRect();e=this._list.isHorizontal?t.width:t.height}this._list.isHorizontal?this._list.viewportClientWidth=e:this._list.viewportClientHeight=e}resolveEndlessViewportSize(){if(!this.endless)return;const e=this._list.sizeResolver.getItemsPerPage(),t=this._list.size;Math.floor(e)===t?this._list.endless=!1:this._list.endless=!0}resetItemsTransform(){this._list.items=this._list.items.map(e=>(e.element.style.transform="translate3d(0,0,0)",{...e,translateX:0,translateY:0}))}isPositionExceedingMaximumBoundary(){if(!this._list.animationHelper)return!1;const{maxOffsetTranslate:e}=this._list.animationHelper,{currentYPosition:t,currentXPosition:i,isHorizontal:s}=this._list;if(!e)return!1;if(this._list&&this._list.isLtr()){if(s&&i<e||!s&&t<e)return!0}else if(s&&i>e||!s&&t>e)return!0;return!1}getRelativeScrollbarPosition(e,t,i){let s=e/t*100%100,n=1;(this._list.isVertical||this._list.direction===Ch5Common.DIRECTION[0])&&e>0&&(s=100-s,n=-1),this._list.isHorizontal&&this._list.direction===Ch5Common.DIRECTION[1]&&e<0&&(s=100+s);return Math.round(s/100*i)*n}computeItemLocation(e){const t=this._list.isHorizontal?this._list.currentXPosition:this._list.currentYPosition,i=this._list.previousSize*this._list.getItemSize();let s=t%i;return e>0&&(s=i-t),s=s<=0?s:-s,s}processTemplateForVars(e,t){for(const i in t){const s=`{{${i}}}`,n=t[i];e=this.textReplace(e,s,n,!0)}return e}textReplace(e,t,i,s){let n="";return null!=e&&(n=!0===s?e.replace(new RegExp(t,"g"),i):e.replace(new RegExp(t),i)),n}createScrollbar(){if(!this._list.scrollbar)return;this._scrollbarElement instanceof HTMLElement&&this.removeScrollbar();const e=document.createElement("div"),t=this._list.isHorizontal?this._list.currentXPosition:this._list.currentYPosition;this._scrollbarElement=document.createElement("div"),this._scrollbarElement.classList.add("scrollbar"),e.classList.add("scrollbar-container"),e.appendChild(this._scrollbarElement),this._list.appendChild(e),this.updateScrollBarPosition(t)}prepareStyleSheet(){const e={[`#${this._list.getCrId()}`]:{"white-space":this._list.orientation===Ch5List.ORIENTATION[0]?"none":"nowrap","will-change":"transform",transition:"height .3s ease-out"},[`#${this._list.getCrId()} .${Ch5List.ITEMCLASS}`]:{...this.listItemCSS()}};return{toString:()=>{let t="";for(const i in e)if(e.hasOwnProperty(i)){t+=` ${i}{`;for(const s in e[i])if(e[i].hasOwnProperty(s)){let n=e[i][s];isNil11(n)||""===n||(n=n.trim(),t+=`${s}: ${n};`)}t+="}"}return t}}}initListMaxWidthAndHeight(){this._list.maxWidth||(this._list.maxWidth="100%"),this._list.maxHeight||(this._list.maxHeight="100%")}},passiveEvtSupport;import isNil12 from"lodash/isNil";function _passiveEvtListenersSupported(){if(void 0===passiveEvtSupport){passiveEvtSupport=!1;try{Object.defineProperty({},"passive",{get:()=>{passiveEvtSupport=!0}})}catch(e){console.log(e)}}return passiveEvtSupport}function getEvtListenerOptions(e){return!!_passiveEvtListenersSupported()&&{passive:e}}function isCrestronDevice(){return window.navigator.userAgent.toLowerCase().includes("crestron")}var Ch5ListEventManager=class extends Ch5ListAbstractHelper{_dragAllowanceAngle=45;_currentDragAngle=0;_listHasMoved=!1;_hammer=null;_updateManager=0;constructor(e){super(e),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerEnd=this.onPointerEnd.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.onPointerCancel=this.onPointerCancel.bind(this),this.onOrientationChange=this.onOrientationChange.bind(this)}removeEvents(e){this._list.info("ch5-list-event-manager - removeEvents"),null!==this._hammer&&(this._hammer.destroy(),this._hammer=null),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("touchcancel",this.onPointerCancel),window.removeEventListener("orientationchange",this.onOrientationChange),e.removeEventListener("touchstart",this.onPointerDown),e.removeEventListener("mousedown",this.onPointerDown),e.removeEventListener("touchmove",this.onPointerMove),e.removeEventListener("mousemove",this.onPointerMove),e.removeEventListener("touchend",this.onPointerEnd),e.removeEventListener("mouseup",this.onPointerEnd)}initializeEvents(e){this._list.info("ch5-list-event-manager - initializeEvents"),window.addEventListener("resize",this.onWindowResize),window.addEventListener("orientationchange",this.onOrientationChange),isCrestronDevice()||this.initializeMouseEvents(e),this.initializeTouchEvents(e),window.addEventListener("touchmove",()=>{})}initializeTouchEvents(e){this._list.info("ch5-list-event-manager - initializeTouchEvents"),window.addEventListener("touchcancel",this.onPointerCancel),e.addEventListener("touchstart",this.onPointerDown,{passive:!0}),e.addEventListener("touchmove",this.onPointerMove,{passive:!0}),e.addEventListener("touchend",this.onPointerEnd,!0)}initializeMouseEvents(e){this._list.info("initializeMouseEvents"),e.addEventListener("mousedown",this.onPointerDown),e.addEventListener("mousemove",this.onPointerMove,getEvtListenerOptions(!1)),e.addEventListener("mouseup",this.onPointerEnd,!0)}checkTouchSupport(){return"ontouchstart"in window&&"ontouchmove"in window&&"ontouchend"in window&&"ontouchcancel"in window||navigator.maxTouchPoints>0}onWindowResize(){this._list.templateHelper.resetListLayout()}onPointerDown(e){this._list.info(`ch5-list-event-manager - onPointerDown: ${e}`);const t=normalizeEvent(e);if(this._list.decelerating&&t.event.stopPropagation(),this._list.endless&&!this._animationHelper.maxOffsetTranslate||!this._list.endless){this._list.sizeResolver.updateViewport(this._list);const e=!isNil12(this._list.bufferAmount)&&this._list.bufferAmount>0,t=this._animationHelper.adjustMaxOffset(e);this._animationHelper.maxOffsetTranslate=t}const i=this._list.getBoundingClientRect(),s=this._list.items[0].element.getBoundingClientRect();let n=i.width,r=s.width*this._list.size;this._templateHelper.resolveEndlessViewportSize(),this._list.isHorizontal||(n=i.height,r=s.height*this._list.size),r>n&&(this._list.decelerating=!1,this._list.isPointerActive=!0,this._list.pointerId=t.id,this._list.pointerFirstX=this._list.pointerLastX=this._list.pointerCurrentX=t.x,this._list.pointerFirstY=this._list.pointerLastY=this._list.pointerCurrentY=t.y,this._list.lastDraggedLayoutIndex=this._list.items[this._list.selected].layoutIndex,this._list.pointerStartTime=this._list.pointerEndTime=Date.now(),this._list.stepOnX=this._list.currentXPosition,this._list.stepOnY=this._list.currentYPosition,this._list.trackingPointsX=[],this._list.trackingPointsY=[],this._addTrackingPoint(this._list.pointerLastX,0),this._addTrackingPoint(this._list.pointerLastY,1),this._list.animationHelper.stop(),window.addEventListener("touchcancel",this.onPointerEnd))}onPointerMove(e){const t=normalizeEvent(e),i=Math.abs(this._list.pointerFirstX-t.x),s=Math.abs(this._list.pointerFirstY-t.y);let n=Math.atan2(i,s)*(180/Math.PI);if(this._list.isHorizontal&&(n=Math.atan2(s,i)*(180/Math.PI)),this._currentDragAngle=n,this._currentDragAngle>=0&&this._currentDragAngle<=this._dragAllowanceAngle&&this._list.isPointerActive){this._list.info(`ch5-list-event-manager - onPointerMove: ${e}`),this._list.pointerCurrentX=t.x,this._list.pointerCurrentY=t.y,this._listHasMoved=!0;const i=this._list.currentXPosition+this._list.pointerCurrentX-this._list.pointerFirstX,s=this._list.currentYPosition+this._list.pointerCurrentY-this._list.pointerFirstY,n=this._list.isHorizontal?i:s,r=this._list.isHorizontal?this._list.stepOnX:this._list.stepOnY;Math.abs(r-n)>1&&(this._list.animationHelper.direction=this._list.animationHelper.resolveDirection(n,r)),clearTimeout(this._updateManager),this._updateManager=window.setTimeout(()=>{this._list.stepOnX=i,this._list.stepOnY=s,this._list.pointerStartTime=Date.now()},50);let a=i;this._list.isHorizontal||(a=s),this._templateHelper.computePage(Math.abs(a)),this._addTrackingPoint(this._list.pointerLastX,0),this._addTrackingPoint(this._list.pointerLastY,1),null!==this._animationHelper&&this._animationHelper.updateDragPosition(a)}else this._list.isPointerActive=!1}onPointerEnd(e){this._list.info(`ch5-list-event-manager - onPointerEnd: ${e}`),this._list.pointerEndTime=Date.now(),this._listHasMoved&&(this._list.currentXPosition+=this._list.pointerCurrentX-this._list.pointerFirstX,this._list.currentYPosition+=this._list.pointerCurrentY-this._list.pointerFirstY,this.stopPointerTracking()),clearTimeout(this._updateManager),this._listHasMoved=!1}onPointerCancel(){this._list.info("ch5-list-event-manager - onPointerCancel"),this.stopPointerTracking()}updateDragEventListeners(e){this._list.info("ch5-list-event-manager - updateDragEventListeners"),e.addEventListener("touchstart",this.onPointerDown,getEvtListenerOptions(!0)),e.addEventListener("mousedown",this.onPointerDown,getEvtListenerOptions(!0))}onOrientationChange(){this._templateHelper.customScrollbar(this._list)}stopPointerTracking(){this._list.info("ch5-list-event-manager - stopPointerTracking"),this._list.isPointerActive=!1,this._list.pointerId=0,null!==this._animationHelper&&this._animationHelper.startDecelerating()}_addTrackingPoint(e,t){const i=Date.now();switch(t){case 0:for(;this._list.trackingPointsX.length>0&&!(i-this._list.trackingPointsX[0].time<=100);)this._list.trackingPointsX.shift();this._list.trackingPointsX.push({num:e,time:i});break;case 1:for(;this._list.trackingPointsY.length>0&&!(i-this._list.trackingPointsY[0].time<=100);)this._list.trackingPointsY.shift();this._list.trackingPointsY.push({num:e,time:i})}}};import _24 from"lodash";var Ch5ListSignalManager=class extends Ch5ListAbstractHelper{unsubscribeFromSignals(e){const t=this._list;this.clearSubscription(e,t.receiveStateScrollToSub,"receiveStateScrollTo"),this.clearSubscription(e,t.receiveStateSize,"receiveStateSize"),this.clearSubscription(e,t.receiveStateTemplateVarsSub,"receiveStateTemplateVars")}subscribeToSignal(e,t,i,s){if(void 0===t||void 0===i)return"";if(null!=(t=Ch5Signal.getSubscriptionSignalName(t))){const s=this.getStateFromFactory(t,e);null!==s&&s.unsubscribe(i)}const n=this.getStateFromFactory(t,e);return _24.isNil(n)?"":n.subscribe(s.bind(this._list))}getStateFromFactory(e,t){return Ch5SignalFactory.getInstance().getState(e,t)}clearSubscription(e,t,i){const s={...this._list};i in s&&null!==s[i]&&(e(i,t),s[i]="")}};import isNil13 from"lodash/isNil";import isUndefined3 from"lodash/isUndefined";import _25 from"lodash";var Ch5Animation2=class{_duration=0;_defaultDuration=0;_easeMode="linear";_wrapper={};constructor(e,t,i){this.duration=e,this.defaultDuration=e,this.easeMode=t,this.wrapper=i}set duration(e){_25.isNil(e)||(this._duration=e)}get duration(){return this._duration}set defaultDuration(e){_25.isNil(e)||(this._defaultDuration=e)}get defaultDuration(){return this._defaultDuration}set easeMode(e){_25.isNil(e)||(this._easeMode=e)}get easeMode(){return this._easeMode}set wrapper(e){_25.isNil(e)||(this._wrapper=e)}get wrapper(){return this._wrapper}},_frictionForce=.95555,_defaultVelocityMultiplicationFactor=25,_maxVelocityAmount=2e3,Ch5ListAnimation=class extends Ch5ListAbstractHelper{disableAnimation=!1;animationAPI={};animationFrame=0;maxOffsetTranslate;minOffsetTranslate=0;direction=1;constructor(e,t){super(e),t instanceof Ch5Animation2&&(this.animationAPI=t)}stop(){this._list.pagedSwipe||(this._list.decelerating=!1,cancelAnimationFrame(this.animationFrame))}onFinishAnimation(){this._list.decelerating=!1}addAnimationApi(e){return e instanceof Ch5Animation2&&(this.animationAPI=e,!0)}startDecelerating(){this._list.info("ch5-list-template - startDecelerating"),this._list.pagedSwipe||this._list.endless||(this.minOffsetTranslate=0),this.listDeceleration()}listDeceleration(){if(this.disableAnimation)return void(this._list.decelerating=!1);this._list.decelerating=!0;let e,t=this._list.isHorizontal?this._list.currentXPosition:this._list.currentYPosition;const i=this._list.pointerEndTime-this._list.pointerStartTime,s=this._list.isHorizontal,n=s?this._list.currentXPosition:this._list.currentYPosition,r=s?this._list.stepOnX:this._list.stepOnY,a=Math.abs(n-r);if(e=Math.round(a/i)*_defaultVelocityMultiplicationFactor,this._list.endless?this._infiniteLoopManager(t):t=this.fixOffset(t),0!==a){if(e>_maxVelocityAmount&&(e=_maxVelocityAmount),this._list.pagedSwipe){const e=this._list.viewportClientWidth,i=this._list.viewportClientHeight,s=this._list.isHorizontal?e:i;this._templateHelper.computePage(t,r,n),t=this._list.currentPage*s,this._list.isHorizontal?this._list.currentXPosition=t:this._list.currentYPosition=t,this.updateDragPosition(t,this.animationAPI.animate)}else{cancelAnimationFrame(this.animationFrame);const i=()=>{const s=this._list.isLtr(),n=this.minOffsetTranslate||0,r=this.maxOffsetTranslate||0,a=this._list.isHorizontal?this._list.currentXPosition:this._list.currentYPosition;if(e<1||!this._list.endless&&(e<1||s&&(a<=r||a>=0)||!s&&(a<=n||a>=-r)))return cancelAnimationFrame(this.animationFrame),void(this._list.decelerating=!1);e*=_frictionForce,this._list.isHorizontal?(this._list.pointerFirstX<this._list.pointerLastX?this._list.currentXPosition+=e:this._list.currentXPosition-=e,t=this._list.currentXPosition):(this._list.pointerFirstY<this._list.pointerLastY?this._list.currentYPosition+=e:this._list.currentYPosition-=e,t=this._list.currentYPosition),this.updateDragPosition(t),this.animationFrame=requestAnimationFrame(i)};e>0&&i()}this._list.bufferAmount&&this._list.bufferdItemsHelper.maybeAddBufferItems(t)}else this._list.decelerating=!1}fixOffset(e){this._list.info(`ch5-list-animation - fixOffset, coord: ${e}`);const t=this._list.isLtr();let i,s=0;return isUndefined3(this.maxOffsetTranslate)&&(this.maxOffsetTranslate=0),this._list.isHorizontal?isNil13(this._list.itemOffsetWidth)||(i=this.maxOffsetTranslate,s=n(e,i,this.minOffsetTranslate)):isNil13(this._list.itemOffsetHeight)||(i=this.maxOffsetTranslate,s=n(e,i,this.minOffsetTranslate)),s;function n(e,i,s){let n=i,r=s;if(!t){const e=n;n=r,r=-e}return e<n?n:e>r?r:e}}signalScrollTo(e){this._list.info(`ch5-list-animation - signalScrollTo, position: ${e}`);const t=this._list.isLtr();let i=e>=0;if(this._list.isHorizontal&&!t&&(i=(e=-e)<=0),this._list.divList.childElementCount>0&&i){const t=this._list.divList.firstChild.getBoundingClientRect();if(null!==t){const i=this._list.isHorizontal?t.width:t.height,s=this.animationAPI.animate.bind(this.animationAPI),n=-i*e;this._list.isHorizontal?this._list.currentXPosition=n:this._list.currentYPosition=n,this._list.templateHelper.updateScrollBarPosition(n,s),this.updateDragPosition(n,s)}}}slideTo(e){this._list.isHorizontal?this._templateHelper.setWrapperTranslateX(e):this._templateHelper.setWrapperTranslateY(e)}resolveDirection(e,t){return e>=t?0:1}updateDragPosition(e,t){let i;this._list.endless?this._infiniteLoopManager(e):e=this._computeNewPosition(e),void 0!==t&&(i=t.bind(this.animationAPI)),this._list.isHorizontal?this._templateHelper.setWrapperTranslateX(e,i):this._templateHelper.setWrapperTranslateY(e,i),!0===this._list.scrollbar&&this._templateHelper.updateScrollBarPosition(e,i),this._list.pointerLastX=this._list.pointerCurrentX,this._list.pointerLastY=this._list.pointerCurrentY,this._list.dragTicking=!1,this._list.bufferdItemsHelper.maybeAddBufferItems(e)}adjustMaxOffset(e=!1){if(!e)return-this._list.sizeResolver.hiddenListSize;this._templateHelper.updateViewportSize(this._list.sizeResolver.viewPortSize);const t=this._list.getItemsPerPage(),i=this._list.getItemSize();return-(((this._list.size||0)-t)*i)}resetOffsets(){this.maxOffsetTranslate=void 0,this.minOffsetTranslate=0}_infiniteLoopManager(e){const t=this._list.items[0],i=this._list.isLtr();if(!t)return;const s=this._list.isHorizontal?t.element.offsetWidth:t.element.offsetHeight;if(isNil13(this.maxOffsetTranslate))return;let n,r;this._log(e),(this._list.isVertical||i)&&this._arrangementCondition(e)&&(1===this.direction?(n=Math.ceil(Math.abs(e-this.maxOffsetTranslate)/s),r=this.stackInfinite):(n=Math.ceil(Math.abs(e-this.minOffsetTranslate)/s),r=this.queueInfinite),this._loop(n,r)),this._list.isHorizontal&&!i&&this._arrangementCondition(e)&&(1===this.direction?(n=Math.ceil(Math.abs(e-this.minOffsetTranslate)/s),r=this.queueInfinite):(n=Math.ceil(Math.abs(e-this.minOffsetTranslate)/s)-1,r=this.stackInfinite),this._loop(n,r))}stackInfinite(){const e=this._list.items.shift(),t=this._list.isLtr();if(!e||isNil13(this.maxOffsetTranslate))return;const i=this._list.sizeResolver.fullListSize;let s=e.element.offsetWidth,n=i;if(this._list.isHorizontal&&!t&&(n=-i),this._list.items.push(e),this._list.isHorizontal){const t=e.translateX+n;this._templateHelper.setItemTranslateX(t,e)}else{const t=e.translateY+n;this._templateHelper.setItemTranslateY(t,e),s=e.element.offsetHeight}let r=-s;this._list.isHorizontal&&!t&&(r=s),this.maxOffsetTranslate=this.maxOffsetTranslate+r,this.minOffsetTranslate=this.minOffsetTranslate+r}queueInfinite(){const e=this._list.items.pop(),t=this._list.isLtr();if(!e||isNil13(this.maxOffsetTranslate))return;const i=this._list.sizeResolver.fullListSize;let s=e.element.offsetWidth,n=-i;if(this._list.isHorizontal&&!t&&(n=i),this._list.items.unshift(e),this._list.isHorizontal){const t=e.translateX+n;this._templateHelper.setItemTranslateX(t,e)}else{const t=e.translateY+n;this._templateHelper.setItemTranslateY(t,e),s=e.element.offsetHeight}let r=s;this._list.isHorizontal&&!t&&(r=-s),this.maxOffsetTranslate=this.maxOffsetTranslate+r,this.minOffsetTranslate=this.minOffsetTranslate+r}_calculateNextPosition(){const e=this._list.getItemSize();return this._list.items.length*e}_loop(e,t){let i=0;for(;i<e;)t.apply(this),i>this._list.items.length?(i=0,e-=this._list.items.length):i++}_arrangementCondition(e){const t=this._list.isLtr();if(isNil13(this.maxOffsetTranslate))return!1;if(1===this.direction){let i=this.maxOffsetTranslate;return this._list.isHorizontal&&!t&&(i=this.minOffsetTranslate),e<i}return e>this.minOffsetTranslate}_computeNewPosition(e){const t=this.maxOffsetTranslate||0,i=this._list.isHorizontal?this._list.currentXPosition:this._list.currentYPosition,s=this._list.isLtr();if(this._list.isHorizontal&&!s){if(i>-t||e>-t)return this._list.currentXPosition=this._list.currentYPosition=-t;if(i<0||e<0)return this._list.currentXPosition=this._list.currentYPosition=0}else{if(i<t||e<t)return this._list.currentXPosition=this._list.currentYPosition=t;if(i>0||e>0)return this._list.currentXPosition=this._list.currentYPosition=0}return e}_log(e){const t=this._list.isLtr();if(isNil13(this.maxOffsetTranslate))return;let i,s;this._list.isHorizontal&&!t?(i=e>this.maxOffsetTranslate,s=e<this.minOffsetTranslate):(i=e<this.maxOffsetTranslate,s=e>this.minOffsetTranslate),this._list.info({dir:this.direction,shouldStack:i,shouldQueue:s,minOffset:this.minOffsetTranslate,maxOffset:this.maxOffsetTranslate,pos:e})}},Ch5ListBufferedItems=class extends Ch5ListAbstractHelper{bufferItems(e,t){if("boolean"!=typeof e&&(e=!1),"boolean"!=typeof t&&(t=!1),!this._list.bufferedItems.bufferActive)return;const i=Number(this._list.size);!e&&this._list.bufferedItems.bufferForwardStartIndex<=i&&0===this._list.bufferedItems.forwardBufferedItems.length&&this._list.bufferedItems.bufferForwardStartIndex<=this._list.bufferedItems.bufferBackwardsStartIndex+this._list.getFirstRenderVisibleItemsNr()&&this._bufferItemsForward(),this._list.endless&&!t&&this._list.bufferedItems.bufferBackwardsStartIndex>0&&0===this._list.bufferedItems.backwardsBufferedItems.length&&this._list.bufferedItems.bufferBackwardsStartIndex>this._list.bufferedItems.bufferForwardStartIndex&&this._bufferItemsBackwards(),this._list.bufferedItems.bufferingComplete=this._list.bufferedItems.bufferForwardStartIndex>i||this._list.bufferedItems.bufferForwardStartIndex-1===this._list.bufferedItems.bufferBackwardsStartIndex||0===this._list.bufferedItems.bufferBackwardsStartIndex}_appendForwardBufferedItemsToList(e,t,i){if(this._list.bufferedItems.forwardBufferedItems.length>0){const e=document.createDocumentFragment();this._list.bufferedItems.forwardBufferedItems=this._list.bufferedItems.forwardBufferedItems.reverse();let t=this._list.bufferedItems.forwardBufferedItems.pop();for(;void 0!==t;)e.appendChild(t),t=this._list.bufferedItems.forwardBufferedItems.pop(),this._list.appendPosition++;this._list.divList.insertBefore(e,this._list.divList.children[this._list.appendPosition]),this.bufferItems(!1,!0),this._list.onResizeList()}}maybeAddBufferItems(e){if(null!==this._list.bufferAmount&&this._list.bufferAmount>0){const t=(this._list.items.length-this._list.getItemsPerPage())*this._list.getItemSize(),i=this._list.isLtr();(i&&e<-t||!i&&e<t)&&this._appendForwardBufferedItemsToList(e,!this._list.isHorizontal,this._list.bufferAmount)}}_bufferItemsForward(){const e=Number(this._list.size),t=this._list.divList.id,i=this._list.divList.children.length;let s=i+Number(this._list.bufferAmount);s>e&&(s=e);for(let e=i;e<s;e++){const i=this._list.templateHelper.processTemplate(t,e,this._list.templateVars);this._list.bufferedItems.forwardBufferedItems.push(i)}this._list.bufferedItems.bufferForwardStartIndex=s+1}_bufferItemsBackwards(){const e=this._list.divList.id;let t=this._list.bufferedItems.bufferBackwardsStartIndex-Number(this._list.bufferAmount);t<this._list.bufferedItems.bufferForwardStartIndex&&(t=this._list.bufferedItems.bufferForwardStartIndex-1),t<0&&(t=0);for(let i=this._list.bufferedItems.bufferBackwardsStartIndex;i>t;i--)this._list.bufferedItems.backwardsBufferedItems.push(this._templateHelper.processTemplate(e,i,this._list.templateVars));this._list.bufferedItems.bufferBackwardsStartIndex=t}_appendBackwardsBufferedItemsToList(e,t,i){if(this._list.bufferedItems.backwardsBufferedItems.length>0){const s=document.createDocumentFragment();let n=this._list.bufferedItems.backwardsBufferedItems.pop();for(;void 0!==n;)s.appendChild(n),n=this._list.bufferedItems.backwardsBufferedItems.pop(),t?this._list.divList.scrollTop=i+e:this._list.divList.scrollLeft=i+e;this._list.divList.insertBefore(s,this._list.divList.children[this._list.appendPosition]),this.bufferItems(!0,!1),this._list.onResizeList()}}};import _26 from"lodash";var Ch5StandardAnimation=class extends Ch5Animation2{animationTimeWatcher=0;constructor(e,t,i){super(e,t,i)}animate(e,t,i){this.handleTransition(e),i===Ch5List.ORIENTATION[1]?e.style.transform=`translate3d(${t}px, 0, 0)`:e.style.transform=`translate3d(0, ${t}px, 0)`}handleTransition(e){(_26.isEmpty(e.style.transition)||_26.isNil(e.style.transition))&&(e.style.transition=`transform ${this.duration}ms ${this.easeMode}`),("0ms"===e.style.transitionDuration||_26.isEmpty(e.style.transitionDuration)||parseFloat(e.style.transitionDuration)!==this.duration)&&(e.style.transitionDuration=`${this.duration}ms`),clearTimeout(this.animationTimeWatcher),this.animationTimeWatcher=window.setTimeout(()=>{e.style.transitionDuration="0ms"},this.duration)}},Ch5AnimationFactory=class{getAnimation(e,t,i){return new Ch5StandardAnimation(e,t,i)}},utils_exports={};__export(utils_exports,{checkIfValueIsTruey:()=>checkIfValueIsTruey,convertAltUnitsToPx:()=>convertAltUnitsToPx,convertPxUnitToAlt:()=>convertPxUnitToAlt,convertPxUnitToVh:()=>convertPxUnitToVh,convertPxUnitToVw:()=>convertPxUnitToVw,convertVhUnitsToPx:()=>convertVhUnitsToPx,convertVwUnitsToPx:()=>convertVwUnitsToPx,debounce:()=>debounce2,extractMeasurementNumber:()=>extractMeasurementNumber,getMeasurementPxNumber:()=>getMeasurementPxNumber,getMeasurementUnitFromSizeValue:()=>getMeasurementUnitFromSizeValue,handlingTextTransformValue:()=>handlingTextTransformValue,isNil:()=>isNil14,isNotNil:()=>isNotNil,noop:()=>noop,toBoolean:()=>toBoolean});import _27 from"lodash";var noop=()=>{},isNil14=(e,t=!0)=>!0===t?_27.isNil(e)||""===e||""===e.toString().trim():_27.isNil(e)||""===e,isNotNil=(e,t=!0)=>!isNil14(e,t),getMeasurementUnitFromSizeValue=e=>{const t=new RegExp("^(?:[0-9]+)(\\w*|%)$");let i="px";if(isNotNil(e)){const s=e.match(t);null!==s&&isNotNil(s[1])&&(i=s[1])}return i},getMeasurementPxNumber=e=>"px"!==getMeasurementUnitFromSizeValue(e)?convertAltUnitsToPx(e):Math.round(extractMeasurementNumber(e)),convertAltUnitsToPx=e=>{const t=getMeasurementUnitFromSizeValue(e),i=parseFloat(e);let s=i;switch(t){case"vh":s=convertVhUnitsToPx(i);break;case"vw":s=convertVwUnitsToPx(i)}return Math.round(s)},convertPxUnitToAlt=(e,t)=>{let i=e;switch(t){case"vw":i=convertPxUnitToVw(e);break;case"vh":i=convertPxUnitToVh(e)}return Math.ceil(i)},convertVhUnitsToPx=e=>e*(window.innerHeight||document.documentElement.clientHeight)/100,convertVwUnitsToPx=e=>e*(window.innerWidth||document.documentElement.clientWidth)/100,convertPxUnitToVh=e=>e/(window.innerHeight||document.documentElement.clientHeight)*100,convertPxUnitToVw=e=>e/(window.innerWidth||document.documentElement.clientWidth)*100,extractMeasurementNumber=e=>{const t=new RegExp("^-?\\d+\\.?\\d*");let i=0;if(null!=e){const s=e.match(t);null!==s&&void 0!==s[0]&&(i=Number(s[0]))}return i},handlingTextTransformValue=(e,t)=>{let i=e;if(null==e)return"";switch(t){case"capitalize":i=i.replace(/\b\w/g,e=>e.toUpperCase());break;case"uppercase":i=i.toUpperCase();break;case"lowercase":i=i.toLowerCase()}return i},debounce2=(e,t)=>{let i;return function(...s){window.clearTimeout(i),i=window.setTimeout(()=>{window.clearTimeout(i),e(...s)},t)}},toBoolean=(e,t=!1)=>{switch(String(e).toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1;case"":case null:case void 0:case"null":case"undefined":return!0===t;default:return!1}},checkIfValueIsTruey=(e="")=>!!e&&e.length>0&&"false"!==e&&"0"!==e&&null!==e,Ch5ListItemAxis=(e=>(e[e.X=0]="X",e[e.Y=1]="Y",e))(Ch5ListItemAxis||{}),duration=300,easeMode="ease-out",Ch5List=class e extends Ch5Common{static ELEMENT_NAME="ch5-list";static ORIENTATION=["vertical","horizontal"];static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatesize:{direction:"state",numericJoin:1,contractName:!0},receivestatescrollto:{direction:"state",numericJoin:1,contractName:!0},receivestatetemplatevars:{direction:"state",stringJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static COMPONENT_DATA={SCALE:{default:e.ORIENTATION[0],values:e.ORIENTATION,key:"scale",classListPrefix:"--"}};static COMPONENT_PROPERTIES=[{default:!1,name:"scrollbar",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"endless",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];static ENABLED_CLASS_NAME="ch5-list";static ITEMCLASS="list-item";_ch5Properties;primaryCssClass="ch5-list";_bufferedItems={bufferActive:!1,bufferingComplete:!1,bufferForwardStartIndex:0,forwardBufferedItems:[],bufferBackwardsStartIndex:0,backwardsBufferedItems:[]};_appendPosition=0;_divListWidth=0;_divListHeight=0;itemOffsetWidth=0;itemOffsetHeight=0;viewportClientHeight=0;viewportClientWidth=0;templateHelper;eventManager;animationHelper;signalManager;bufferdItemsHelper;divList=document.createElement("div");pointerStartTime=0;pointerEndTime=0;stepOnX=0;stepOnY=0;currentPage=0;templateElement={};sizeResolver={};_currentXPosition=0;_currentYPosition=0;_defaultScrollToTime=500;_size=1;_previousSize=1;_orientation=e.ORIENTATION[0];_bufferAmount=0;_itemHeight=null;_itemWidth=null;_minWidth=null;_maxWidth=null;_minHeight=null;_maxHeight=null;_pagedSwipe=!1;_scrollToTime=500;_indexId=null;_direction=Ch5Common.DIRECTION[0];_templateVars=null;_receiveStateSize=null;_receiveStateSizeSub="";_receiveStateScrollTo=null;_receiveStateScrollToSub="";_receiveStateTemplateVars=null;_receiveStateTemplateVarsSub="";_processingPan=!1;_storedOffsetWidth=0;_storedOffsetHeight=0;_tplHtmlString="";_updateTimer=void 0;_isPointerActive=!1;_pointerId=0;_pointerFirstX=0;_pointerFirstY=0;_pointerLastX=0;_pointerLastY=0;_pointerCurrentX=0;_pointerCurrentY=0;_lastDraggedLayoutIndex=0;_trackingPointsX=[];_trackingPointsY=[];_dragTicking=!1;_maxDecelVelocity=50;_minDecelVelocity=20;_friction=.7;_attraction=.04;_decelVelocity=0;_decelerating=!1;_scrollToTimeReference=0;_initCompleted=!1;_cachedFirstRenderVisibleItemsNr=0;_items=[];_lastViewIndex=-1;_infiniteLoop=!1;_wrapperTranslateX=0;_wrapperTranslateY=0;_selectedIteration=0;_previousEffectiveLayoutIndex=0;_isListVisible=!0;receiveStateScrollToChanged=!1;static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.templateHelper=new Ch5ListTemplate(this),this.signalManager=new Ch5ListSignalManager(this),this.animationHelper=new Ch5ListAnimation(this),this.eventManager=new Ch5ListEventManager(this),this.bufferdItemsHelper=new Ch5ListBufferedItems(this),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.eventManager.addAnimationHelper(this.animationHelper),this.eventManager.addTemplateHelper(this.templateHelper),this.animationHelper.addTemplateHelper(this.templateHelper),this.animationHelper.addEventManager(this.eventManager),this.bufferdItemsHelper.addTemplateHelper(this.templateHelper)}getCssClassDisabled(){return`${this.primaryCssClass}--disabled`}connectedCallback(){this._isListVisible=!0,this.contentCleanUp(),subscribeInViewPortChange(this,()=>{this.info(`Ch5List.subscribeInViewPortChange() with elementIsInViewPort: ${this.elementIsInViewPort}, this.receiveStateScrollToChanged: ${this.receiveStateScrollToChanged}, _isListVisible: ${this._isListVisible}, this.hasAttribute('scrollbar'): ${this.hasAttribute("scrollbar")}`),this.elementIsInViewPort&&(this._isListVisible||this.receiveStateScrollToChanged)&&(this.info("Updating View"),this.hasAttribute("scrollbar")&&"true"===String(this.getAttribute("scrollbar"))?(this.templateHelper.customScrollbar(this.divList),setTimeout(()=>{this.templateHelper.resizeList(this.divList,this.templateVars)},.5)):this.templateHelper.resetListLayout(),this.templateHelper.checkAndSetSizes(),this.templateHelper.customScrollbar(this.divList),this._isListVisible=!1,this.receiveStateScrollToChanged=!1,this.hasAttribute("receiveStateScrollTo")&&""!==String(this.getAttribute("receiveStateScrollTo"))&&this.setScrollToContent())});const e=()=>{this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5List),this.hasAttribute("endless")&&"false"!==this.getAttribute("endless")&&null!==this.getAttribute("endless")&&(this.templateHelper.endless=!0),this.info("connectedCallback"),this.setAttribute("data-ch5-id",this.getCrId());const e=()=>{this.info("connectedCallback initializations"),this.initializations()},t=()=>{this.info("add mutation observer in order to extract template data"),this._startReadyObserver(),this.initializations()};this._tplHtmlString=this.templateHelper.checkForTemplate(),""===this._tplHtmlString?(t(),this.templateHelper.updateTemplateString(this._tplHtmlString)):e(),this.initCommonMutationObserver(this);const i=(new Ch5AnimationFactory).getAnimation(duration,easeMode,this.divList);this.animationHelper.addAnimationApi(i),this.info("Callback loaded - ch5 list")};Promise.all([customElements.whenDefined("ch5-list")]).then(()=>{e(),this.componentLoadedEvent("ch5-list",this.id)})}initializations(){this.cacheComponentChildrens(),this.initializeAttributes(),this.resolveTemplateChildren(this.templateElement);const e=Ch5Config.getTemplateVarsForElement(this);e.length>0&&(this.templateVars=JSON.stringify(e)),this._previousEffectiveLayoutIndex=this.selected,this._tplHtmlString.length<=0||(this.templateHelper.resizeList(this.divList,this.templateVars),this.isPagedSwipeCompatible(this.pagedSwipe)||(this.pagedSwipe=!1),this.initializeEvents(),this._initCompleted=!0)}disconnectedCallback(){this.removeEvents(),this.unsubscribeFromSignals(),unSubscribeInViewPortChange(this),this.disconnectCommonMutationObserver()}unsubscribeFromSignals(){this.info("unsubscribeFromSignals()"),super.unsubscribeFromSignals(),this.signalManager.unsubscribeFromSignals(this.clearStringSignalSubscription)}attributeChangedCallback(t,i,s){if(i===s)return;this.info('ch5-list attributeChangedCallback("'+t+'","'+i+'","'+s+'")'),this.info("attribute changed callback:",t);const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else switch(t){case"selected":const n=parseInt(s,10);if(!Number.isFinite(n)||n>this._lastViewIndex||n<0)return void(this.selected=Number(i)||0);if(this._infiniteLoop){const e=this.selected+this._selectedIteration*(this._lastViewIndex+1),t=this._previousEffectiveLayoutIndex-e,i=[],s=t<0?this.getItemsPerPage()+t:0;for(let n=-1;n<Math.abs(t);n++)i.push(n+e+s);this._previousEffectiveLayoutIndex=e}break;case"disableanimation":this.animationHelper.disableAnimation=null!==s;break;case"size":const r=s?Number(s):1;this._initCompleted&&r!==this.size&&(this.size=r,this.templateHelper.resizeList(this.divList,this.templateVars));break;case"orientation":this.hasAttribute("orientation")?this.orientation=s:this.orientation=e.ORIENTATION[0];break;case"bufferamount":this.hasAttribute("bufferamount")?this.bufferAmount=Number(s):this.bufferAmount=0;break;case"itemheight":this.hasAttribute("itemheight")&&(this.itemHeight=s);break;case"itemwidth":this.hasAttribute("itemwidth")&&(this.itemWidth=s);break;case"minwidth":this.hasAttribute("minwidth")&&(this.minWidth=s);break;case"maxwidth":this.hasAttribute("maxwidth")&&(this.maxWidth=s);break;case"minheight":this.hasAttribute("minheight")&&(this.minHeight=s);break;case"maxheight":this.hasAttribute("maxheight")&&(this.maxHeight=s);break;case"indexid":this.hasAttribute("indexid")&&(this.indexId=s);break;case"pagedswipe":this.hasAttribute("pagedswipe")&&(this.pagedSwipe="true"===s);break;case"scrolltotime":this.hasAttribute("scrolltotime")&&(this.scrollToTime=Number(s));break;case"dir":this.hasAttribute("dir")&&(this.direction=s);break;case"receivestatesize":this.hasAttribute("receivestatesize")?this.receiveStateSize=s:this.receiveStateSize="";break;case"receivestatescrollto":this.hasAttribute("receivestatescrollto")?this.receiveStateScrollTo=s:this.receiveStateScrollTo="";break;case"receivestatetemplatevars":this.hasAttribute("receivestatetemplatevars")?this.receiveStateTemplateVars=s:this.receiveStateTemplateVars="";break;default:super.attributeChangedCallback(t,i,s)}}getItemSize(){return this.isHorizontal?this.itemOffsetWidth:this.itemOffsetHeight}getItemsPerPage(){let e=0;return e=this.isHorizontal?this.viewportClientWidth/this.itemOffsetWidth:this.viewportClientHeight/this.itemOffsetHeight,e}getVisibleItemsPerPage(){const e=this.getItemsPerPage();return Math.floor(e)}_canUseBufferAmount(e){return e<Number(this.size)}getFirstRenderVisibleItemsNr(e=!1){if(e&&(this._cachedFirstRenderVisibleItemsNr=0),this._cachedFirstRenderVisibleItemsNr>0)return this._cachedFirstRenderVisibleItemsNr;const t=Number(this.size),i=Number(this.bufferAmount);return this._cachedFirstRenderVisibleItemsNr=0===i||t<=i?t:this._getFirstRenderedItemsNr(t),this._cachedFirstRenderVisibleItemsNr}swipe(e){this._processingPan||(this._processingPan=!0,this.divList.childElementCount>0&&e.then(()=>{this._processingPan=!1}).catch(e=>{this._processingPan=!1,this.error("Error while processing a swipe operation. More details: ",e)}).then(noop))}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(["selected","disableanimation","size","orientation","bufferamount","itemheight","itemwidth","minwidth","maxwidth","minheight","maxheight","indexid","pagedswipe","endless","scrolltotime","direction","receivestateshow","receivestatesize","receivestatescrollto","receivestatetemplatevars"])}set currentXPosition(e){isNil15(e)||(this._currentXPosition=e)}get currentXPosition(){return this._currentXPosition}set currentYPosition(e){isNil15(e)||(this._currentYPosition=e)}get currentYPosition(){return this._currentYPosition}get isVertical(){return this.orientation===e.ORIENTATION[0]}get isHorizontal(){return this.orientation===e.ORIENTATION[1]}get size(){return void 0===this._size&&(this._size=1),this._size}set size(e){isNil15(e)&&(e=1),e>1e3&&(e=1e3),e!==this._size&&(this._size=Number(e),this.setAttribute("size",this._size.toString()))}get previousSize(){return isNil15(this._previousSize)&&(this._previousSize=1),this._previousSize}set previousSize(e){isNil15(e)&&(e=1),e>1e3&&(e=1e3),this._previousSize=Number(e)}get orientation(){return null==this._orientation&&(this._orientation=e.ORIENTATION[0]),this._orientation}set orientation(t){isNil15(t)&&(t=e.ORIENTATION[0]),t!==this._orientation&&(e.ORIENTATION.indexOf(t)>=0?this._orientation=t:this._orientation=e.ORIENTATION[0],this.setAttribute("orientation",this._orientation))}get bufferAmount(){return this._bufferAmount}set bufferAmount(e){isNil15(e)&&(e=0),e!==this.bufferAmount&&(this._bufferAmount=Number(e),this.setAttribute("bufferamount",this._bufferAmount.toString()))}get itemHeight(){return this._itemHeight}set itemHeight(e){(e=this._checkAndSetStringValue(e))!==this._itemHeight&&(this._itemHeight=e,this.setAttribute("itemheight",e),this.templateHelper.attachCSS(),this.templateHelper.checkAndSetSizes())}get itemWidth(){return this._itemWidth}set itemWidth(e){(e=this._checkAndSetStringValue(e))!==this._itemWidth&&(this._itemWidth=e,this.setAttribute("itemwidth",e),this.templateHelper.attachCSS(),this.templateHelper.checkAndSetSizes())}get minWidth(){return this._minWidth}set minWidth(e){(e=this._checkAndSetStringValue(e))!==this._minWidth&&(this._minWidth=e,this.setAttribute("minwidth",this._minWidth),this.templateHelper.triggerResizeDueWidthAndHeightUpdates(),this.templateHelper.resetListLayout())}get maxWidth(){return isNil15(this._maxWidth)&&(this._maxWidth=""),this._maxWidth}set maxWidth(e){(e=this._checkAndSetStringValue(e))!==this._maxWidth&&(this._maxWidth=e,this.setAttribute("maxwidth",this._maxWidth))}isLtr(){return!!this.isVertical||this.direction===Ch5Common.DIRECTION[0]}getMaxWidthInPxFromPercentage(){let e=this.maxWidth;if(this.parentElement){const t=this.parentElement.getBoundingClientRect(),i=Ch5Common.extractMeasurementNumber(e);e=`${String(t.width*i/100)}px`}return e}getMaxHeightInPxFromPercentage(){let e=this.maxHeight;if(this.parentElement){const t=this.parentElement.getBoundingClientRect(),i=Ch5Common.extractMeasurementNumber(e);e=`${String(t.height*i/100)}px`}return e}calculatePxSize(e,t){switch(Ch5Common.getMeasurementUnitFromSizeValue(e)){case"%":if("function"==typeof t)return t();break;case"vw":const i=Ch5Common.extractMeasurementNumber(e);return`${Ch5Common.convertVwUnitsToPx(i)}px`}return e}get minHeight(){return isNil15(this._minHeight)&&(this._minHeight=""),this._minHeight}set minHeight(e){(e=this._checkAndSetStringValue(e))!==this._minHeight&&(this._minHeight=e,this.setAttribute("minheight",e),this.templateHelper.triggerResizeDueWidthAndHeightUpdates(),this.templateHelper.resetListLayout())}get maxHeight(){return this._maxHeight}set maxHeight(e){(e=this._checkAndSetStringValue(e))!==this._maxHeight&&(this._maxHeight=e,this.setAttribute("maxheight",e),this.templateHelper.triggerResizeDueWidthAndHeightUpdates(),this.templateHelper.resetListLayout())}get indexId(){return isNil15(this._indexId)&&(this._indexId="1"),this._indexId}set indexId(e){isNil15(e)&&(e="1"),e!==this._indexId&&(this._indexId=e,this.setAttribute("indexid",e))}get pagedSwipe(){return null==this._pagedSwipe&&(this._pagedSwipe=!1),this._pagedSwipe}set pagedSwipe(e){null==e&&(e=!1),e!==this._pagedSwipe&&(this._pagedSwipe=e,!0===e?this.setAttribute("pagedswipe",e.toString()):this.removeAttribute("pagedswipe"))}set endless(e){this._ch5Properties.set("endless",e,()=>{this.handleScrollbar()})}get endless(){return this._ch5Properties.get("endless")}set scrollbar(e){this._ch5Properties.set("scrollbar",e,()=>{this.templateHelper.removeScrollbar(),this.hasAttribute("scrollbar")&&this.templateHelper.customScrollbar(this.divList),this.handleScrollbar()})}get scrollbar(){return this._ch5Properties.get("scrollbar")}get scrollToTime(){return null==this._scrollToTime?this._defaultScrollToTime:this._scrollToTime}set scrollToTime(e){isNil15(e)&&(e=this._defaultScrollToTime),e!==this._scrollToTime&&(this._scrollToTime=e,this.setAttribute("scrolltotime",e.toString()))}get templateVars(){return this._templateVars}set templateVars(e){this._templateVars=e}get direction(){return this._direction}set direction(e){null==e&&(e="ltr"),Ch5Common.DIRECTION.indexOf(e)>=0?this._direction=e:this._direction=Ch5Common.DIRECTION[0]}set isPointerActive(e){this._isPointerActive===e||isNil15(e)||(this._isPointerActive=e)}get isPointerActive(){return this._isPointerActive}set pointerId(e){this._pointerId=e}get pointerId(){return this._pointerId}set decelerating(e){isNil15(e)||this.decelerating===e||(this._decelerating=e)}get decelerating(){return this._decelerating}set decelVelocity(e){isNil15(e)||this._decelVelocity===e||(this._decelVelocity=e)}get decelVelocity(){return this._decelVelocity}get receiveStateSize(){return this._attributeValueAsString("receivestatesize")}set receiveStateSize(e){if(this._receiveStateSize===e||isNil15(e))return;this._receiveStateSize=e,this.setAttribute("receivestatesize",e);this._receiveStateSizeSub=this.signalManager.subscribeToSignal(0,this._receiveStateSize,this.receiveStateSizeSub,e=>{const t=e;if(null!==t||void 0!==t)if(t>=0&&t<1001){const e=this._items.length;if(this.setAttribute("size",""+t),this.endless)this.animationHelper.maxOffsetTranslate=void 0,this.shouldUpdateListAndPosition(e);else{const t=this.bufferAmount||0,i=this.animationHelper.adjustMaxOffset(t>0);this.animationHelper.maxOffsetTranslate=i,this.shouldUpdateListAndPosition(e)}}else t>1e3&&this.info(`List size exceeded : ${t} ; `)})}getLayoutInfo(){if(!this.bufferAmount)return this.sizeResolver;const e=this.getItemsPerPage(),t=this.getItemSize(),i=this.size||0;return{hiddenListSize:(i-e)*t,fullListSize:i*t,viewPortSize:this.sizeResolver.viewPortSize}}get receiveStateScrollTo(){return this._attributeValueAsString("receivestatescrollto")}set receiveStateScrollTo(e){this._receiveStateScrollTo===e||isNil15(e)||(this._receiveStateScrollTo=e,this.setAttribute("receivestatescrollto",e))}handleScrollbar(){this.endless&&(this.scrollbar=!1)}setScrollToContent(){setTimeout(()=>{this._receiveStateScrollToSub=this.signalManager.subscribeToSignal(0,this.receiveStateScrollTo,this.receiveStateScrollToSub,e=>{const t=e;if(this.info("SignalSubscriptionCallback value is ",t),null!==t||void 0!==t){const e=this.bufferAmount||0,i=this.animationHelper.adjustMaxOffset(e>0);this.animationHelper.maxOffsetTranslate=i,this.animationHelper.signalScrollTo(t),this.receiveStateScrollToChanged=!0}})},100)}get receiveStateTemplateVars(){return this._attributeValueAsString("receivestatetemplatevars")}set receiveStateTemplateVars(e){if(this._receiveStateTemplateVars===e||isNil15(e))return;this._receiveStateTemplateVars=e,this.setAttribute("receivestatetemplatevars",e);this._receiveStateTemplateVarsSub=this.signalManager.subscribeToSignal("",this.receiveStateTemplateVars,this.receiveStateTemplateVarsSub,e=>{const t=e;isNil15(t)||(this.templateVars=t,this.templateHelper.resizeList(this.divList,this.templateVars))})}get receiveStateSizeSub(){return this._receiveStateSizeSub}set receiveStateSizeSub(e){this._receiveStateSizeSub=e}get receiveStateScrollToSub(){return this._receiveStateScrollToSub}set receiveStateScrollToSub(e){this._receiveStateScrollToSub=e}get receiveStateTemplateVarsSub(){return this._receiveStateTemplateVarsSub}set receiveStateTemplateVarsSub(e){this._receiveStateTemplateVarsSub=e}get selected(){const e=this.getAttribute("selected");return isNil15(e)?0:parseInt(e,10)}set selected(e){this.setAttribute("selected",e.toString())}set disableAnimation(e){(e=Boolean(e))?this.setAttribute("disableAnimation",""):this.removeAttribute("disableAnimation")}get disableAnimation(){return this.hasAttribute("disableAnimation")}get appendPosition(){return this._appendPosition}set appendPosition(e){isNil15(e)||this._appendPosition===e||(this._appendPosition=e)}set pointerFirstX(e){isNil15(e)||this.pointerFirstX===e||(this._pointerFirstX=e)}get pointerFirstX(){return this._pointerFirstX}set pointerLastX(e){isNil15(e)||this._pointerLastX===e||(this._pointerLastX=e)}get pointerLastX(){return this._pointerLastX}set pointerCurrentX(e){isNil15(e)||this._pointerCurrentX===e||(this._pointerCurrentX=e)}get pointerCurrentX(){return this._pointerCurrentX}set pointerCurrentY(e){isNil15(e)||this._pointerCurrentY===e||(this._pointerCurrentY=e)}get pointerCurrentY(){return this._pointerCurrentY}set pointerFirstY(e){isNil15(e)||this._pointerFirstY===e||(this._pointerFirstY=e)}get pointerFirstY(){return this._pointerFirstY}set pointerLastY(e){isNil15(e)||this._pointerLastY===e||(this._pointerLastY=e)}get pointerLastY(){return this._pointerLastY}set lastDraggedLayoutIndex(e){isNil15(e)||this._lastDraggedLayoutIndex===e||(this._lastDraggedLayoutIndex=e)}get lastDraggedLayoutIndex(){return this._lastDraggedLayoutIndex}set trackingPointsX(e){isNil15(e)||(this._trackingPointsX=e)}get trackingPointsX(){return this._trackingPointsX}set trackingPointsY(e){isNil15(e)||(this._trackingPointsY=e)}get trackingPointsY(){return this._trackingPointsY}set items(e){isNil15(e)||(this._items=e)}get items(){return this._items}set selectedIteration(e){isNil15(e)||this._selectedIteration===e||(this._selectedIteration=e)}get selectedIteration(){return this._selectedIteration}set wrapperTranslateX(e){isNil15(e)||this._wrapperTranslateX===e||(this._wrapperTranslateX=e)}get wrapperTranslateX(){return this._wrapperTranslateX}set wrapperTranslateY(e){isNil15(e)||this._wrapperTranslateY===e||(this._wrapperTranslateY=e)}get wrapperTranslateY(){return this._wrapperTranslateY}set minDecelVelocity(e){isNil15(e)||this._minDecelVelocity===e||(this._minDecelVelocity=e)}get minDecelVelocity(){return this._minDecelVelocity}set maxDecelVelocity(e){isNil15(e)||this._maxDecelVelocity===e||(this._maxDecelVelocity=e)}set divListWidth(e){isNil15(e)||this._divListWidth===e||(this._divListWidth=e)}get divListWidth(){return this._divListWidth}set divListHeight(e){isNil15(e)||this._divListHeight===e||(this._divListHeight=e)}get divListHeight(){return this._divListHeight}set lastViewIndex(e){isNil15(e)||this._lastViewIndex===e||(this._lastViewIndex=e)}get lastViewIndex(){return this._lastViewIndex}set attraction(e){isNil15(e)||this._lastViewIndex===e||(this._attraction=e)}get attraction(){return this._attraction}set friction(e){isNil15(e)||this._lastViewIndex===e||(this._friction=e)}get friction(){return this._friction}set dragTicking(e){isNil15(e)||this._dragTicking===e||(this._dragTicking=e)}get dragTicking(){return this._dragTicking}set infiniteLoop(e){isNil15(e)||this._infiniteLoop===e||(this._infiniteLoop=e)}get infiniteLoop(){return this._infiniteLoop}set bufferedItems(e){isNil15(e)||this._bufferedItems===e||(this._bufferedItems=e)}get bufferedItems(){return this._bufferedItems}set scrollToTimeReference(e){isNil15(e)||this._scrollToTimeReference===e||(this._scrollToTimeReference=e)}get scrollToTimeReference(){return this._scrollToTimeReference}set storedOffsetWidth(e){isNil15(e)||(this._storedOffsetWidth=e)}get storedOffsetWidth(){return this._storedOffsetWidth}set storedOffsetHeight(e){isNil15(e)||(this._storedOffsetHeight=e)}get storedOffsetHeight(){return this._storedOffsetHeight}previousViewChild(){this.selected=this.computePrevious(this.selected)}nextViewChild(){this.selected=this.computeNext(this.selected)}onResizeList(){this._items=this._getItems(),this._internalUpdate()}getItemDataIndexFromLayoutIndex(e){let t=e;for(;t<0;)t+=this._items.length;return t%this._items.length}computeNext(e){let t=e;return e<this._lastViewIndex?t=e+1:this.endless&&(this._infiniteLoop&&(this._selectedIteration+=1),t=0),clamp(t,0,this._lastViewIndex)}computePrevious(e){let t=e;return e>0?t=e-1:this.endless&&(this._infiniteLoop&&(this._selectedIteration-=1),t=this._lastViewIndex),clamp(t,0,this._lastViewIndex)}update(){clearTimeout(this._updateTimer),this._updateTimer=window.setTimeout(()=>{this._internalUpdate()},50)}handleShow(e){super.handleShow(e),this.templateHelper.resizeList(this.divList,this.templateVars)}isPagedSwipeCompatible(e){if(!e)return!0;const t=this.size||0,i=this.sizeResolver.getItemsPerPage();return!(i>t-i)||(this.invokePropIncompatibility("pagedSwipe"),!1)}invokePropIncompatibility(e){if("pagedSwipe"===e)console.warn(this.definePropIncompatibilityInfo(e,["size","endless"]))}definePropIncompatibilityInfo(e,t){const i=t.join(",");return`For element #${this.id} - ${e} doesn't work as expected. See(${i})`}_getCssBiggestSizeValue(e,t){let i=t;if(e){const t=Ch5Common.getMeasurementPxNumber(e);i<t&&(i=t)}return i}shouldUpdateListAndPosition(e){this._items=this._getItems(),this._items.length<e?(this.isVertical||this.isHorizontal)&&this.resetListAndPosition():this.endless?this.animationHelper.stop():this._items.length>e&&this.direction===Ch5Common.DIRECTION[1]&&this.resetListAndPosition()}resetListAndPosition(){this.animationHelper.stop(),this.currentXPosition=0,this.currentYPosition=0,this.templateHelper.resizeList(this.divList,this.templateVars)}_getFirstRenderedItemsNr(t){const i=this.divList.getBoundingClientRect(),s=this.getFirstItemSizingDetails();let n=0;if(this.orientation===e.ORIENTATION[0]){const e=this.calculatePxSize(this.maxHeight,this.getMaxHeightInPxFromPercentage.bind(this)),t=this._getCssBiggestSizeValue(e,i.height),r=Math.max(this.itemOffsetHeight,s.height);n=Math.ceil(t/r)}else{const e=this.calculatePxSize(this.maxWidth,this.getMaxWidthInPxFromPercentage.bind(this)),t=this._getCssBiggestSizeValue(e,i.width),r=Math.max(this.itemOffsetWidth,s.width);n=Math.ceil(t/r)}return n*=2,n=n<=t?n:t,n}getFirstItemSizingDetails(){return this.divList.children[0].getBoundingClientRect()}setCurrentPosition(e){this.isHorizontal?this.currentXPosition=e:this.currentYPosition=e}_startReadyObserver(){const e=new MutationObserver(t=>{this.info("mutationObserver Callback"),t.forEach(t=>{if(this.info("mutation",t),"childList"===t.type&&t.addedNodes&&t.addedNodes.length>0){let i=null;for(let e=0;e<t.addedNodes.length;e++)if("template"===t.addedNodes[e].nodeName.toLowerCase()){i=t.addedNodes[e];break}if(null!==i){this.info("templateElement innerhtml",i.innerHTML);let t=i.innerHTML;""===t.trim()&&(t=i.firstElementChild.outerHTML,this._tplHtmlString=t,this.initializations(),e.disconnect(),i.remove())}}})});e.observe(this,{childList:!0,subtree:!1,attributes:!1,characterData:!1})}_getItems(){return Array.from(this.divList.children).map((e,t)=>({element:e,layoutIndex:t,translateX:0,translateY:0}))||[]}_internalUpdate(){this._updateInfiniteLoop(),this._computeItemsPerViewLayout(),this.templateHelper.checkAndSetSizes()}_updateInfiniteLoop(){this._infiniteLoop=this.endless&&this._computeLastViewIndex()>1}_computeItemsPerViewLayout(){this._lastViewIndex=this._infiniteLoop?this._items.length-1:this._computeLastViewIndex(),!this._infiniteLoop&&this.selected>this._lastViewIndex&&(this.selected=this._lastViewIndex)}_computeLastViewIndex(){return Math.max(0,this._items.length-this.getItemsPerPage())}initializeAttributes(){this.info("initializeAttributes()"),super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this.hasAttribute("size")?this.size=this.previousSize=Number(this.getAttribute("size")):this.size=this.previousSize=1,this.hasAttribute("orientation")?this.orientation=this.getAttribute("orientation"):this.orientation=e.ORIENTATION[0],this.hasAttribute("bufferamount")&&(this.bufferAmount=Number(this.getAttribute("bufferamount"))),this.hasAttribute("itemheight")&&(this.itemHeight=this.getAttribute("itemheight")),this.hasAttribute("itemwidth")&&(this.itemWidth=this.getAttribute("itemwidth")),this.hasAttribute("minwidth")&&(this.minWidth=this.getAttribute("minwidth")),this.hasAttribute("maxwidth")&&(this.maxWidth=this.getAttribute("maxwidth")),this.hasAttribute("minheight")&&(this.minHeight=this.getAttribute("minheight")),this.hasAttribute("maxheight")&&(this.maxHeight=this.getAttribute("maxheight")),this.hasAttribute("indexid")&&(this.indexId=this.getAttribute("indexid")),this.hasAttribute("pagedswipe")&&(this.pagedSwipe=this.toBoolean(this.getAttribute("pagedswipe"))),this.hasAttribute("endless")?this.endless=this.toBoolean(this.getAttribute("endless")):this.endless=!1,this.hasAttribute("scrolltotime")?this.scrollToTime=Number(this.getAttribute("scrolltotime")):this.scrollToTime=500,this.hasAttribute("dir")&&(this.direction=this.getAttribute("dir")),this.hasAttribute("receivestatesize")&&(this.receiveStateSize=this.getAttribute("receivestatesize")),this.hasAttribute("receivestatescrollto")&&(this.receiveStateScrollTo=this.getAttribute("receivestatescrollto")),this.hasAttribute("receivestatetemplatevars")&&(this.receiveStateTemplateVars=this.getAttribute("receivestatetemplatevars")),this.info("Ch5 list initialized")}initializeEvents(){super.attachEventListeners(),this.eventManager.initializeEvents(this.divList),this.info("Ch5 list - events")}removeEvents(){super.removeEventListeners(),this.eventManager.removeEvents(this.divList)}};Ch5List.registerCustomElement(),Ch5List.registerSignalAttributeTypes(),Ch5List.registerSignalAttributeDefaults(Ch5List.ELEMENT_NAME);var Ch5MediaPlayerIconButton=class e extends Ch5Log{static COMPONENT_PROPERTIES=[{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"onRelease",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"disableIconButton",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-media-player-icon-button";primaryCssClass="ch5-media-player--icon-button";_ch5Properties;_icon={};_elButton={};set iconClass(e){this._ch5Properties.set("iconClass",e,()=>{this.handleIconClass(e)})}get iconClass(){return this._ch5Properties.get("iconClass")}set onRelease(e){this._ch5Properties.set("onRelease",e,()=>{this.handleIconClass(e)})}get onRelease(){return this._ch5Properties.get("onRelease")}set disableIconButton(e){this._ch5Properties.set("disableIconButton",e,()=>{this.handledisableIconButton(e)})}get disableIconButton(){return this._ch5Properties.get("disableIconButton")}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.createInternalHtml(),this.updateCssClass()}static get observedAttributes(){const t=Ch5Log.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-media-player-icon-button attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this._elButton.classList.add("ch5-media-player--individual-icon-button"),this.appendChild(this._elButton),this.attachEventListeners(),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this.classList.add("ch5-media-player--individual-icon-button-container"),this._elButton=document.createElement("button"),this.logger.stop()}initAttributes(){const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){}removeEventListeners(){}unsubscribeFromSignals(){this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleIconClass(e){this._icon.parentNode&&this._icon&&this._icon.parentNode.removeChild(this._icon),e&&("mp-icon"===this.iconClass.split(" ")[0]?this._icon=document.createElement("i"):this._icon=document.createElement("div"),this._elButton.appendChild(this._icon),this._icon.classList.add(...e.split(" "))),this.updateCssClass()}handledisableIconButton(e){"true"===e?(this._elButton.setAttribute("disabled",""),this.classList.add("ch5-disabled")):(this._elButton.removeAttribute("disabled"),this.classList.remove("ch5-disabled"))}updateCssClass(){this.logger.start("UpdateCssClass"),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elButton}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};Ch5MediaPlayerIconButton.registerCustomElement();var TCH5NowPlayingActions=(e=>(e.Shuffle="Shuffle",e.Repeat="Repeat",e.PlayAll="PlayAll",e.NextTrack="NextTrack",e.PreviousTrack="PreviousTrack",e.Seek="Seek",e.Ffwd="Ffwd",e.Rewind="Rewind",e.Play="Play",e.Pause="Pause",e.ThumbsDown="ThumbsDown",e.ThumbsUp="ThumbsUp",e.MusicNote="MusicNote",e.UserNote="UserNote",e))(TCH5NowPlayingActions||{}),createElement=(e,t=[],i="")=>{const s=document.createElement(e);return 0!==t.length&&t.forEach(e=>s.classList.add(e)),""!==i&&(s.textContent=i),s},formatTime=(e=0)=>{const t=Math.max(0,Math.floor(Number(e)||0)),i=Math.floor(t/3600),s=Math.floor(t%3600/60),n=t%60,r=e=>e<10?"0"+e:String(e);return i>0?`${r(i)}:${r(s)}:${r(n)}`:`${r(s)}:${r(n)}`},decodeString=e=>{if(null==e||""===e)return"";const t=Uint8Array.from(e.split("").map(e=>e.charCodeAt(0)));return new TextDecoder("utf-8").decode(t)},encodeString=e=>{const t=(new TextEncoder).encode(e);return Array.from(t).map(e=>String.fromCharCode(e)).join("")},Ch5MediaPlayerNowPlaying=class{constructor(e,t){this.logger=t,this.musicPlayerLibInstance=e,this.logger.start("constructor()","ch5-media-player:now-playing"),this._nowPlayingContainer=createElement("div"),this.createDefaultNowPlaying(),subscribeState("o","nowPlayingData",e=>{this.debouncedNowPlayingDataHandler(e)}),subscribeState("o","progressBarData",e=>{var t,i,s,n,r,a;if(this.logger.log("ProgressBarData ",e),this._progressBarTimer&&(clearInterval(this._progressBarTimer),this._progressBarTimer=null),this.demoModeValue)this.updateProgressBarDemoData();else if(this.progressBarData=e,this.logger.log("Progressbar data: ",e),!this.demoModeValue&&this.progressBarData&&Object.keys(this.progressBarData).length>0){if(!this.progressBarData.ProgressBar&&this._progressBarContainer)return void(null==(t=this._progressBarContainer.classList)||t.add("ch5-hide-dis"));null==(i=this._progressBarContainer.classList)||i.remove("ch5-hide-dis"),this._progressStreamState=this.progressBarData.StreamState,this._progressBarTrackSec=this.progressBarData.TrackSec,this._progressBarElapsedSec=this.progressBarData.ElapsedSec,this._progressBarInput instanceof HTMLInputElement&&(this._progressBarInput.max=null==(s=this._progressBarTrackSec)?void 0:s.toString(),this._progressBarInput.value=null==(n=this._progressBarElapsedSec)?void 0:n.toString(),this._progressBarElapsedSec&&this._progressBarTrackSec&&this._progressBarTrackSec>0&&(this._progressBarInput.style.backgroundSize=this._progressBarElapsedSec/this._progressBarTrackSec*100+"% 100%")),"stopped"===(null==(r=this.nowPlayingData)?void 0:r.PlayerState)&&(this._progressBarTrackSec=0),this._currentTime.textContent=formatTime(this._progressBarElapsedSec),this._duration.textContent=formatTime(this._progressBarTrackSec-this._progressBarElapsedSec),"streaming"!==this.progressBarData.StreamState&&"playing"!==(null==(a=this.nowPlayingData)?void 0:a.PlayerState)||this.demoModeValue||(this._progressBarTimer=window.setInterval(()=>{var e,t,i;const s="playing"===(null==(e=this.nowPlayingData)?void 0:e.PlayerState),n="streaming"===(null==(t=this.progressBarData)?void 0:t.StreamState);if(!s&&!n)return clearInterval(this._progressBarTimer),void(this._progressBarTimer=null);if(this._progressBarElapsedSec<this._progressBarTrackSec){this._progressBarElapsedSec+=1;const e=this._progressBarTrackSec>0?this._progressBarElapsedSec/this._progressBarTrackSec*100:0;this._progressBarInput.value=null==(i=this._progressBarElapsedSec)?void 0:i.toString(),this._progressBarInput.style.backgroundSize=e+"% 100%",this._currentTime.textContent=formatTime(this._progressBarElapsedSec),this._duration.textContent=formatTime(this._progressBarTrackSec-this._progressBarElapsedSec)}else clearInterval(this._progressBarTimer),this._progressBarTimer=null},1e3))}}),subscribeState("s","receiveStatePlayerNameResp",e=>{this.updatePlayerName(e)})}logger;_nowPlayingContainer={};_nowPlayingPlayerContainer={};_nowPlayingPlayerLabel={};_nowPlayingImageParent={};_nowPlayingTrackInfo={};_nowPlayingSongTitle={};_nowPlayingArtist={};_nowPlayingAlbum={};_nowPlayingArtistAlbum={};_nowPlayingSongAdditionalInfo={};_nowPlayingPlayerIconContainer={};_nowPlayingPlayerIconImage={};_nowPlayingPlayerIconName={};_progressBarContainer={};_progressBarInput={};_currentTime={};_streamState={};_duration={};_actionButtonsContainer={};_moreActionButtonsContainer={};_nextAndPreviousSongContainer={};_nextSongLabel={};_nextSongText={};_transportControls={};musicPlayerLibInstance;nowPlayingData;progressBarData={StreamState:"",TrackSec:0,ElapsedSec:0,ProgressBar:!1};demoModeValue=!1;previousAlbumArtUrl;previousPlayerIconUrl;previousPlayerIcon;_nowPlayingPlayerNameContainer={};playerName="";NOW_PLAYING_ICONS=["mp-logo mp-logo-unknown","mp-logo mp-logo-xm-group","mp-logo mp-logo-sirius-xm-group","mp-logo mp-logo-am-fm-tuner","mp-logo mp-logo-crestron","mp-logo mp-logo-ipod","mp-logo mp-logo-internet-radio","mp-logo mp-logo-satelite","mp-logo mp-logo-pandora","mp-logo mp-logo-librivox","mp-logo mp-logo-spotify","mp-logo mp-logo-jukebox"];_separator={};_progressBarTimer=null;_progressBarElapsedSec=0;_progressBarTrackSec=0;_progressStreamState="";_progressBarInputHandler=null;getDataValue(e,t,i){if(this.nowPlayingData.hasOwnProperty(e))return this.nowPlayingData[e]??"";const s=i??t+1;return Array.isArray(this.nowPlayingData.TextLines)&&this.nowPlayingData.TextLines.length>=s?this.nowPlayingData.TextLines[t]??"":""}NOW_PLAYING_DEMO_DATA={ActionsAvailable:["Shuffle","Repeat","PlayAll","NextTrack","PreviousTrack","Seek","Ffwd","Rewind","Play","ThumbsDown","ThumbsUp"],Album:"Album Name",AlbumArt:!0,AlbumArtUrl:"",AlbumArtUrlNAT:"",Artist:"Artist Name",ElapsedSec:120,FfwdSpeed:1,Genre:"Genre",NextTitle:"Song Name Here",PlayerIcon:0,PlayerIconURL:"",PlayerName:"Player Name",PlayerState:"paused",ProgressBar:!0,ProviderName:"",RepeatState:0,RewindSpeed:1,ShuffleState:0,StationName:"4th line of text here",StreamState:"idle",Title:"Song Title",TrackCnt:5,TrackNum:2,TrackSec:280};updateProgressBarDemoData(){var e,t,i;this.progressBarData.ProgressBar=!0,null==(e=this._progressBarContainer.classList)||e.remove("ch5-hide-dis"),this._progressBarElapsedSec=this.NOW_PLAYING_DEMO_DATA.ElapsedSec,this._progressBarTrackSec=this.NOW_PLAYING_DEMO_DATA.TrackSec,this._streamState.textContent=this.NOW_PLAYING_DEMO_DATA.StreamState,this._currentTime.textContent=formatTime(this._progressBarElapsedSec),this._duration.textContent=formatTime(this._progressBarTrackSec-this._progressBarElapsedSec);const s=this._progressBarTrackSec>0?this._progressBarElapsedSec/this._progressBarTrackSec*100:0;this._progressBarInput.style.backgroundSize=s+"% 100%",this._progressBarInput.max=null==(t=this._progressBarTrackSec)?void 0:t.toString(),this._progressBarInput.value=null==(i=this._progressBarElapsedSec)?void 0:i.toString()}cleanup(){this._progressBarTimer&&(clearInterval(this._progressBarTimer),this._progressBarTimer=null),this._progressBarInput&&this._progressBarInputHandler&&(this._progressBarInput.removeEventListener("input",this._progressBarInputHandler),this._progressBarInputHandler=null)}handleDemoMode(e){e?(this._progressBarTimer&&(clearInterval(this._progressBarTimer),this._progressBarTimer=null),setTimeout(()=>{this.createNowPlaying(),this.nowPlayingData=this.NOW_PLAYING_DEMO_DATA,this.updatePlayerName(this.nowPlayingData.PlayerName),this.updatedNowPlayingContent(),this.updateProgressBarDemoData()},200)):(this.nowPlayingData="",this.createDefaultNowPlaying())}updatedNowPlayingContent(){var e,t,i,s,n,r,a,l,o;this._nowPlayingPlayerLabel.innerHTML=""===this.playerName?(this.nowPlayingData.PlayerName||this.nowPlayingData.ProviderName)??"":this.playerName,this._nowPlayingImageParent.classList.add("now-playing-image-container"),this._nowPlayingImageParent.classList.add("mp-fallback-album-art");const h=new Image,c=(null==(e=this.nowPlayingData.AlbumArtUrl)?void 0:e.trim())??"",u=(null==(t=this.nowPlayingData.AlbumArtUrlNAT)?void 0:t.trim())??"";if(c&&c!==this.previousAlbumArtUrl){const e=c;h.addEventListener("load",()=>{this._nowPlayingImageParent.style.backgroundImage=`url('${e}')`,this.previousAlbumArtUrl=e}),h.addEventListener("error",()=>{this.previousAlbumArtUrl&&this.previousAlbumArtUrl!==e||(this._nowPlayingImageParent.style.removeProperty("backgroundImage"),this.previousAlbumArtUrl=null)}),h.src=e}else if(u&&u!==this.previousAlbumArtUrl){const e=u;h.addEventListener("load",()=>{this._nowPlayingImageParent.style.backgroundImage=`url('${e}')`,this.previousAlbumArtUrl=e}),h.addEventListener("error",()=>{this.previousAlbumArtUrl&&this.previousAlbumArtUrl!==e||(this._nowPlayingImageParent.style.removeProperty("backgroundImage"),this.previousAlbumArtUrl=null)}),h.src=e}else c||u?!this.previousAlbumArtUrl||this._nowPlayingImageParent.style.backgroundImage&&""!==this._nowPlayingImageParent.style.backgroundImage||(this._nowPlayingImageParent.style.backgroundImage=`url('${this.previousAlbumArtUrl}')`):(this._nowPlayingImageParent.style.removeProperty("backgroundImage"),this.previousAlbumArtUrl=null);if(this._nowPlayingSongTitle.children&&this._nowPlayingSongTitle.children[0]){const e=this.getDataValue("Title",0);this._nowPlayingSongTitle.children[0].textContent=decodeString(e)}this.updateMarquee();const d=this.getDataValue("Artist",1);this._nowPlayingArtist.textContent=decodeString(d);const m=this.getDataValue("Album",2);this._nowPlayingAlbum.textContent=decodeString(m),(null==m?void 0:m.trim())&&(null==d?void 0:d.trim())?null==(s=this._separator.classList)||s.remove("ch5-hide-dis"):null==(i=this._separator.classList)||i.add("ch5-hide-dis");const g=this.getDataValue("StationName",3,5);this._nowPlayingSongAdditionalInfo.textContent=decodeString(g),this._nowPlayingPlayerIconImage.classList.add("now-playing-player-icon-image");const b=(null==(n=this.nowPlayingData.PlayerIconURL)?void 0:n.trim())??"",p=this.nowPlayingData.PlayerIcon,_=new Image;if(b&&b!==this.previousPlayerIconUrl){const e=b;_.addEventListener("load",()=>{this._nowPlayingPlayerIconImage.style.backgroundImage=`url('${e}')`,this.previousPlayerIconUrl=e,this.previousPlayerIcon=null}),_.addEventListener("error",()=>{this.previousPlayerIconUrl&&this.previousPlayerIconUrl!==e||(this._nowPlayingPlayerIconImage.style.removeProperty("backgroundImage"),this.previousPlayerIconUrl=null)}),_.src=e}else p&&!isNaN(p)&&p>0&&p<this.NOW_PLAYING_ICONS.length&&p!==this.previousPlayerIcon&&""===b?(null==(r=this._nowPlayingPlayerIconImage.classList)||r.remove(...Array.from(this._nowPlayingPlayerIconImage.classList)),this._nowPlayingPlayerIconImage.classList.add("now-playing-player-icon-image"),this._nowPlayingPlayerIconImage.style.removeProperty("backgroundImage"),this.NOW_PLAYING_ICONS[p]&&this._nowPlayingPlayerIconImage.classList.add(...this.NOW_PLAYING_ICONS[p].split(" ")),this.previousPlayerIcon=p,this.previousPlayerIconUrl=null):!b&&(!p||isNaN(p)||p<=0||p>=this.NOW_PLAYING_ICONS.length)?(this._nowPlayingPlayerIconImage.style.removeProperty("backgroundImage"),(this.nowPlayingData.ProviderName||this.nowPlayingData.PlayerName)&&this._nowPlayingPlayerIconImage.classList.add(...this.NOW_PLAYING_ICONS[0].split(" ")),this.previousPlayerIconUrl=null,this.previousPlayerIcon=null):this.previousPlayerIconUrl&&(!this._nowPlayingPlayerIconImage.style.backgroundImage||""===this._nowPlayingPlayerIconImage.style.backgroundImage&&""!==b)?this._nowPlayingPlayerIconImage.style.backgroundImage=`url('${this.previousPlayerIconUrl}')`:null===this.previousPlayerIcon||this._nowPlayingPlayerIconImage.style.backgroundImage&&""!==this._nowPlayingPlayerIconImage.style.backgroundImage||""===b||(null==(a=this._nowPlayingPlayerIconImage.classList)||a.remove(...Array.from(this._nowPlayingPlayerIconImage.classList)),this._nowPlayingPlayerIconImage.classList.add("now-playing-player-icon-image"),this.NOW_PLAYING_ICONS[this.previousPlayerIcon]&&""!==b&&this._nowPlayingPlayerIconImage.classList.add(...this.NOW_PLAYING_ICONS[this.previousPlayerIcon].split(" ")));const S=this.nowPlayingData.ProviderName||this.nowPlayingData.PlayerName;if(null==S?void 0:S.trim())this._nowPlayingPlayerIconName.textContent=decodeString(S);else{const e=this.getDataValue("ProviderName",4);this._nowPlayingPlayerIconName.textContent=decodeString(e||this.nowPlayingData.PlayerName)}this.nowPlayingData.hasOwnProperty("ActionsAvailable")&&!this.nowPlayingData.ActionsAvailable.includes("Seek")?(this._progressBarInput.classList.add("hide-progressbar-thumb"),this._progressBarInputHandler&&this._progressBarInput.removeEventListener("input",this._progressBarInputHandler)):(this._progressBarInput.classList.remove("hide-progressbar-thumb"),this._progressBarInputHandler||(this._progressBarInputHandler=this.handleProgressbarInput.bind(this)),this._progressBarInput.addEventListener("input",this._progressBarInputHandler)),this.renderActionButtons(this.nowPlayingData.ActionsAvailable,this.nowPlayingData.PlayerState),this.renderMoreActionButtons(this.nowPlayingData.ActionsAvailable,this.nowPlayingData.RepeatState,this.nowPlayingData.ShuffleState),this._nowPlayingContainer.appendChild(this._transportControls),this.renderNextAndPreviousSong(this.nowPlayingData.NextTitle),this.progressBarData.ProgressBar?null==(o=this._progressBarContainer.classList)||o.remove("ch5-hide-dis"):null==(l=this._progressBarContainer.classList)||l.add("ch5-hide-dis")}updatePlayerName(e){this.playerName=decodeString(e),this._nowPlayingPlayerLabel.innerHTML=decodeString(e)}updateMarquee(){var e,t,i;(null==(e=this._nowPlayingSongTitle.children&&this._nowPlayingSongTitle.children[0])?void 0:e.offsetWidth)>this._nowPlayingSongTitle.offsetWidth?null==(t=this._nowPlayingSongTitle.classList)||t.add("marquee-item"):null==(i=this._nowPlayingSongTitle.classList)||i.remove("marquee-item")}createInternalHtml(){return this._nowPlayingContainer}createDefaultNowPlaying(){this._nowPlayingContainer&&(this._nowPlayingContainer.className="",this._nowPlayingContainer.innerHTML=""),this._nowPlayingContainer.classList.add("ch5-media-player--now-playing-default");const e=createElement("div",["default-provider-container"],"No Content Provider"),t=createElement("div",["default-album-art-container"]),i=createElement("div",["default-track-info-container"]),s=createElement("div",[],"Not Playing"),n=createElement("div",[],"— —");i.append(s,n);const r=createElement("div",["default-progressbar-container"]),a=createElement("div",["progressbar-default"]),l=createElement("div",["progressbar-default-time"]),o=createElement("div",[],"— : — —");l.append(o,o.cloneNode(!0)),r.append(a,l);const h=createElement("div",["default-actions-container"]),c=new Ch5MediaPlayerIconButton;c.setAttribute("iconClass","mp-icon mp-fast-backward"),c.title="Default Backward ";const u=new Ch5MediaPlayerIconButton;u.setAttribute("iconClass","mp-icon mp-play"),u.title="Default Play";const d=new Ch5MediaPlayerIconButton;d.setAttribute("iconClass","mp-icon mp-fast-forward"),d.title="Default Forward",h.append(c,u,d),this._nowPlayingContainer.append(e,t,i,r,h)}createNowPlaying(){this._nowPlayingContainer&&(this._nowPlayingContainer.className="",this._nowPlayingContainer.innerHTML=""),this.logger.start("createInternalHtml()"),this._nowPlayingContainer.classList.add("ch5-media-player--now-playing"),this.renderProviderOrPlayer(),this.renderAlbumArt(),this.renderTrackInfo(),this._transportControls=createElement("div",["now-playing-controls-container"]),this.renderProgressBar(),this.renderActionButtons([],"paused"),this.renderMoreActionButtons([]),this._nowPlayingContainer.appendChild(this._transportControls),this.renderNextAndPreviousSong(""),this.logger.stop()}renderProviderOrPlayer(){this._nowPlayingPlayerContainer=createElement("div",["now-playing-player-container"]),this._nowPlayingPlayerNameContainer=createElement("div",["now-playing-player-name-container"]),this._nowPlayingPlayerLabel=createElement("div",["now-playing-player-label"]),this._nowPlayingPlayerNameContainer.appendChild(this._nowPlayingPlayerLabel),this._nowPlayingPlayerContainer.appendChild(this._nowPlayingPlayerNameContainer);const e=new Ch5MediaPlayerIconButton;e.setAttribute("iconClass","mp-icon mp-music-note-dbl"),e.title="My Music Section",e.classList.add("now-playing-player-music-note-button"),e.addEventListener("click",()=>{publishEvent("b","showMyMusicComponent",!0)}),this._nowPlayingPlayerContainer.appendChild(e),this._nowPlayingContainer.appendChild(this._nowPlayingPlayerContainer)}renderAlbumArt(){this._nowPlayingImageParent=createElement("div",["mp-fallback-album-art","now-playing-image"]),this._nowPlayingContainer.appendChild(this._nowPlayingImageParent)}renderTrackInfo(){this._nowPlayingTrackInfo=createElement("div",["now-playing-track-info"]),this._nowPlayingSongTitle=createElement("div",["now-playing-song-title"]);const e=createElement("span",[],"");this._nowPlayingSongTitle.appendChild(e),this._nowPlayingArtistAlbum=createElement("div",["now-playing-artist-album"]),this._nowPlayingArtist=createElement("span",["now-playing-artist-name"]),this._nowPlayingAlbum=createElement("span",["now-playing-album-name"]),this._separator=createElement("span",[]," — "),this._nowPlayingArtistAlbum.appendChild(this._nowPlayingArtist),this._nowPlayingArtistAlbum.appendChild(this._separator),this._nowPlayingArtistAlbum.appendChild(this._nowPlayingAlbum),this._nowPlayingSongAdditionalInfo=createElement("div",["now-playing-song-additional-info"]),this._nowPlayingPlayerIconContainer=createElement("div",["now-playing-player-icon-container"]),this._nowPlayingPlayerIconImage=createElement("div",["now-playing-player-icon-image"]),this._nowPlayingPlayerIconName=createElement("div",["now-playing-player-icon-name"]),this._nowPlayingPlayerIconContainer.appendChild(this._nowPlayingPlayerIconImage),this._nowPlayingPlayerIconContainer.appendChild(this._nowPlayingPlayerIconName),this._nowPlayingTrackInfo.appendChild(this._nowPlayingSongTitle),this._nowPlayingTrackInfo.appendChild(this._nowPlayingArtistAlbum),this._nowPlayingTrackInfo.appendChild(this._nowPlayingSongAdditionalInfo),this._nowPlayingTrackInfo.appendChild(this._nowPlayingPlayerIconContainer),this._nowPlayingContainer.appendChild(this._nowPlayingTrackInfo)}seekApiCall=debounce2(()=>{this.musicPlayerLibInstance.nowPlayingEvent("Seek",+this._progressBarInput.value)},150);renderProgressBar(){var e,t,i;this._progressBarContainer=createElement("div",["now-playing-progressbar-container"]),this._progressBarInput=document.createElement("input"),this._progressBarInput.type="range",this._progressBarInput.min="0",this._progressBarInput.max=this._progressBarTrackSec?this._progressBarTrackSec.toString():"0",this._progressBarInput.value=null==(e=this._progressBarElapsedSec)?void 0:e.toString(),this._progressBarElapsedSec&&this._progressBarTrackSec&&this._progressBarTrackSec>0&&(this._progressBarInput.style.backgroundSize=this._progressBarElapsedSec/this._progressBarTrackSec*100+"% 100%"),this._progressBarInput.classList.add("now-playing-progressbar-input"),this._progressBarContainer.appendChild(this._progressBarInput);const s=createElement("div",["now-playing-progressbar-current-time-duration-container"]);this._currentTime=createElement("span"),this._currentTime.textContent=formatTime(this._progressBarElapsedSec),s.appendChild(this._currentTime),this._streamState=createElement("span"),""!==this._progressStreamState?this._streamState.textContent=this._progressStreamState:"forwarding"===(null==(t=this.nowPlayingData)?void 0:t.PlayerState)&&(this._streamState.textContent=(null==(i=this.nowPlayingData)?void 0:i.FfwdSpeed)+"X"),s.appendChild(this._streamState),this._duration=createElement("span"),this._duration.textContent=formatTime(parseInt(this._progressBarInput.max)-parseInt(this._progressBarInput.value)),s.appendChild(this._duration),this._progressBarContainer.appendChild(s),this._progressBarInputHandler=this.handleProgressbarInput.bind(this),this._progressBarInput.addEventListener("input",this._progressBarInputHandler),this._transportControls.appendChild(this._progressBarContainer)}handleProgressbarInput=()=>{const e=parseInt(this._progressBarInput.max)||0,t=parseInt(this._progressBarInput.value)||0,i=e>0?t/e*100:0;this._progressBarInput.style.backgroundSize=i+"% 100%",this._currentTime.textContent=formatTime(t),this._duration.textContent=formatTime(e-t),this._progressBarElapsedSec=t,this.logger.log("_currentTime==",this._progressBarInput.value),this.seekApiCall()};renderActionButtons(e,t){Array.isArray(e)||(e=[]),this._actionButtonsContainer&&this._actionButtonsContainer.parentNode&&this._actionButtonsContainer.parentNode.removeChild(this._actionButtonsContainer),this._actionButtonsContainer=createElement("div",["now-playing-action-buttons-container"]);const i={ThumbsDown:{class:"mp-icon mp-thumbs-down"},PreviousTrack:{class:"mp-icon mp-skip-back"},Rewind:{class:"mp-icon mp-fast-backward"},Play:{class:"mp-icon mp-play"},Ffwd:{class:"mp-icon mp-fast-forward"},NextTrack:{class:"mp-icon mp-skip-forward"},ThumbsUp:{class:"mp-icon mp-thumbs-up"}};Object.keys(i).forEach(s=>{var n,r;const a=new Ch5MediaPlayerIconButton;a.title=s;const l=TCH5NowPlayingActions[s];"Play"===l?e.includes("Play")&&e.includes("Pause")&&"playing"!==t||"stopped"===t||void 0===t||e.includes("Play")&&"playing"!==t?(a.setAttribute("iconClass",i[l].class),a.onclick=()=>{this.musicPlayerLibInstance.nowPlayingEvent(l)}):(a.setAttribute("iconClass","mp-icon mp-pause"),a.title="Pause",a.onclick=()=>{this.musicPlayerLibInstance.nowPlayingEvent("Pause")}):(a.setAttribute("iconClass",i[l].class),a.onclick=()=>{this.musicPlayerLibInstance.nowPlayingEvent(l)}),e.includes(l)?(a.classList.remove("button-visibility"),"Play"===l&&a.removeAttribute("disableIconButton"),"ThumbsDown"!==l&&"ThumbsUp"!==l||(-1===(null==(n=this.nowPlayingData.Rating)?void 0:n.current)&&"ThumbsDown"===l||1===(null==(r=this.nowPlayingData.Rating)?void 0:r.current)&&"ThumbsUp"===l?a.classList.add("active"):a.classList.remove("active"))):"Play"===l?(a.classList.remove("button-visibility"),e.includes("Pause")||a.setAttribute("disableIconButton","true")):a.classList.add("button-visibility"),this._actionButtonsContainer.appendChild(a)}),this._transportControls.appendChild(this._actionButtonsContainer)}renderMoreActionButtons(e,t=2,i=1){this._moreActionButtonsContainer&&this._moreActionButtonsContainer.parentNode&&this._moreActionButtonsContainer.parentNode.removeChild(this._moreActionButtonsContainer),this._moreActionButtonsContainer=createElement("div",["now-playing-more-action-buttons-container"]),this._moreActionButtonsContainer.innerHTML="";const s={Shuffle:{class:0===i?"mp-icon mp-shuffle-off":"mp-icon mp-shuffle-02"},Repeat:{class:0===t?"mp-icon mp-repeat-off":1===t?"mp-icon mp-repeat-1x_1":"mp-icon mp-repeat-03"},PlayAll:{class:"mp-icon mp-play-multi-square"},MusicNote:{class:"mp-icon mp-music-note-plus"},UserNote:{class:"mp-icon mp-image-user-plus"}};Array.isArray(e)&&Object.keys(s).forEach(t=>{if(null==e?void 0:e.includes(t)){const e=new Ch5MediaPlayerIconButton;e.setAttribute("iconClass",s[t].class),e.title=t,e.onclick=()=>{this.musicPlayerLibInstance.nowPlayingEvent(TCH5NowPlayingActions[t])},this._moreActionButtonsContainer.appendChild(e)}}),this._transportControls.appendChild(this._moreActionButtonsContainer)}renderNextAndPreviousSong(e){if(this._nextAndPreviousSongContainer&&this._nextAndPreviousSongContainer.parentNode&&this._nextAndPreviousSongContainer.parentNode.removeChild(this._nextAndPreviousSongContainer),e){this._nextAndPreviousSongContainer=createElement("div",["now-playing-next-and-previous-song-container"]);const t=createElement("div",["now-playing-next-song-container"]);this._nextSongLabel=createElement("span",["now-playing-next-song-label"],"Next up"),t.appendChild(this._nextSongLabel),this._nextSongText=createElement("span",["now-playing-next-song-text"],decodeString(e)),t.appendChild(this._nextSongText),this._nextAndPreviousSongContainer.appendChild(t),this._nowPlayingContainer.appendChild(this._nextAndPreviousSongContainer)}}debouncedNowPlayingDataHandler=debounce2(e=>{if(this.logger.log("NowPlayingData ",e),!1===this.demoModeValue)if(e&&Object.keys(e).length>0){for(const t in e)"string"==typeof e[t]&&""===e[t].trim()&&delete e[t];this.nowPlayingData=e,this.createNowPlaying(),this.updatedNowPlayingContent()}else this.createDefaultNowPlaying()},100)},Ch5MediaPlayerMyMusic=class{constructor(e,t){this.logger=t,this.logger.start("constructor()","MEDIA_PLAYER:MY_MUSIC"),this.musicPlayerLibInstance=e,this._myMusicContainer=createElement("div"),this.createDefaultMyMusic(),subscribeState("o","myMusicData",e=>{this.logger.log("MyMusicData ",e),this.createMyMusic(),this.demoModeValue||(this.loadItemsCount=this.MAXIMUM_ROWS_TO_SHOW,e&&Object.keys(e).length>0?(this.myMusicData=e,this.logger.log("My Music Data",this.myMusicData),this.apiChanges()):this.createDefaultMyMusic())}),subscribeState("o","menuListData",e=>{this.menuListData=e,this.isLoadingMoreData=!1,this.logger.log("My Music Menu list Data: ",this.menuListData),this.menuListData&&this.menuListData.MenuData&&this.menuListData.MenuData.length<=this.musicPlayerLibInstance.maxReqItems&&(this.printedIndex=0),this.menuApiChanges()}),subscribeState("b","showMyMusicComponent",e=>{var t;e?(null==(t=this._myMusicContainer.parentElement)?void 0:t.classList.contains("portrait-mode-active"))&&this._myMusicContainer.classList.add("my-music-transition"):this._myMusicContainer&&this._myMusicContainer.classList.contains("my-music-transition")&&this._myMusicContainer.classList.remove("my-music-transition")})}logger;_myMusicContainer={};_myMusicHeaderSection={};_myMusicHeaderBackButton={};_myMusicHeaderTitle={};_myMusicHeaderTitleText={};_myMusicheaderSubtitle={};_myMusicContentSection={};_myMusicFooterSection={};_myMusicContentItem={};_myMusicContentItemTitle={};_myMusicContentItemSubtitle={};_myMusicHeaderNowPlayingButton={};myMusicData;menuListData;musicPlayerLibInstance;demoModeValue=!1;MAXIMUM_ROWS_TO_SHOW=40;loadItemsCount=40;printedIndex=0;scrollPosition=100;isLoadingMoreData=!1;MY_MUSIC_DEMO_DATA={Title:"HEADER TEXT",Subtitle:"SUBTITLE",IsMenuAvailable:!0,ListItemIcons:!0,ListSpecificFunctions:["Create","Find","QuickList","Advanced","BackToTop","Favorites"],Sorted:"none",ItemCnt:4};MY_MUSIC_MENU_DEMO_DATA={MenuData:[{L1:"Text Line 1",L2:"Sub Line 1"},{L1:"Text Line 2",L2:""},{L1:"Text Line 3",L2:"Sub Line 3"},{L1:"Text Line 4",L2:""}]};createInternalHtml(){return this._myMusicContainer}handleDemoMode(e){e?setTimeout(()=>{var e,t,i,s;this.createMyMusic(),this.myMusicData=this.MY_MUSIC_DEMO_DATA,this.menuListData=this.MY_MUSIC_MENU_DEMO_DATA,this.apiChanges(),this.menuApiChanges(),null==(t=null==(e=this._myMusicContentSection)?void 0:e.children[0])||t.classList.add("active"),null==(s=null==(i=this._myMusicFooterSection)?void 0:i.children[1])||s.classList.add("active")}):(this.myMusicData="",this.createDefaultMyMusic())}createDefaultMyMusic(){this._myMusicContainer&&(this._myMusicContainer.className="",this._myMusicContainer.innerHTML=""),this._myMusicContainer.classList.add("ch5-media-player--my-music-default");const e=createElement("div",["default-header-container"]),t=new Ch5MediaPlayerIconButton;t.setAttribute("iconClass","mp-icon mp-chevron-left"),t.title="Default Back";const i=createElement("div",["header-title-none"],"— —"),s=new Ch5MediaPlayerIconButton;s.setAttribute("iconClass","mp-logo mp-animated-bar"),s.title="Default Music",e.append(t,i,s);const n=createElement("div",["default-item-container"]),r=createElement("div",["default-item"],"No Content");n.append(r);const a=createElement("div",["default-footer-container"]),l=new Ch5MediaPlayerIconButton;l.setAttribute("iconClass","mp-icon mp-plus-circle"),l.title="Default Create";const o=new Ch5MediaPlayerIconButton;o.setAttribute("iconClass","mp-icon mp-search-lg"),o.title="Default Find",a.append(l,o),this._myMusicContainer.append(e,n,a)}createMyMusic(){if(this._myMusicContainer&&this._myMusicContainer.classList.contains("ch5-media-player--my-music-default")){for(;this._myMusicContainer.firstChild;)this._myMusicContainer.removeChild(this._myMusicContainer.firstChild);this._myMusicContainer.classList.contains("ch5-media-player--my-music-default")&&this._myMusicContainer.classList.remove("ch5-media-player--my-music-default"),this.logger.start("createInternalHtml()"),this._myMusicContainer.classList.add("ch5-media-player--my-music"),this._myMusicHeaderSection=createElement("div",["my-music-header"]),this._myMusicContentSection=createElement("div",["my-music-content"]);let e=0,t=!1;const i=()=>{var e,t;return(null==(t=null==(e=this.menuListData)?void 0:e.MenuData)?void 0:t.length)||0},s=()=>{var e;return(null==(e=this.musicPlayerLibInstance)?void 0:e.maxReqItems)||0},n=()=>{const n=this._myMusicContentSection.scrollTop||0,r=(this._myMusicContentSection.scrollHeight||0)-(n+(this._myMusicContentSection.clientHeight||window.innerHeight)),a=i(),l=s();if(n>e&&a>=this.loadItemsCount){if(r<=this.scrollPosition){const e=this._myMusicContentSection.firstElementChild;e&&this._myMusicContentSection.removeChild(e),this.createLine(this.loadItemsCount,"end"),this.loadItemsCount+=1}}else if(n<e&&this.loadItemsCount>this.MAXIMUM_ROWS_TO_SHOW&&n<=this.scrollPosition){const e=this._myMusicContentSection.children.length;e>=this.MAXIMUM_ROWS_TO_SHOW&&this._myMusicContentSection.removeChild(this._myMusicContentSection.children[e-1]),this.loadItemsCount-=1,this.createLine(this.loadItemsCount-this.MAXIMUM_ROWS_TO_SHOW,"start")}e=Math.max(n,0),a-1>l&&(a-1>this.printedIndex&&0===r?this._myMusicContentSection.scrollTop=Math.max(this._myMusicContentSection.scrollTop-this.scrollPosition,0):0===n&&this.loadItemsCount>this.MAXIMUM_ROWS_TO_SHOW&&(this._myMusicContentSection.scrollTop=this.scrollPosition)),t=!1},r=()=>{t||(t=!0,requestAnimationFrame(n))};this._myMusicContentSection.onscroll=r,this._myMusicFooterSection=createElement("div",["my-music-footer"]),this._myMusicContainer.append(this._myMusicHeaderSection,this._myMusicContentSection,this._myMusicFooterSection),this.logger.stop()}}createLine(e,t="end"){var i,s;if("first"!==t&&e+1>=(null==(i=this.menuListData.MenuData)?void 0:i.length)&&e+1>=this.musicPlayerLibInstance.maxReqItems&&!this.isLoadingMoreData&&(null==(s=this.menuListData.MenuData)?void 0:s.length)<this.myMusicData.ItemCnt&&(this.isLoadingMoreData=!0,this.musicPlayerLibInstance.getItemData(!0)),this.printedIndex=e,!this.menuListData.MenuData||!this.menuListData.MenuData[e])return;const n=this.menuListData.MenuData[e].L1,r=this.menuListData.MenuData[e].L2,a=this.menuListData.MenuData[e].Id;this._myMusicContentItem=createElement("div",["my-music-content-item"]),this._myMusicContentItem.id=a,this._myMusicContentItemTitle=createElement("div",["my-music-content-item-title"],decodeString(n)),this._myMusicContentItemSubtitle=createElement("div",["my-music-content-item-subtitle"],decodeString(r));let l=null,o=!1,h=0,c=0;const u=()=>{null!==l&&(clearTimeout(l),l=null)};this._myMusicContentItem.addEventListener("pointerdown",t=>{var i,s;o=!1,h=t.clientX,c=t.clientY;try{null==(s=(i=t.target).setPointerCapture)||s.call(i,t.pointerId)}catch{}u(),l=window.setTimeout(()=>{o=!0,l=null,this.musicPlayerLibInstance.myMusicEvent("PressAndHold",e+1)},2e3)}),this._myMusicContentItem.addEventListener("pointermove",e=>{var t,i;if(!l)return;const s=Math.abs(e.clientX-h),n=Math.abs(e.clientY-c);if(s>10||n>10){u();try{null==(i=(t=e.target).releasePointerCapture)||i.call(t,e.pointerId)}catch{}}}),this._myMusicContentItem.addEventListener("pointerup",e=>{var t,i;u();try{null==(i=(t=e.target).releasePointerCapture)||i.call(t,e.pointerId)}catch{}}),this._myMusicContentItem.addEventListener("pointercancel",e=>{var t,i;u();try{null==(i=(t=e.target).releasePointerCapture)||i.call(t,e.pointerId)}catch{}}),this._myMusicContentItem.addEventListener("click",()=>{o||this.musicPlayerLibInstance.myMusicEvent("Select",e+1)}),this._myMusicContentItem.appendChild(this._myMusicContentItemTitle),this._myMusicContentItem.appendChild(this._myMusicContentItemSubtitle);const d=this._myMusicContentSection;"start"===t?d.insertBefore(this._myMusicContentItem,d.firstChild):d.appendChild(this._myMusicContentItem)}myMusicHeader(e,t,i){var s,n;this._myMusicHeaderBackButton=new Ch5MediaPlayerIconButton,this._myMusicHeaderBackButton.setAttribute("iconClass","mp-icon mp-chevron-left"),this._myMusicHeaderBackButton.title="Previous Section",this._myMusicHeaderBackButton.classList.add("my-music-header-back-button"),this._myMusicHeaderBackButton.onclick=()=>{this.musicPlayerLibInstance.myMusicEvent("Back")},e?this._myMusicHeaderBackButton.classList.remove("button-visibility"):this._myMusicHeaderBackButton.classList.add("button-visibility"),this._myMusicHeaderSection.prepend(this._myMusicHeaderBackButton),this._myMusicHeaderTitle=createElement("div",["my-music-header-title"]),this._myMusicHeaderTitleText=createElement("div",["my-music-header-title-text"],decodeString(t)),this._myMusicheaderSubtitle=createElement("div",["my-music-header-subtitle"],decodeString(i)),i?null==(s=this._myMusicheaderSubtitle.classList)||s.remove("ch5-hide-vis"):null==(n=this._myMusicheaderSubtitle.classList)||n.add("ch5-hide-vis"),this._myMusicHeaderTitle.append(this._myMusicHeaderTitleText,this._myMusicheaderSubtitle),this._myMusicHeaderNowPlayingButton=new Ch5MediaPlayerIconButton,this._myMusicHeaderNowPlayingButton.setAttribute("iconClass","mp-logo mp-animated-bar"),this._myMusicHeaderNowPlayingButton.title="Back to Now Playing",this._myMusicHeaderNowPlayingButton.classList.add("my-music-header-now-playing-button"),this._myMusicHeaderNowPlayingButton.addEventListener("click",()=>{publishEvent("b","showMyMusicComponent",!1)}),this._myMusicHeaderSection.append(this._myMusicHeaderTitle,this._myMusicHeaderNowPlayingButton)}myMusicMenuIconSection(e){const t=[{class:"mp-icon mp-plus-circle",name:"Create"},{class:"mp-icon mp-search-lg",name:"Find"},{class:"mp-icon mp-music-note-list",name:"QuickList"},{class:"mp-icon mp-settings",name:"Advanced"},{class:"mp-icon mp-music-list-home",name:"BackToTop"},{class:"mp-icon mp-music-list-favorites",name:"Favorites"},{class:"mp-icon mp-play-multi-square",name:"PlayAll"}];(null==e?void 0:e.length)&&t.forEach(t=>{for(let i=0;i<e.length;i++){const s=e[i];if(s===t.name){const e=new Ch5MediaPlayerIconButton;e.setAttribute("iconClass",t.class),e.title=t.name,e.id=s,e.onclick=()=>{if("Find"===s){publishEvent("o","PopUpMessageData",{userInputRequired:"alphanumeric",text:"Search",textForItems:["Find","Cancel"],initialUserInput:"",timeoutSec:0,show:!0,localExit:!1})}else this.musicPlayerLibInstance.myMusicEvent(s)},this._myMusicFooterSection.appendChild(e)}}})}apiChanges(){Array.from(this._myMusicHeaderSection.childNodes).forEach(e=>e.remove()),Array.from(this._myMusicFooterSection.childNodes).forEach(e=>e.remove());const e=""===this.myMusicData.IsMenuAvailable?this.myMusicData.Level>1:this.myMusicData.IsMenuAvailable;this.myMusicHeader(e,this.myMusicData.Title,this.myMusicData.Subtitle),this.myMusicMenuIconSection(this.myMusicData.ListSpecificFunctions)}menuApiChanges(){var e;const t=((null==(e=this.menuListData)?void 0:e.MenuData)??[]).length;if(t<=this.musicPlayerLibInstance.maxReqItems){this.loadItemsCount=Math.min(t,this.MAXIMUM_ROWS_TO_SHOW),Array.from(this._myMusicContentSection.childNodes).forEach(e=>e.remove());for(let e=0;e<t;e++)this.createLine(e,"first")}t>this.MAXIMUM_ROWS_TO_SHOW&&t>this.musicPlayerLibInstance.maxReqItems&&(this._myMusicContentSection.scrollTop-=this.scrollPosition)}};import _28 from"lodash";var MusicPlayerLib=class{constructor(e){this.logger=e}logger;mpSigRPCOut="";mpRPCDataIn="";itemValue=1;resendRegistrationTimeId=null;tempResponse="";ignoreFirstData=!1;subReceiveStateRefreshMediaPlayerResp;subReceiveStateDeviceOfflineResp;subReceiveStateCRPCResp;subReceiveStateMessageResp;subSendEventCRPCJoinNo;subControlSystemsOnlineFB;naxDeviceOfflineFlag=!1;totalItemCountCheck=0;generateStrongCustomId=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)});myMP={tag:"",source:0,connectionActive:!1,RegistrationId:0,ObjectsId:0,PropertiesSupportedId:0,MenuId:0,TitleMenuId:0,TitleId:0,ItemDataId:0,PlayId:0,PauseId:0,SeekId:0,instanceName:"",menuInstanceName:""};nowPlayingPublishData={};myMusicPublishData={};progressBarPublishData={};menuListPublishData={MenuData:[]};maxReqItems=40;lastPerformedAction=null;nowPlayingData={ActionsSupported:"",ActionsAvailable:"",RewindSpeed:"",FfwdSpeed:"",ProviderName:"",PlayerState:"",PlayerIcon:"",PlayerIconURL:"",PlayerName:"",Album:"",AlbumArt:"",AlbumArtUrl:"",AlbumArtUrlNAT:"",StationName:"",Genre:"",Artist:"",Title:"",TrackNum:"",TrackCnt:"",NextTitle:"",ShuffleState:"",RepeatState:"",Rating:{},TextLines:[]};progressBarData={StreamState:"",ProgressBar:"",ElapsedSec:"",TrackSec:""};myMusicData={Title:"",Subtitle:"",ListSpecificFunctions:"",ItemCnt:0,MaxReqItems:"",IsMenuAvailable:"",Level:""};menuListData={MenuData:[]};debounce=(e,t)=>{let i;return function(...s){window.clearTimeout(i),i=window.setTimeout(()=>{window.clearTimeout(i),e(...s)},t)}};subscribeLibrarySignals(){this.ignoreFirstData=!1,this.subReceiveStateRefreshMediaPlayerResp=subscribeState("b","digital_receiveStateRefreshMediaPlayerResp",e=>{if(e){publishEvent("o","PopUpMessageData",{userInputRequired:"",text:"",textForItems:[],initialUserInput:"",timeoutSec:1e4,show:!1}),this.refreshMediaPlayer()}}),this.subReceiveStateDeviceOfflineResp=subscribeState("b","digital_receiveStateDeviceOfflineResp",e=>{this.myMP.connectionActive=!e;const t={userInputRequired:"",text:"No Communication. Please check power and connection.",textForItems:[],initialUserInput:"",timeoutSec:1e4,show:!0};e?(this.unregisterWithDevice(!0),this.naxDeviceOfflineFlag=!0):(t.text="",t.show=!1,this.myMP.instanceName&&this.myMP.menuInstanceName&&this.myMP.connectionActive&&this.naxDeviceOnline()),publishEvent("o","PopUpMessageData",t)}),this.subReceiveStateCRPCResp=subscribeState("s","serial_receiveStateCRPCResp",e=>{if(e.length>0&&!_28.isEqual(this.tempResponse,e)&&this.ignoreFirstData){this.tempResponse=e;const t=e.substring(0,8).trim();if("c"===t[3])this.mpRPCDataIn=this.mpRPCDataIn+e.substring(8);else if("e"===t[3]){""===this.mpRPCDataIn.trim()?this.mpRPCDataIn=e.substring(8):this.mpRPCDataIn=this.mpRPCDataIn+e.substring(8),this.tempResponse="";let t="";try{t=JSON.parse(this.mpRPCDataIn),t.error?this.handleError(t.error):this.processCRPCResponse(t)}catch(e){this.logger.log("e",e)}this.mpRPCDataIn=""}}}),this.subReceiveStateMessageResp=subscribeState("s","serial_receiveStateMessageResp",e=>{e.length>0&&this.processMessage(e)}),this.subSendEventCRPCJoinNo=subscribeState("s","serial_sendEventCRPCJoinNo",e=>{this.mpSigRPCOut=e}),this.subControlSystemsOnlineFB=subscribeState("b","Csig.All_Control_Systems_Online_fb",e=>{if(e){const e=subscribeState("s","serial_receiveStateMessageResp",t=>{t.length>0&&(this.clearAllDataObjects(),this.resetMp(),this.processMessage(t,!0),setTimeout(()=>{unsubscribeState("b","receiveStateMessageResp",e)},100))})}})}clearAllDataObjects(){this.resendRegistrationTimeId&&(clearInterval(this.resendRegistrationTimeId),this.resendRegistrationTimeId=null),this.myMusicPublishData={},this.nowPlayingPublishData={},this.progressBarPublishData={},this.menuListPublishData={},this.itemValue=1,this.totalItemCountCheck=0,publishEvent("o","myMusicData",this.myMusicPublishData),publishEvent("o","nowPlayingData",this.nowPlayingPublishData),publishEvent("o","progressBarData",this.progressBarPublishData),publishEvent("o","menuListData",this.menuListPublishData)}refreshMediaPlayer(){this.myMP.connectionActive&&!this.naxDeviceOfflineFlag&&this.unregisterWithDevice(),this.myMP.tag&&this.myMP.connectionActive&&!this.naxDeviceOfflineFlag&&this.debouncedRegisterWithDevice()}generateUniqueMessageId(){const e=(new Date).getTime().toString().slice(-3),t=Math.floor(100*Math.random()).toString().padStart(3,"0");return Number(`${e}${t}`)}generateRPCPrefixForFinalMessage(e){return"2"+this.myMP.tag+"e"+this.getStringLengthInHexFixed(e)}generateRPCPrefixForPartialMessage(e){return"2"+this.myMP.tag+"c"+this.getStringLengthInHexFixed(e)}getStringLengthInHexFixed(e){return e.length.toString(16).padStart(4,"0")}startRegistrationResendTimer(){this.resendRegistrationTimeId&&clearInterval(this.resendRegistrationTimeId),this.resendRegistrationTimeId=setInterval(()=>{this.registerWithDevice()},1e4)}processMessage(e,t=!1){const i=JSON.parse(e);i.hasOwnProperty("tag")&&(this.myMP.tag=i.tag),i.hasOwnProperty("src")&&(t?this.debouncedRegisterWithDevice():this.myMP.source!=i.src&&this.refreshMediaPlayer(),this.myMP.source=i.src)}processGetObjectsResponse(e){e.result.objects.object.forEach(e=>{e.interfaces.includes("IMediaPlayer")&&(this.myMP.instanceName=e.instancename?e.instancename:e.instanceName)}),this.registerEvent(),this.getPropertiesSupported(this.myMP.instanceName),this.getMenu(this.myMP.instanceName),["BusyChanged","StatusMsgChanged","StateChangedByBrowseContext","StateChanged"].forEach(e=>{const t={params:{ev:e,handle:"ch5"},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.instanceName+".RegisterEvent"};this.myMP[e+"Id"]=t.id,this.myMP.instanceName&&this.sendRPCRequest(JSON.stringify(t))})}processPropertiesSupportedResponse(e){e.result.PropertiesSupported.forEach(e=>{if("PropertiesSupported"!==e){const t={params:{propName:e},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.instanceName+".GetProperty"};this.myMP[e+"Id"]=t.id,this.myMP.instanceName&&this.sendRPCRequest(JSON.stringify(t))}}),this.naxDeviceOfflineFlag=!1}processMenuResponse(e){this.myMP.menuInstanceName=e.result.instanceName,["Reset","BusyChanged","ClearChanged","ListChanged","StateChanged","StatusMsgMenuChanged"].forEach(e=>{const t={params:{ev:e,handle:"ch5"},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".RegisterEvent"};"Reset"===e&&(t.params=null,t.method=this.myMP.menuInstanceName+".Reset"),this.myMP.menuInstanceName&&this.sendRPCRequest(JSON.stringify(t))}),["Version","MaxReqItems","Level","ItemCnt","Title","Subtitle","ListSpecificFunctions","IsMenuAvailable","StatusMsgMenu","Instance"].forEach(e=>{const t={params:{propName:e},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".GetProperty"};"Title"===e&&(this.myMP[e+"MenuId"]=t.id),this.myMP.menuInstanceName&&this.sendRPCRequest(JSON.stringify(t))})}unregisterWithDevice(e=!1){this.myMP.instanceName&&this.myMP.menuInstanceName&&(["BusyChanged","StatusMsgChanged","StateChangedByBrowseContext","StateChanged"].forEach(e=>{const t={params:{ev:e,handle:"ch5"},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.instanceName+".DeregisterEvent"};this.sendRPCRequest(JSON.stringify(t))}),["BusyChanged","ClearChanged","ListChanged","StateChanged","StatusMsgMenuChanged"].forEach(e=>{const t={params:{ev:e,handle:"ch5"},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".DeregisterEvent"};this.sendRPCRequest(JSON.stringify(t))}),e||(this.clearAllDataObjects(),this.resetMp(e)))}naxDeviceOnline(){this.getPropertiesSupported(this.myMP.instanceName),["BusyChanged","ClearChanged","ListChanged","StateChanged","StatusMsgMenuChanged"].forEach(e=>{const t={params:{ev:e,handle:"ch5"},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".RegisterEvent"};this.myMP.menuInstanceName&&this.sendRPCRequest(JSON.stringify(t))}),["Version","MaxReqItems","Level","ItemCnt","Title","Subtitle","ListSpecificFunctions","IsMenuAvailable","StatusMsgMenu","Instance"].forEach(e=>{const t={params:{propName:e},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".GetProperty"};"Title"===e&&(this.myMP[e+"MenuId"]=t.id),this.myMP.menuInstanceName&&this.sendRPCRequest(JSON.stringify(t))})}registerWithDevice(){const e={encoding:"UTF-8",uuid:this.generateStrongCustomId(),ver:"1.0",maxPacketSize:65535,type:"symbol/json-rpc",format:"JSON",name:"CH5_v2.15"},t={jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:"Crpc.Register",params:e};this.myMP.RegistrationId=t.id,this.ignoreFirstData=!0,this.sendRPCRequest(JSON.stringify(t)),this.resendRegistrationTimeId||this.startRegistrationResendTimer()}debouncedRegisterWithDevice=this.debounce(()=>{this.registerWithDevice()},50);getObjects(){const e={jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:"Crpc.GetObjects"};this.myMP.ObjectsId=e.id,this.sendRPCRequest(JSON.stringify(e))}registerEvent(){const e={jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:"Crpc.RegisterEvent",params:{ev:"ObjectDirectoryChanged",handle:"ch5"}};this.sendRPCRequest(JSON.stringify(e))}getPropertiesSupported(e){const t={params:{propName:"PropertiesSupported"},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:e+".GetProperty"};this.myMP.PropertiesSupportedId=t.id,this.sendRPCRequest(JSON.stringify(t))}getMenu(e){const t={params:{uuid:this.generateStrongCustomId()},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:e+".GetMenu"};this.myMP.MenuId=t.id,e&&this.sendRPCRequest(JSON.stringify(t))}getItemData(e=!1){e||(this.itemValue=1,this.menuListData.MenuData=[]);let t=this.myMusicData.ItemCnt,i=0;if(t&&(i=t<this.maxReqItems?t:this.maxReqItems),t-=i,i>0){const e={params:{item:this.itemValue,count:i},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".GetData"};this.myMP.ItemDataId=e.id,this.myMP.menuInstanceName&&this.sendRPCRequest(JSON.stringify(e)),this.itemValue=this.itemValue+this.maxReqItems}else this.menuListData.MenuData=[],this.menuListPublishData={...this.menuListData},publishEvent("o","menuListData",this.menuListPublishData)}sendRPCRequest(e){let t="",i="";const s=100,n=Math.ceil(e.length/s);for(let r=0;r<n;r++)r===n-1?(i=e.substring(s*r),t=this.generateRPCPrefixForFinalMessage(i),i=t+i):(i=e.substring(s*r,s*r+s),t=this.generateRPCPrefixForPartialMessage(i),i=t+i),this.mpSigRPCOut&&(this.logger.log("CRPC send join:"+this.mpSigRPCOut+" "+i),publishEvent("s",this.mpSigRPCOut,i))}processCRPCResponse(e){var t,i,s,n,r,a,l,o,h,c,u,d,m,g,b,p,_,S,C,v,E;const f=e,A=f.id;let T={};const O=(null==(t=this.myMP)?void 0:t.instanceName)+".Event",y=(null==(i=this.myMP)?void 0:i.menuInstanceName)+".Event";if(O!==f.method&&y!==f.method||"BusyChanged"!==f.params.ev||!(null==(s=f.params)?void 0:s.parameters))if(O===f.method&&"StateChanged"===f.params.ev&&(null==(o=f.params)?void 0:o.parameters))for(const e in f.params.parameters)"ElapsedSec"===e||"TrackSec"===e||"StreamState"===e||"ProgressBar"===e?this.progressBarData[e]=null==(h=f.params)?void 0:h.parameters[e]:this.nowPlayingData[e]=null==(c=f.params)?void 0:c.parameters[e];else if(y===f.method&&"StateChanged"===f.params.ev&&(null==(u=f.params)?void 0:u.parameters)){(null==(d=f.params)?void 0:d.parameters.hasOwnProperty("Title"))&&(this.myMusicData.ItemCnt=null==(m=f.params)?void 0:m.parameters.ItemCnt,this.updatedMenuData());for(const e in null==(g=f.params)?void 0:g.parameters)this.myMusicData.hasOwnProperty(e)&&(this.myMusicData[e]=null==(b=f.params)?void 0:b.parameters[e])}else if(O!==f.method&&y!==f.method||"StatusMsgMenuChanged"!==(null==(p=null==f?void 0:f.params)?void 0:p.ev)&&"StatusMsgChanged"!==(null==(_=null==f?void 0:f.params)?void 0:_.ev)&&"StatusMsgMenu"!==(null==(S=null==f?void 0:f.params)?void 0:S.ev)||!(null==(C=f.params)?void 0:C.parameters)){if(A===this.myMP.PlayId||A===this.myMP.PauseId||A===this.myMP.SeekId)this.callTrackTime();else if(A==this.myMP.RegistrationId)clearInterval(this.resendRegistrationTimeId),this.myMP.connectionActive=!0,this.getObjects();else if(A==this.myMP.ObjectsId)this.processGetObjectsResponse(f);else if(A==this.myMP.PropertiesSupportedId)this.processPropertiesSupportedResponse(f);else if(A==this.myMP.MenuId)this.processMenuResponse(f);else if(A===this.myMP.ItemDataId)this.myMP.ItemDataId=0,this.menuListData.MenuData=[...this.menuListData.MenuData,...f.result],T&&!0===T.on||_28.isEqual(this.menuListPublishData,this.menuListData)||(this.menuListPublishData={...this.menuListData},publishEvent("o","menuListData",this.menuListPublishData));else if(f.result&&1===(null==(E=Object.keys(f.result))?void 0:E.length)){const e=Object.values(f.result)[0],t=Object.keys(f.result)[0];A===this.myMP.TitleMenuId?this.myMusicData[t]=e:A===this.myMP.TitleId||"Title"!==t&&this.nowPlayingData.hasOwnProperty(t)?this.nowPlayingData[t]=e:this.progressBarData.hasOwnProperty(t)?this.progressBarData[t]=e:"Title"!==t&&this.myMusicData.hasOwnProperty(t)&&(this.myMusicData[t]=e,"ItemCnt"===t&&this.totalItemCountCheck!==this.myMusicData[t]&&(this.totalItemCountCheck=this.myMusicData[t],this.getItemData()))}}else publishEvent("o","PopUpMessageData",(null==(v=f.params)?void 0:v.parameters)?f.params.parameters:{});else T={timeoutSec:null==(r=null==(n=f.params)?void 0:n.parameters)?void 0:r.timeoutSec,on:null==(l=null==(a=f.params)?void 0:a.parameters)?void 0:l.on},this.lastPerformedAction||publishEvent("o","busyChanged",T);T&&!0===T.on||(_28.isEqual(this.nowPlayingPublishData,this.nowPlayingData)||(this.nowPlayingPublishData={...this.nowPlayingData},publishEvent("o","nowPlayingData",this.nowPlayingPublishData)),_28.isEqual(this.myMusicPublishData,this.myMusicData)||(this.myMusicPublishData={...this.myMusicData},publishEvent("o","myMusicData",this.myMusicPublishData)),_28.isEqual(this.progressBarPublishData,this.progressBarData)||(this.progressBarPublishData={...this.progressBarData},publishEvent("o","progressBarData",this.progressBarPublishData)))}handleError(e){this.logger.error("Error Code:---- ",e.code),this.logger.error("Error message:---- ",e.message),this.logger.error("Error Data:---- ",e.data)}nowPlayingEvent(e,t=0){this.lastPerformedAction=e;const i={params:"Seek"===e?{time:t}:null,jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.instanceName+"."+e};this.myMP[e+"Id"]=i.id,this.sendRPCRequest(JSON.stringify(i))}myMusicEvent(e,t=0){this.totalItemCountCheck=0,this.lastPerformedAction=null;const i={params:0===t?null:{item:t},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+"."+e};this.sendRPCRequest(JSON.stringify(i))}callTrackTime(){["ElapsedSec","TrackSec"].forEach(e=>{const t={params:{propName:e},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.instanceName+".GetProperty"};this.myMP.instanceName&&this.sendRPCRequest(JSON.stringify(t))})}updatedMenuData(){["ListSpecificFunctions","StatusMsgMenu","Instance","TransactionId","ItemCnt"].forEach(e=>{const t={params:{propName:e},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".GetProperty"};this.myMP.menuInstanceName&&this.sendRPCRequest(JSON.stringify(t))})}popUpAction(e="",t=0){this.lastPerformedAction=null;const i={params:{localExit:t<0,state:t<0?0:1,id:t,userInput:e?encodeString(e):""},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".StatusMsgResponseMenu"};if(999===t&&this.myMP.menuInstanceName){const t={params:{query:e},jsonrpc:"2.0",id:this.generateUniqueMessageId(),method:this.myMP.menuInstanceName+".Find"};this.sendRPCRequest(JSON.stringify(t))}else this.myMP.menuInstanceName&&this.sendRPCRequest(JSON.stringify(i))}unsubscribeLibrarySignals(){this.resendRegistrationTimeId&&(clearInterval(this.resendRegistrationTimeId),this.resendRegistrationTimeId=null),unsubscribeState("b","digital_receiveStateRefreshMediaPlayerResp",this.subReceiveStateRefreshMediaPlayerResp),unsubscribeState("b","digital_receiveStateDeviceOfflineResp",this.subReceiveStateDeviceOfflineResp),unsubscribeState("s","serial_receiveStateCRPCResp",this.subReceiveStateCRPCResp),unsubscribeState("s","serial_receiveStateMessageResp",this.subReceiveStateMessageResp),unsubscribeState("s","serial_sendEventCRPCJoinNo",this.subSendEventCRPCJoinNo),unsubscribeState("b","Csig.All_Control_Systems_Online_fb",this.subControlSystemsOnlineFB),this.menuListPublishData={MenuData:[]},this.nowPlayingPublishData={},this.myMusicPublishData={},this.progressBarPublishData={},this.clearAllDataObjects(),this.totalItemCountCheck=0,this.resetMp()}resetMp(e=!1){this.myMP=e?{tag:this.myMP.tag,source:this.myMP.source,connectionActive:!1,RegistrationId:0,ObjectsId:0,PropertiesSupportedId:0,MenuId:0,TitleMenuId:0,TitleId:0,ItemDataId:0,PlayId:0,PauseId:0,SeekId:0,instanceName:"",menuInstanceName:""}:{tag:"",source:0,connectionActive:!0,RegistrationId:0,ObjectsId:0,PropertiesSupportedId:0,MenuId:0,TitleMenuId:0,TitleId:0,ItemDataId:0,PlayId:0,PauseId:0,SeekId:0,instanceName:"",menuInstanceName:""},this.nowPlayingData={ActionsSupported:"",ActionsAvailable:"",RewindSpeed:"",FfwdSpeed:"",ProviderName:"",PlayerState:"",PlayerIcon:"",PlayerIconURL:"",PlayerName:"",Album:"",AlbumArt:"",AlbumArtUrl:"",AlbumArtUrlNAT:"",StationName:"",Genre:"",Artist:"",Title:"",TrackNum:"",TrackCnt:"",NextTitle:"",ShuffleState:"",RepeatState:"",Rating:{},TextLines:[]},this.progressBarData={StreamState:"",ProgressBar:"",ElapsedSec:"",TrackSec:""},this.myMusicData={Title:"",Subtitle:"",ListSpecificFunctions:"",ItemCnt:0,MaxReqItems:"",IsMenuAvailable:"",Level:""},this.menuListData={MenuData:[]},this.totalItemCountCheck=0}},Ch5MediaPlayer=class e extends Ch5Common{busyChanged;popUpData;signalNameOnContract={contractName:"",receiveStateEnable:"",receiveStateShow:"",receiveStateCustomClass:"",receiveStateCustomStyle:"",receiveStateCRPC:"",sendEventCRPC:"",receiveStateMessage:"",receiveStateRefreshMediaPlayer:"",receiveStateDeviceOffline:"",receiveStatePlayerName:""};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatecrpc:{direction:"state",stringJoin:1,contractName:!0},sendeventcrpc:{direction:"event",stringJoin:1,contractName:!0},receivestatemessage:{direction:"state",stringJoin:1,contractName:!0},receivestaterefreshmediaplayer:{direction:"state",booleanJoin:1,contractName:!0},receivestatedeviceoffline:{direction:"state",booleanJoin:1,contractName:!0},receivestateplayername:{direction:"state",stringJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:!1,name:"demoMode",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",name:"contractName",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateCRPC",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventCRPC",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateMessage",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateRefreshMediaPlayer",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateDeviceOffline",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStatePlayerName",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"useContractForShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomStyle",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomClass",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];static ELEMENT_NAME="ch5-media-player";primaryCssClass="ch5-media-player";musicPlayerLibInstance;_ch5Properties;_elContainer={};nowPlaying=null;myMusic=null;_elMask={};_elGenericDialogContent={};_elMaskdialogTitle={};_dialogFooter={};_loadingIndicator={};_dialogAutoCloseTimeout=null;_demoPlusEl=null;_demoPlusHandler=null;_demoFavoritesEl=null;_demoFavoritesHandler=null;_subBusyChanged=null;_subPopUpMessageData=null;set demoMode(e){this._ch5Properties.set("demoMode",e,()=>{this.handleDemoMode()})}get demoMode(){return this._ch5Properties.get("demoMode")}set contractName(e){this._ch5Properties.set("contractName",e,()=>{this.handleContractName()})}get contractName(){return this._ch5Properties.get("contractName")}set useContractForEnable(e){this._ch5Properties.set("useContractForEnable",e,()=>{this.contractDefaultHelper()})}get useContractForEnable(){return this._ch5Properties.get("useContractForEnable")}set useContractForShow(e){this._ch5Properties.set("useContractForShow",e,()=>{this.contractDefaultHelper()})}get useContractForShow(){return this._ch5Properties.get("useContractForShow")}set useContractForCustomStyle(e){this._ch5Properties.set("useContractForCustomStyle",e,()=>{this.contractDefaultHelper()})}get useContractForCustomStyle(){return this._ch5Properties.get("useContractForCustomStyle")}set useContractForCustomClass(e){this._ch5Properties.set("useContractForCustomClass",e,()=>{this.contractDefaultHelper()})}get useContractForCustomClass(){return this._ch5Properties.get("useContractForCustomClass")}set receiveStateCRPC(e){this._ch5Properties.set("receiveStateCRPC",e,null,e=>{this.logger.log("CRCP In join: "+this.receiveStateCRPC+" "+e),this.publishMPEvent("s","serial_receiveStateCRPCResp",e)})}get receiveStateCRPC(){return this._ch5Properties.get("receiveStateCRPC")}set sendEventCRPC(e){this._ch5Properties.set("sendEventCRPC",e),this.publishMPEvent("s","serial_sendEventCRPCJoinNo",this.sendEventCRPC)}get sendEventCRPC(){return this._ch5Properties.get("sendEventCRPC")}set receiveStateMessage(e){this._ch5Properties.set("receiveStateMessage",e,null,e=>{this.logger.log("Source and Tag value",e),this.publishMPEvent("s","serial_receiveStateMessageResp",e)})}get receiveStateMessage(){return this._ch5Properties.get("receiveStateMessage")}set receiveStateRefreshMediaPlayer(e){this._ch5Properties.set("receiveStateRefreshMediaPlayer",e,null,e=>{this.publishMPEvent("b","digital_receiveStateRefreshMediaPlayerResp",e)})}get receiveStateRefreshMediaPlayer(){return this._ch5Properties.get("receiveStateRefreshMediaPlayer")}set receiveStateDeviceOffline(e){this._ch5Properties.set("receiveStateDeviceOffline",e,null,e=>{this.publishMPEvent("b","digital_receiveStateDeviceOfflineResp",e)})}get receiveStateDeviceOffline(){return this._ch5Properties.get("receiveStateDeviceOffline")}set receiveStatePlayerName(e){this._ch5Properties.set("receiveStatePlayerName",e,null,e=>{this.publishMPEvent("s","receiveStatePlayerNameResp",e)})}get receiveStatePlayerName(){return this._ch5Properties.get("receiveStatePlayerName")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.musicPlayerLibInstance=new MusicPlayerLib(this.logger),this.ignoreAttributes=["appendclasswheninviewport","receivestateshowpulse","receivestatehidepulse","sendeventonshow"],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass(),this._subBusyChanged=subscribeState("o","busyChanged",e=>{this.debouncedBusyChangedHandler(e)})}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-media-player attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5MediaPlayer),this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-media-player"),this.appendChild(this._elContainer)),this.addMusicTransition(),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.handleDemoMode(),customElements.whenDefined("ch5-media-player").then(()=>{this.musicPlayerLibInstance.subscribeLibrarySignals(),this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this._subPopUpMessageData=subscribeState("o","PopUpMessageData",e=>{this.popUpData=e,this.logger.log("Popup Data",this.popUpData),this._elMask&&this._elMask.parentNode&&this._elMask.parentNode.removeChild(this._elMask),this.popUpData&&this.popUpData.show?this.genericDialog(this.popUpData.userInputRequired,this.popUpData.text,this.popUpData.textForItems,this.popUpData.initialUserInput,this.popUpData.timeoutSec):this._elMask&&this._elMask.parentNode&&this._elMask.parentNode.removeChild(this._elMask)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.musicPlayerLibInstance.unsubscribeLibrarySignals(),this.nowPlaying&&this.nowPlaying.cleanup(),this._dialogAutoCloseTimeout&&(clearTimeout(this._dialogAutoCloseTimeout),this._dialogAutoCloseTimeout=null),this._subBusyChanged&&(unsubscribeState("o","busyChanged",this._subBusyChanged),this._subBusyChanged=null),this._subPopUpMessageData&&(unsubscribeState("o","PopUpMessageData",this._subPopUpMessageData),this._subPopUpMessageData=null),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=createElement("div"),this.nowPlaying=new Ch5MediaPlayerNowPlaying(this.musicPlayerLibInstance,this.logger),this._elContainer.appendChild(this.nowPlaying.createInternalHtml()),this.myMusic=new Ch5MediaPlayerMyMusic(this.musicPlayerLibInstance,this.logger),this._elContainer.appendChild(this.myMusic.createInternalHtml()),this.loadingIndicator(),this.logger.stop()}loadingIndicator(){this._loadingIndicator&&this._loadingIndicator.parentNode&&this._loadingIndicator.parentNode.removeChild(this._loadingIndicator),this._loadingIndicator=createElement("div",["mp-loading-indicator"]);const e=createElement("span",["mp-loading-indicator-text"]),t=createElement("i",["fa-solid","fa-circle-notch","fa-spin","mp-loader-icon-size"]);e.appendChild(t),this._loadingIndicator.appendChild(e),this._elContainer.appendChild(this._loadingIndicator)}genericDialog(e,t,i,s,n){this.logger.log(e),this._elMask&&(this._elMask.innerHTML=""),this.getDialogHeading(t);const r=document.createElement("input");if("alphanumeric"===e||"characterMasked"===e){const t=createElement("div",["dialog-content"]);r.classList.add("dialog-content-input"),r.value=decodeString(s),"characterMasked"===e&&(r.type="password"),t.appendChild(r),this._elGenericDialogContent.appendChild(t)}if(this.getDialogFooter(i,r),this._elMask.appendChild(this._elGenericDialogContent),i.length>2){this._elMask.classList.add("action-group-popup-dialog");const e=createElement("button",["generic-dialog-button","cancel-popup-button"]);e.onclick=()=>{this._dialogAutoCloseTimeout&&(clearTimeout(this._dialogAutoCloseTimeout),this._dialogAutoCloseTimeout=null),this.logger.log("Button Confirmation Id:",3),this.logger.log("Input Value:",null==r?void 0:r.value),this.demoMode?this._elMask&&this._elMask.parentNode&&this._elMask.parentNode.removeChild(this._elMask):this.musicPlayerLibInstance.popUpAction(null==r?void 0:r.value,3)},e.textContent=i[2],"Cancel"!==i[2]&&e.classList.add("primary-dialog-button"),this._elMask.appendChild(e)}this._elContainer.appendChild(this._elMask),this._dialogAutoCloseTimeout&&clearTimeout(this._dialogAutoCloseTimeout),n>0&&(this._dialogAutoCloseTimeout=window.setTimeout(()=>{this._elMask&&this._elMask.parentNode&&this._elMask.parentNode.removeChild(this._elMask),this._dialogAutoCloseTimeout=null},1e3*n)),r.addEventListener("input",()=>{this._dialogAutoCloseTimeout&&(clearTimeout(this._dialogAutoCloseTimeout),this._dialogAutoCloseTimeout=null)}),this._elGenericDialogContent.onclick=e=>{e.stopPropagation()},this._elMask.onclick=()=>{this.demoMode||this.musicPlayerLibInstance.popUpAction("",-1),this._elMask&&this._elMask.parentNode&&this._elMask.parentNode.removeChild(this._elMask)}}getDialogHeading(e){this._elMask=createElement("div",["ch5-media-player--popup-overlay"]),this._elContainer.appendChild(this._elMask),this._elGenericDialogContent=createElement("div",["ch5-media-player--popup-content-generic"]),this._elMaskdialogTitle=createElement("div",["generic-dialog-title"]),this._elMaskdialogTitle.innerHTML=decodeString(e),this._elGenericDialogContent.appendChild(this._elMaskdialogTitle)}getDialogFooter(e,t){this._dialogFooter=createElement("div",["generic-dialog-footer"]);const i=e.length;for(let s=0;s<i&&!(s>=2);s++){const i=createElement("button",["generic-dialog-button"]);i.addEventListener("click",()=>{this._dialogAutoCloseTimeout&&(clearTimeout(this._dialogAutoCloseTimeout),this._dialogAutoCloseTimeout=null),this.logger.log("Button Confirmation Id:",s+1),this.logger.log("Input Value:",null==t?void 0:t.value),this.demoMode||(e.includes("Find")?this.musicPlayerLibInstance.popUpAction(null==t?void 0:t.value,999):this.musicPlayerLibInstance.popUpAction(null==t?void 0:t.value,s+1),0===this.popUpData.timeoutSec&&this._elMask&&this._elMask.parentNode&&this._elMask.parentNode.removeChild(this._elMask)),this._elMask&&this._elMask.parentNode&&this._elMask.parentNode.removeChild(this._elMask)}),i.textContent=e[s],"Cancel"!==e[s]&&i.classList.add("primary-dialog-button"),this._dialogFooter.appendChild(i)}i>2?(this._dialogFooter.classList.remove("generic-dialog-footer--row"),this._dialogFooter.classList.add("generic-dialog-footer--column")):(this._dialogFooter.classList.remove("generic-dialog-footer--column"),this._dialogFooter.classList.add("generic-dialog-footer--row")),this._elGenericDialogContent.appendChild(this._dialogFooter)}addMusicTransition(){var e;null==(e=this.querySelector(".now-playing-player-music-note-button"))||e.addEventListener("click",()=>{var e;null==(e=this.querySelector(".ch5-media-player--my-music"))||e.classList.add("my-music-transition")})}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),resizeObserver(this._elContainer,this.handleResizeObserver)}handleResizeObserver=()=>{var e,t;const{width:i,height:s}=this._elContainer.getBoundingClientRect();i<640?this._elContainer.classList.contains("portrait-mode-active")||this._elContainer.classList.add("portrait-mode-active"):(null==(e=this.querySelector(".ch5-media-player--my-music"))||e.classList.remove("my-music-transition"),this._elContainer.classList.remove("portrait-mode-active"));const n=[{key:"xs",value:0},{key:"sm",value:384},{key:"md",value:768},{key:"lg",value:1024},{key:"xl",value:1280}],r="ch5-media-player--width-",a="ch5-media-player--height-";for(let e=0;e<n.length;e++)this._elContainer.classList.remove(r+n[e].key),this._elContainer.classList.remove(a+n[e].key);for(let e=0;e<n.length;e++)i>n[e].value&&(e===n.length-1||i<=n[e+1].value)&&this._elContainer.classList.add(r+n[e].key),s>n[e].value&&(e===n.length-1||s<=n[e+1].value)&&this._elContainer.classList.add(a+n[e].key);null==(t=this.nowPlaying)||t.updateMarquee()};removeEventListeners(){super.removeEventListeners(),this._demoPlusEl&&this._demoPlusHandler&&(this._demoPlusEl.removeEventListener("click",this._demoPlusHandler),this._demoPlusEl=null,this._demoPlusHandler=null),this._demoFavoritesEl&&this._demoFavoritesHandler&&(this._demoFavoritesEl.removeEventListener("click",this._demoFavoritesHandler),this._demoFavoritesEl=null,this._demoFavoritesHandler=null)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");e.length>0&&Array.from(e).forEach(e=>{e.remove()})}handleDemoMode(){var e,t;null==(e=this.nowPlaying)||e.handleDemoMode(this.demoMode),null==(t=this.myMusic)||t.handleDemoMode(this.demoMode),this._demoPlusEl&&this._demoPlusHandler&&(this._demoPlusEl.removeEventListener("click",this._demoPlusHandler),this._demoPlusEl=null,this._demoPlusHandler=null),this._demoFavoritesEl&&this._demoFavoritesHandler&&(this._demoFavoritesEl.removeEventListener("click",this._demoFavoritesHandler),this._demoFavoritesEl=null,this._demoFavoritesHandler=null),setTimeout(()=>{if(this.demoMode){const e=this._elContainer.querySelector('[iconclass="mp-icon mp-plus-circle"]');e&&(this._demoPlusEl=e,this._demoPlusHandler=e=>{var t;e.stopPropagation();const i=null==(t=document.querySelector(".now-playing-song-title"))?void 0:t.children[0].textContent;i&&this.genericDialog("alphanumeric","What would you like to call this favorite?",["OK","Cancel"],i,10)},this._demoPlusEl.addEventListener("click",this._demoPlusHandler));const t=this._elContainer.querySelector('[iconclass="mp-icon mp-music-list-favorites"]');t&&(this._demoFavoritesEl=t,this._demoFavoritesHandler=e=>{e.stopPropagation(),this.genericDialog("","What would you like to do?",["Rename Favorite","Delete Favorite","Cancel"],"",10)},this._demoFavoritesEl.addEventListener("click",this._demoFavoritesHandler))}}),this.demoMode?this.musicPlayerLibInstance.resetMp():this.publishAllSignals()}handleContractName(){0===this.contractName.length?(this.signalNameOnContract.contractName="",this.receiveStateShow=this.signalNameOnContract.receiveStateShow,this.receiveStateEnable=this.signalNameOnContract.receiveStateEnable,this.receiveStateCustomClass=this.signalNameOnContract.receiveStateCustomClass,this.receiveStateCustomStyle=this.signalNameOnContract.receiveStateCustomStyle,this.receiveStateCRPC=this.signalNameOnContract.receiveStateCRPC,this.sendEventCRPC=this.signalNameOnContract.sendEventCRPC,this.receiveStateMessage=this.signalNameOnContract.receiveStateMessage,this.receiveStateRefreshMediaPlayer=this.signalNameOnContract.receiveStateRefreshMediaPlayer,this.receiveStateDeviceOffline=this.signalNameOnContract.receiveStateDeviceOffline,this.receiveStatePlayerName=this.signalNameOnContract.receiveStatePlayerName):""===this.signalNameOnContract.contractName&&(this.signalNameOnContract.contractName=this.contractName,this.signalNameOnContract.receiveStateShow=this.receiveStateShow,this.signalNameOnContract.receiveStateEnable=this.receiveStateEnable,this.signalNameOnContract.receiveStateCustomClass=this.receiveStateCustomClass,this.signalNameOnContract.receiveStateCustomStyle=this.receiveStateCustomStyle,this.signalNameOnContract.receiveStateCRPC=this.receiveStateCRPC,this.signalNameOnContract.sendEventCRPC=this.sendEventCRPC,this.signalNameOnContract.receiveStateMessage=this.receiveStateMessage,this.signalNameOnContract.receiveStateRefreshMediaPlayer=this.receiveStateRefreshMediaPlayer,this.signalNameOnContract.receiveStateDeviceOffline=this.receiveStateDeviceOffline,this.signalNameOnContract.receiveStatePlayerName=this.receiveStatePlayerName),this.contractDefaultHelper()}contractDefaultHelper(){""!==this.contractName&&null!==this.contractName&&void 0!==this.contractName&&(this.receiveStateCRPC=this.contractName+".CRPC_FB",this.sendEventCRPC=this.contractName+".CRPC",this.receiveStateMessage=this.contractName+".Message_FB",this.receiveStateRefreshMediaPlayer=this.contractName+".Refresh",this.receiveStateDeviceOffline=this.contractName+".Offline",this.receiveStatePlayerName=this.contractName+".Player_Name",!0===this.useContractForShow?this.receiveStateShow=this.contractName+".Visible":this.receiveStateShow=this.signalNameOnContract.receiveStateShow,!0===this.useContractForEnable?this.receiveStateEnable=this.contractName+".Enabled":this.receiveStateEnable=this.signalNameOnContract.receiveStateEnable,!0===this.useContractForCustomClass?this.receiveStateCustomClass=this.contractName+".CustomClass":this.receiveStateCustomClass=this.signalNameOnContract.receiveStateCustomClass,!0===this.useContractForCustomStyle?this.receiveStateCustomStyle=this.contractName+".CustomStyle":this.receiveStateCustomStyle=this.signalNameOnContract.receiveStateCustomStyle)}debouncedBusyChangedHandler=this.debounce(e=>{this.busyChanged=e,this.busyChanged&&this.busyChanged.on?this.busyChanged.timeoutSec>0?(this._loadingIndicator.classList.remove("hide-loading-indicator"),setTimeout(()=>{this._loadingIndicator.classList.add("hide-loading-indicator")},1e3*this.busyChanged.timeoutSec)):this._loadingIndicator.classList.remove("hide-loading-indicator"):this._loadingIndicator.classList.add("hide-loading-indicator"),this.logger.log("busyChanged",this.busyChanged)},50);updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}publishMPEvent(e,t,i){!1===this.demoMode&&publishEvent(e,t,i)}publishAllSignals(){this.musicPlayerLibInstance.resetMp(),publishEvent("s","serial_sendEventCRPCJoinNo",this.sendEventCRPC);const e=subscribeState("s",this.receiveStateMessage,t=>{publishEvent("s","serial_receiveStateMessageResp",t),setTimeout(()=>{unsubscribeState("s","receiveStateMessage",e)})}),t=subscribeState("b",this.receiveStateRefreshMediaPlayer,e=>{publishEvent("b","digital_receiveStateRefreshMediaPlayerResp",e),setTimeout(()=>{unsubscribeState("b","receiveStateRefreshMediaPlayer",t)})}),i=subscribeState("b",this.receiveStateDeviceOffline,e=>{publishEvent("b","digital_receiveStateDeviceOfflineResp",e),setTimeout(()=>{unsubscribeState("b","receiveStateDeviceOffline",i)})})}};Ch5MediaPlayer.registerCustomElement(),Ch5MediaPlayer.registerSignalAttributeTypes();var Ch5OverlayPanel=class e extends Ch5Common{static ELEMENT_NAME="ch5-overlay-panel";static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatepositionto:{direction:"state",stringJoin:1,contractName:!0},receivestatepositionoffset:{direction:"state",stringJoin:1,contractName:!0},sendeventonshow:{direction:"event",booleanJoin:1,contractName:!0},sendeventonhide:{direction:"event",booleanJoin:1,contractName:!0},sendeventonbeforeshow:{direction:"event",booleanJoin:1,contractName:!0},sendeventonaftershow:{direction:"event",booleanJoin:1,contractName:!0},sendeventonbeforehide:{direction:"event",booleanJoin:1,contractName:!0},sendeventonafterhide:{direction:"event",booleanJoin:1,contractName:!0}};static POSITION_OFFSETS=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-center","right-center"];static STRETCHES=["both","width","height"];static OVERFLOWS=["scroll","show"];static COMPONENT_DATA={POSITION_OFFSETS:{default:e.POSITION_OFFSETS[0],values:e.POSITION_OFFSETS,key:"position_offset",classListPrefix:"--pos-"},STRETCH:{default:e.STRETCHES[0],values:e.STRETCHES,key:"stretch",classListPrefix:"--stretch-"},OVERFLOWS:{default:e.OVERFLOWS[0],values:e.OVERFLOWS,key:"overflow",classListPrefix:"--overflow-"}};static COMPONENT_PROPERTIES=[{default:!0,name:"dismissable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"closable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",name:"closeIcon",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:null,enumeratedValues:e.STRETCHES,name:"stretch",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:e.OVERFLOWS[0],enumeratedValues:e.OVERFLOWS,name:"overflow",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.OVERFLOWS[0],isObservableProperty:!0},{default:"",name:"positionTo",nameForSignal:"receiveStatePositionTo",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.POSITION_OFFSETS[0],enumeratedValues:e.POSITION_OFFSETS,name:"positionOffset",removeAttributeOnNull:!0,nameForSignal:"receiveStatePositionOffset",type:"enum",valueOnAttributeEmpty:e.POSITION_OFFSETS[0],isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnBeforeShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnHide",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnBeforeShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnAfterShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnBeforeHide",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnAfterHide",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStatePositionTo",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStatePositionOffset",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];primaryCssClass="ch5-overlay-panel";_ch5Properties;_elContainer={};_elContents={};_elCloseIcon={};_elCloseIconBtn={};_wasInstatiated=!1;_isShown=!1;_ready;_showEvent;_hideEvent;_beforeShowEvent;_afterShowEvent;_beforeHideEvent;_afterHideEvent;static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(e.ELEMENT_NAME,e)}set dismissable(e){this._ch5Properties.set("dismissable",e)}get dismissable(){return this._ch5Properties.get("dismissable")}set closable(e){this._ch5Properties.set("closable",e,()=>{this.updateForChangeInClosable()})}get closable(){return this._ch5Properties.get("closable")}set closeIcon(e){const t=""===this.closeIcon?this.primaryCssClass+"-default-close-icon":this.closeIcon;this._ch5Properties.set("closeIcon",e,()=>{this.handleCloseIcon(t,e)})}get closeIcon(){return this._ch5Properties.get("closeIcon")}set stretch(e){this._ch5Properties.set("stretch",e,()=>{this.updateForChangeInStretch()})}get stretch(){return this._ch5Properties.get("stretch")}set overflow(e){this._ch5Properties.set("overflow",e,()=>{this.updateCssClasses()})}get overflow(){return this._ch5Properties.get("overflow")}set positionTo(e){this._ch5Properties.set("positionTo",e,()=>{this.updatePosition()})}get positionTo(){return this._ch5Properties.get("positionTo")}set positionOffset(e){this._ch5Properties.set("positionOffset",e,()=>{this.updatePosition()})}get positionOffset(){return this._ch5Properties.get("positionOffset")}set receiveStatePositionTo(e){this._ch5Properties.set("receiveStatePositionTo",e,null,e=>{this._ch5Properties.setForSignalResponse("positionTo",e,()=>{this.updatePosition()})})}get receiveStatePositionTo(){return this._ch5Properties.get("receiveStatePositionTo")}set receiveStatePositionOffset(e){this._ch5Properties.set("receiveStatePositionOffset",e,null,e=>{this._ch5Properties.setForSignalResponse("positionOffset",e,()=>{this.updatePosition()})})}get receiveStatePositionOffset(){return this._ch5Properties.get("receiveStatePositionOffset")}set sendEventOnBeforeShow(e){this._ch5Properties.set("sendEventOnBeforeShow",e)}get sendEventOnBeforeShow(){return this._ch5Properties.get("sendEventOnBeforeShow")}set sendEventOnAfterShow(e){this._ch5Properties.set("sendEventOnAfterShow",e)}get sendEventOnAfterShow(){return this._ch5Properties.get("sendEventOnAfterShow")}set sendEventOnBeforeHide(e){this._ch5Properties.set("sendEventOnBeforeHide",e)}get sendEventOnBeforeHide(){return this._ch5Properties.get("sendEventOnBeforeHide")}set sendEventOnAfterHide(e){this._ch5Properties.set("sendEventOnAfterHide",e)}get sendEventOnAfterHide(){return this._ch5Properties.get("sendEventOnAfterHide")}constructor(){super(),this.info("Ch5OverlayPanel.constructor()"),this._wasInstatiated||(this.createInternalHtml(),this._rebindEventCallbacks()),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this._showEvent=new CustomEvent("show",{bubbles:!0,cancelable:!1}),this._hideEvent=new CustomEvent("hide",{bubbles:!0,cancelable:!1}),this._beforeShowEvent=new CustomEvent("beforeShow",{bubbles:!0,cancelable:!1}),this._afterShowEvent=new CustomEvent("afterShow",{bubbles:!0,cancelable:!1}),this._beforeHideEvent=new CustomEvent("beforeHide",{bubbles:!0,cancelable:!1}),this._afterHideEvent=new CustomEvent("afterHide",{bubbles:!0,cancelable:!1}),this._ready=this._getReadyCheckPromise()}connectedCallback(){this.info("called connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5OverlayPanel),this.hasAttribute("show")||this.setAttributeAndProperty(this.COMMON_PROPERTIES.SHOW,!1,!0),this._ready.then(()=>{this._initialize(),this.initCommonMutationObserver(this)})}disconnectedCallback(){this.info("called disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver()}_initialize(){if(this.info("ch5-overlay-panel _initialize()"),this._elContainer.parentElement!==this){for(;this.childNodes.length;)this._elContents.appendChild(this.childNodes[0]);this.appendChild(this._elContainer)}this.cacheComponentChildrens(),this.initAttributes(),this.updateCssClasses(),this.attachEventListeners()}generateListOfAllPossibleComponentCssClasses(){const t=[];return t.push(this.primaryCssClass),e.POSITION_OFFSETS.forEach(e=>{const i=this.primaryCssClass+"--pos-"+e;t.push(i)}),e.OVERFLOWS.forEach(e=>{t.push(this.primaryCssClass+"--overflow-"+e)}),e.STRETCHES.forEach(e=>{null!==e&&t.push(this.primaryCssClass+"--stretch-"+e)}),t}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}createInternalHtml(){this.info("ch5-overlay-panel create internal Html"),this._elContainer=document.createElement("div"),this._elCloseIconBtn=document.createElement("button"),this._elCloseIconBtn.setAttribute("type","button"),this._elCloseIconBtn.classList.add(this.primaryCssClass+"-close-icon-btn"),this._elCloseIconBtn.setAttribute("aria-label","Close"),this._elCloseIcon=document.createElement("span"),this._elCloseIcon.setAttribute("aria-hidden","true"),this._elCloseIcon.classList.add(this.primaryCssClass+"-close-icon"),this._elCloseIcon.classList.add(this.primaryCssClass+"-default-close-icon"),this._elCloseIconBtn.appendChild(this._elCloseIcon),this._elContents=document.createElement("div"),this._elContents.classList.add(this.primaryCssClass+"-contents"),this._elContainer.classList.add(this.primaryCssClass),this._elContainer.setAttribute("data-ch5-id",this.getCrId()),this._elContainer.appendChild(this._elContents)}updateCssClasses(){super.updateCssClasses(),this.info("called updateCssClasses()");const e=new Set;e.add(this.primaryCssClass),e.add(this.primaryCssClass+"--overflow-"+this.overflow);const t=this.getTargetElementForCssClassesAndStyle();void 0!==t.classList&&this.generateListOfAllPossibleComponentCssClasses().forEach(i=>{e.has(i)?(t.classList.add(i),this.info("add CSS class",i)):(t.classList.remove(i),this.info("remove CSS class",i))})}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),this._elCloseIconBtn&&(this._elCloseIconBtn.addEventListener("click",this._clickedOnClose),window.addEventListener("keydown",this._handleKeyPress)),this.addEventListener("click",this._clickAndTouchEvent),this.addEventListener("touch",this._clickAndTouchEvent),this.addEventListener("show",this._onShow),this.addEventListener("hide",this._onHide),this.addEventListener("beforeShow",this._onBeforeShow),this.addEventListener("afterShow",this._onAfterShow),this.addEventListener("beforeHide",this._onBeforeHide),this.addEventListener("afterHide",this._onAfterHide)}removeEventListeners(){super.removeEventListeners(),this._elCloseIconBtn.removeEventListener("click",this._clickedOnClose),window.removeEventListener("keydown",this._handleKeyPress),this.removeEventListener("show",this._onShow),this.removeEventListener("hide",this._onHide),this.removeEventListener("beforeShow",this._onBeforeShow),this.removeEventListener("afterShow",this._onAfterShow),this.removeEventListener("beforeHide",this._onBeforeHide),this.removeEventListener("afterHide",this._onAfterHide)}_rebindEventCallbacks(){this._onShow=this._onShow.bind(this),this._onHide=this._onHide.bind(this),this._onBeforeShow=this._onBeforeShow.bind(this),this._onAfterShow=this._onAfterShow.bind(this),this._onBeforeHide=this._onBeforeHide.bind(this),this._onAfterHide=this._onAfterHide.bind(this),this._clickedOnClose=this._clickedOnClose.bind(this),this._handleKeyPress=this._handleKeyPress.bind(this),this._dismissElement=this._dismissElement.bind(this),this._clickAndTouchEvent=this._clickAndTouchEvent.bind(this)}getTargetElementForCssClassesAndStyle(){return this._elContainer}_handleKeyPress(e){"false"!==this.getAttribute("show")&&"Escape"===e.key&&(this.info("_handleKeyPress()"),this.setAttributeAndProperty(this.COMMON_PROPERTIES.SHOW,!1,!0))}_clickedOnClose(e){this.info("_clickedOnClose()"),this.setAttributeAndProperty(this.COMMON_PROPERTIES.SHOW,!1,!0)}_getReadyCheckPromise(){return Promise.all([customElements.whenDefined("ch5-button"),customElements.whenDefined("ch5-form"),customElements.whenDefined("ch5-image"),customElements.whenDefined("ch5-list"),customElements.whenDefined("ch5-modal-dialog"),customElements.whenDefined("ch5-overlay-panel"),customElements.whenDefined("ch5-select"),customElements.whenDefined("ch5-slider"),customElements.whenDefined("ch5-spinner"),customElements.whenDefined("ch5-textinput"),customElements.whenDefined("ch5-toggle"),customElements.whenDefined("ch5-triggerview"),customElements.whenDefined("ch5-triggerview-child")])}attributeChangedCallback(t,i,s){if(i!==s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-overlay-panel attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}}updateForChangeInStretch(){const e=this.parentElement,t=this.getTargetElementForCssClassesAndStyle();if(e)switch(this.stretch){case"width":t.style.width=e.offsetWidth+"px",t.style.height="";break;case"height":t.style.height=e.offsetHeight+"px",t.style.width="";break;case"both":t.style.width=e.offsetWidth+"px",t.style.height=e.offsetHeight+"px"}else this.info("updateForChangeInStretch() - parent element not found")}updatePosition(){let e=this.positionTo||"";if(""===e)return void this.info("updateForChangeInPositionTo() - incorrect reference id ");"#"!==e.charAt(0)&&(e="#"+e);const t=document.querySelector(e);t&&this.parentElement!==t.parentElement&&this._insertAfter(this,t);const i=this.getTargetElementForCssClassesAndStyle();if(t)switch(this.positionOffset){case"top-left":i.style.top=t.offsetTop-i.offsetHeight+"px",i.style.left=t.offsetLeft+"px";break;case"top-center":i.style.top=t.offsetTop-i.offsetHeight+"px",i.style.left=t.offsetLeft+Math.floor(t.offsetWidth/2)-Math.floor(i.offsetWidth/2)+"px";break;case"top-right":i.style.top=t.offsetTop-i.offsetHeight+"px",i.style.left=t.offsetLeft+t.offsetWidth-i.offsetWidth+"px";break;case"bottom-left":i.style.top=t.offsetTop+t.offsetHeight+"px",i.style.left=t.offsetLeft+"px";break;case"bottom-center":i.style.top=t.offsetTop+t.offsetHeight+"px",i.style.left=t.offsetLeft+Math.floor(t.offsetWidth/2)-Math.floor(i.offsetWidth/2)+"px";break;case"bottom-right":i.style.top=t.offsetTop+t.offsetHeight+"px",i.style.left=t.offsetLeft+t.offsetWidth-i.offsetWidth+"px";break;case"left-center":i.style.top=t.offsetTop-Math.floor(i.offsetHeight/2)+Math.floor(t.offsetHeight/2)+"px",i.style.left=t.offsetLeft-i.offsetWidth+"px";break;case"right-center":i.style.top=t.offsetTop-Math.floor(i.offsetHeight/2)+Math.floor(t.offsetHeight/2)+"px",i.style.left=t.offsetLeft+t.offsetWidth+"px"}else this.info("updateForChangeInPositionTo() - reference element not found for id "+e)}handleCloseIcon(e,t){void 0!==this._elCloseIcon.classList&&e!==t&&(""!==e&&e.split(" ").forEach(e=>{""!==(e=e.trim())&&this._elCloseIcon.classList.remove(e)}),""!==t&&t.split(" ").forEach(e=>{""!==(e=e.trim())&&this._elCloseIcon.classList.add(e)}))}_dismissElement(e){this.info("_dismissElement()"),!1!==this.dismissable?!1!==this._isShown?(this.info("_dismissElement() inEvent",e),this.setAttributeAndProperty(this.COMMON_PROPERTIES.SHOW,!1,!0)):this.info("_dismissElement() return ( _isShown is false)"):this.info("_dismissElement() return ( dismissable is false)")}_clickAndTouchEvent(e){e.stopPropagation()}updateForChangeInClosable(){!0===this.closable?this._elContainer.insertBefore(this._elCloseIconBtn,this._elContents):this._elCloseIconBtn.remove()}beforeHandlingShow(){this.info("beforeHandlingShow()"),this.dispatchEvent(this._beforeShowEvent),this.dispatchEvent(this._showEvent),this._sendPulse(this.sendEventOnBeforeShow)}afterHandlingShow(){this.info("afterHandlingShow()"),this.dispatchEvent(this._afterShowEvent),this._sendPulse(this.sendEventOnAfterShow),this.updatePosition(),this._isShown=!0,setTimeout(()=>{document.addEventListener("click",this._dismissElement)},250)}beforeHandlingHide(){this.info("beforeHandlingHide()"),this.dispatchEvent(this._beforeHideEvent),this._sendPulse(this.sendEventOnBeforeHide),document.removeEventListener("click",this._dismissElement)}afterHandlingHide(){this.info("afterHandlingHide()"),this.dispatchEvent(this._hideEvent),this.dispatchEvent(this._afterHideEvent),this._sendPulse(this.sendEventOnAfterHide),this._isShown=!1}_onShow(e){this.info("_onShow()")}_onHide(e){this.info("_onHide()"),this._onAfterHide(e)}_onBeforeShow(e){this.info("_onBeforeShow()")}_onAfterShow(e){this.info("_onAfterShow()")}_onBeforeHide(e){this.info("_onBeforeHide()")}_onAfterHide(e){this.info("_onAfterHide()")}_sendPulse(e){let t=null;""!==e&&null!=e&&(t=Ch5SignalFactory.getInstance().getBooleanSignal(e),null!==t&&(t.publish(!0),t.publish(!1)))}_insertAfter(e,t){null!==t&&null!==t.parentNode&&t.parentNode.insertBefore(e,t.nextSibling)}};Ch5OverlayPanel.registerCustomElement(),Ch5OverlayPanel.registerSignalAttributeTypes();var Ch5ModalDialog=class e extends Ch5OverlayPanel{static COMPONENT_DATA={STRETCH:{default:Ch5OverlayPanel.STRETCHES[0],values:Ch5OverlayPanel.STRETCHES,key:"stretch",attribute:"stretch",classListPrefix:"--stretch-"},OVERFLOWS:{default:Ch5OverlayPanel.OVERFLOWS[0],values:Ch5OverlayPanel.OVERFLOWS,key:"overflow",attribute:"overflow",classListPrefix:"--overflow-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,sendeventonbeforeshow:{direction:"event",booleanJoin:1,contractName:!0},sendeventonaftershow:{direction:"event",booleanJoin:1,contractName:!0},sendeventonbeforehide:{direction:"event",booleanJoin:1,contractName:!0},sendeventonafterhide:{direction:"event",booleanJoin:1,contractName:!0},sendeventonok:{direction:"event",booleanJoin:1,contractName:!0},sendeventoncancel:{direction:"event",booleanJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:!0,name:"dismissable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"closable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",name:"closeIcon",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"mask",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",name:"maskStyle",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:null,enumeratedValues:Ch5OverlayPanel.STRETCHES,name:"stretch",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:Ch5OverlayPanel.OVERFLOWS[0],enumeratedValues:Ch5OverlayPanel.OVERFLOWS,name:"overflow",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:Ch5OverlayPanel.OVERFLOWS[0],isObservableProperty:!0},{default:"",name:"width",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"height",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"title",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"hideOkButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"Ok",name:"okButtonLabel",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"Ok",isObservableProperty:!0},{default:"",name:"okButtonIcon",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"okButtonStyle",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"hideCancelButton",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"Cancel",name:"cancelButtonLabel",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"Cancel",isObservableProperty:!0},{default:"",name:"cancelButtonIcon",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"cancelButtonStyle",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"prompt",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"promptIcon",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnBeforeShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnAfterShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnBeforeHide",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnAfterHide",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnOk",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnCancel",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-modal-dialog";primaryCssClass="ch5-modal-dialog";_ch5Properties;_elMask={};_elHeader={};_elPrompt={};_elPromptIcon={};_elPromptText={};_elFooter={};_elBtnOk={};_elBtnCancel={};_okEvent;_cancelEvent;set width(e){this._ch5Properties.set("width",this._parseSizeAttr(e),()=>{this.handleWidth()})}get width(){return this._ch5Properties.get("width")}set height(e){this._ch5Properties.set("height",this._parseSizeAttr(e),()=>{this.handleHeight()})}get height(){return this._ch5Properties.get("height")}set stretch(e){const t=this.stretch;this._ch5Properties.set("stretch",e,()=>{null!==t&&this.updateChangeInStretch(t)})}get stretch(){return this._ch5Properties.get("stretch")}set closable(e){this._ch5Properties.set("closable",e,()=>{this.adjustInternalHtmlStructure()})}get closable(){return this._ch5Properties.get("closable")}set title(e){const t=this._getTranslatedValue("title",e);this._ch5Properties.set("title",t,()=>{this.handleTitle(t)})}get title(){return this._ch5Properties.get("title")}set mask(e){this._ch5Properties.set("mask",e,()=>{this.handleMask()})}get mask(){return this._ch5Properties.get("mask")}set maskStyle(e){this._ch5Properties.set("maskStyle",e,()=>{this.handleMaskStyle()})}get maskStyle(){return this._ch5Properties.get("maskStyle")}set hideOkButton(e){this._ch5Properties.set("hideOkButton",e,()=>{this.adjustInternalHtmlStructure()})}get hideOkButton(){return this._ch5Properties.get("hideOkButton")}set okButtonLabel(e){const t=this._getTranslatedValue("okButtonLabel",e);this._ch5Properties.set("okButtonLabel",t,()=>{this.handleOkButtonLabel(t)})}get okButtonLabel(){return this._ch5Properties.get("okButtonLabel")}set okButtonIcon(e){this._ch5Properties.set("okButtonIcon",e,()=>{this.handleOkButtonIcon()})}get okButtonIcon(){return this._ch5Properties.get("okButtonIcon")}set okButtonStyle(e){this._ch5Properties.set("okButtonStyle",e,()=>{this.handleOkButtonStyle()})}get okButtonStyle(){return this._ch5Properties.get("okButtonStyle")}set hideCancelButton(e){this._ch5Properties.set("hideCancelButton",e,()=>{this.adjustInternalHtmlStructure()})}get hideCancelButton(){return this._ch5Properties.get("hideCancelButton")}set cancelButtonLabel(e){const t=this._getTranslatedValue("cancelButtonLabel",e);this._ch5Properties.set("cancelButtonLabel",t,()=>{this.handleCancelButtonLabel(t)})}get cancelButtonLabel(){return this._ch5Properties.get("cancelButtonLabel")}set cancelButtonIcon(e){this._ch5Properties.set("cancelButtonIcon",e,()=>{this.handleCancelButtonIcon()})}get cancelButtonIcon(){return this._ch5Properties.get("cancelButtonIcon")}set cancelButtonStyle(e){this._ch5Properties.set("cancelButtonStyle",e,()=>{this.handleCancelButtonStyle()})}get cancelButtonStyle(){return this._ch5Properties.get("cancelButtonStyle")}set prompt(e){const t=this._getTranslatedValue("prompt",e);this._ch5Properties.set("prompt",t,()=>{this.handlePrompt(t)})}get prompt(){return this._ch5Properties.get("prompt")}set promptIcon(e){this._ch5Properties.set("promptIcon",e,()=>{this.handlePromptIcon(e)})}get promptIcon(){return this._ch5Properties.get("promptIcon")}set sendEventOnOk(e){this._ch5Properties.set("sendEventOnOk",e,()=>{this._elBtnOk.setAttribute("sendEventOnClick",e)})}get sendEventOnOk(){return this._ch5Properties.get("sendEventOnOk")}set sendEventOnCancel(e){this._ch5Properties.set("sendEventOnCancel",e,()=>{this._elBtnCancel.setAttribute("sendEventOnClick",e)})}get sendEventOnCancel(){return this._ch5Properties.get("sendEventOnCancel")}_crModalWasInstatiated=!1;constructor(){super(),this.info("Ch5ModalDialog.constructor()"),this._listOfAllPossibleComponentCssClasses=this.generateListOfAllPossibleComponentCssClasses(),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this._crModalWasInstatiated||(this._rebindEventCallbacks(),this.createInternalHtml()),this._crModalWasInstatiated=!0,this.updateCssClasses(),this._okEvent=new CustomEvent("ok",{bubbles:!0,cancelable:!1}),this._cancelEvent=new CustomEvent("cancel",{bubbles:!0,cancelable:!1})}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(e.ELEMENT_NAME,e)}attachEventListeners(){super.attachEventListeners(),this._elBtnCancel&&this._elBtnOk&&(this.hideOkButton||this._elBtnOk.addEventListener("click",this._onOkClick),this.hideCancelButton||this._elBtnCancel.addEventListener("click",this._onCancelClick),this._elMask.addEventListener("click",this._clickedOnMask))}removeEventListeners(){super.removeEventListeners(),void 0!==this._elBtnOk.childNodes&&this._elBtnOk.removeEventListener("click",this._onOkClick),void 0!==this._elBtnCancel.childNodes&&this._elBtnCancel.removeEventListener("click",this._onCancelClick),this._elMask.removeEventListener("click",this._clickedOnMask)}_rebindEventCallbacks(){super._rebindEventCallbacks(),this._onOkClick=this._onOkClick.bind(this),this._onCancelClick=this._onCancelClick.bind(this),this._clickedOnMask=this._clickedOnMask.bind(this)}_onOkClick(e){this.info("_onOkClick()"),this.dispatchEvent(this._okEvent),this.setShowBasedOnAttributes()}_onCancelClick(e){this.info("_onCancelClick()"),this.dispatchEvent(this._cancelEvent),this.setShowBasedOnAttributes()}_parseSizeAttr(e){let t=e.trim().toLowerCase();return-1===t.indexOf("px")&&(t+="px"),t}_clickedOnMask(e){return this.info("_clickedOnMask()"),!0===this.mask&&!0===this.dismissable&&this.setShowBasedOnAttributes(),e.stopPropagation(),!1}_checkAndAttachMaskIfNeeded(){!0===this.mask&&this._elMask.parentElement!==this&&this._elContainer.parentElement===this&&this.insertBefore(this._elMask,this._elContainer)}getTargetElementForCssClassesAndStyle(){return this._elContainer}connectedCallback(){this.info("ch5-modal connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5ModalDialog),this.hasAttribute("show")||this.setShowBasedOnAttributes(),this.initializeButton(),this._ready.then(()=>{this._initialize(),this.initCommonMutationObserver(this)}),this.attachEventListeners()}disconnectedCallback(){this.info("ch5-modal disconnectedCallback()"),super.disconnectedCallback(),this.disconnectCommonMutationObserver(),this.removeEventListeners()}setShowBasedOnAttributes(){this.setAttributeAndProperty(this.COMMON_PROPERTIES.SHOW,!1,!0)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}_initialize(){this.info("ch5-modal _initialize()");if(!this.querySelector(`.${this.primaryCssClass}`)){for(;this.childNodes.length;)this._elContents.appendChild(this.childNodes[0]);this.appendChild(this._elContainer),this.adjustInternalHtmlStructure(),this.cacheComponentChildrens()}this.initAttributes(),this._checkAndAttachMaskIfNeeded(),this.updateCssClasses()}updateSwipeGesture(){this._elBtnCancel&&this._elBtnCancel.setAttribute("sendEventOnClick",String(this.swipeGestureEnabled)),this._elBtnOk&&this._elBtnOk.setAttribute("sendEventOnClick",String(this.swipeGestureEnabled))}initializeButton(){this.hideOkButton||void 0!==this._elBtnOk.childNodes||(this._elBtnOk=new Ch5Button,this._elBtnOk.classList.add(this.primaryCssClass+"-btn-ok"),this._elBtnOk.setAttribute("type","success"),this._elBtnOk.setAttribute("label",this.okButtonLabel),this._elFooter.append(this._elBtnOk)),this.hideCancelButton||void 0!==this._elBtnCancel.childNodes||(this._elBtnCancel=new Ch5Button,this._elBtnCancel.classList.add(this.primaryCssClass+"-btn-cancel"),this._elBtnCancel.setAttribute("type","warning"),this._elBtnCancel.setAttribute("label",this.cancelButtonLabel),this._elFooter.append(this._elBtnCancel))}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}generateListOfAllPossibleComponentCssClasses(){return super.generateListOfAllPossibleComponentCssClasses()}updateCssClasses(){super.updateCssClasses(),this.info("called updateCssClasses()");const e=new Set;e.add(this.primaryCssClass),e.add(this.primaryCssClass+"--overflow-"+this.overflow),e.add(this.primaryCssClass+"--stretch-"+this.stretch);const t=this.getTargetElementForCssClassesAndStyle();void 0!==t.classList&&this._listOfAllPossibleComponentCssClasses.forEach(i=>{e.has(i)?(t.classList.add(i),this.info("add CSS class",i)):(t.classList.remove(i),this.info("remove CSS class",i))})}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-modal-dialog-prasaanth attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}handleMask(){!0===this.mask?this._elMask.classList.add(this.primaryCssClass+"-mask-default-style"):this._elMask.remove(),this._checkAndAttachMaskIfNeeded()}handleMaskStyle(){this._elMask.style.cssText=this.maskStyle}handleWidth(){const e=this.getTargetElementForCssClassesAndStyle();e&&(e.style.width=this._parseSizeAttr(this.width))}handleHeight(){const e=this.getTargetElementForCssClassesAndStyle();e&&(e.style.height=this._parseSizeAttr(this.height))}handleTitle(e){this._elHeader instanceof HTMLElement&&(this._elHeader.textContent=e)}updateChangeInStretch(e){const t=this.getTargetElementForCssClassesAndStyle();t.classList.remove(this.primaryCssClass+"--stretch-"+e),t.classList.add(this.primaryCssClass+"--stretch-"+this.stretch)}handleOkButtonLabel(e){this._elBtnOk.setAttribute("label",e)}handleOkButtonIcon(){this._elBtnOk.setAttribute("iconClass",this.okButtonIcon)}handleOkButtonStyle(){this._elBtnOk.setAttribute("customStyle",this.okButtonStyle)}handleCancelButtonLabel(e){this._elBtnCancel instanceof HTMLElement&&this._elBtnCancel.setAttribute("label",e)}handleCancelButtonIcon(){this._elBtnCancel.setAttribute("iconClass",this.cancelButtonIcon)}handleCancelButtonStyle(){this._elBtnCancel.setAttribute("customStyle",this.cancelButtonStyle)}handlePrompt(e){this._elPromptText instanceof HTMLElement&&(this._elPromptText.textContent=e)}handlePromptIcon(e){this._elPromptIcon instanceof HTMLElement&&this._elPromptIcon.setAttribute("src",e)}createInternalHtml(){const e=this.querySelector(`.${this.primaryCssClass}`);e?(this._elCloseIconBtn=this.querySelector(`.${this.primaryCssClass}-close-icon-btn`),this._elCloseIcon=this.querySelector(`.${this.primaryCssClass}-close-icon`),this._elHeader=this.querySelector(`.${this.primaryCssClass}-header`),this._elPrompt=this.querySelector(`.${this.primaryCssClass}-prompt`),this._elPromptIcon=this.querySelector(`.${this.primaryCssClass}-prompt-icon`),this._elPromptText=this.querySelector(`.${this.primaryCssClass}-prompt-text`),this._elFooter=this.querySelector(`.${this.primaryCssClass}-footer`),this._elBtnOk=this.querySelector(`.${this.primaryCssClass}-btn-ok`),this._elBtnCancel=this.querySelector(`.${this.primaryCssClass}-btn-cancel`),this._elContents=this.querySelector(`.${this.primaryCssClass}-contents`),this._elContainer=e,this._elMask=this.querySelector(`.${this.primaryCssClass}-mask`)):(this.info("ch5-modal-dialog create internal Html"),this._elContainer=document.createElement("div"),this._elCloseIconBtn=document.createElement("button"),this._elCloseIconBtn.setAttribute("type","button"),this._elCloseIconBtn.classList.add(this.primaryCssClass+"-close-icon-btn"),this._elCloseIconBtn.setAttribute("aria-label","Close"),this._elCloseIcon=document.createElement("span"),this._elCloseIcon.setAttribute("aria-hidden","true"),this._elCloseIcon.classList.add(this.primaryCssClass+"-close-icon"),this._elCloseIcon.classList.add(this.primaryCssClass+"-default-close-icon"),this._elCloseIconBtn.appendChild(this._elCloseIcon),this._elHeader=document.createElement("div"),this._elHeader.classList.add(this.primaryCssClass+"-header"),this._elPrompt=document.createElement("div"),this._elPrompt.classList.add(this.primaryCssClass+"-prompt"),this._elPromptIcon=document.createElement("img"),this._elPromptIcon.classList.add(this.primaryCssClass+"-prompt-icon"),this._elPromptText=document.createElement("span"),this._elPromptText.classList.add(this.primaryCssClass+"-prompt-text"),this._elFooter=document.createElement("div"),this._elFooter.classList.add(this.primaryCssClass+"-footer"),this._elContents=document.createElement("div"),this._elContents.classList.add(this.primaryCssClass+"-contents"),this._elContainer.classList.add(this.primaryCssClass),this._elContainer.setAttribute("data-ch5-id",this.getCrId()),this._elMask=document.createElement("div"),this._elMask.classList.add(this.primaryCssClass+"-mask"),this._elMask.classList.add(this.primaryCssClass+"-mask-default-style"),this._elMask.setAttribute("cr-id",this.getCrId()+"-mask"))}adjustInternalHtmlStructure(){const e=document.createDocumentFragment();this.closable?e.appendChild(this._elCloseIconBtn):this._elCloseIconBtn.remove(),""!==this.title?(this._elHeader.textContent=this.title,e.appendChild(this._elHeader)):this._elHeader&&this._elHeader.remove(),""!==this.prompt||""!==this.promptIcon?(""!==this.promptIcon?(this._elPromptIcon.setAttribute("src",this.promptIcon),this._elPrompt.appendChild(this._elPromptIcon)):this._elPromptIcon&&this._elPromptIcon.remove(),""!==this.prompt&&this._elPromptText instanceof Node?(this._elPromptText.textContent=this.prompt,this._elPrompt.appendChild(this._elPromptText),this._elPromptIcon instanceof Node&&this._elPrompt.insertBefore(this._elPromptIcon,this._elPromptText)):this._elPromptText instanceof Node&&this._elPromptText.remove(),e.appendChild(this._elPrompt)):this._elPrompt&&this._elPrompt.remove(),e.appendChild(this._elContents),this.hideOkButton&&this.hideCancelButton?this._elFooter&&this._elFooter.remove():(this.initializeButton(),this.hideOkButton?this.hideOkButton&&void 0!==this._elBtnOk.childNodes&&this._elBtnOk.remove():this._elFooter.appendChild(this._elBtnOk),this.hideCancelButton?this.hideCancelButton&&void 0!==this._elBtnCancel.childNodes&&this._elBtnCancel.remove():this._elFooter.appendChild(this._elBtnCancel),e.appendChild(this._elFooter)),this._elContainer.appendChild(e)}};Ch5ModalDialog.registerCustomElement(),Ch5ModalDialog.registerSignalAttributeTypes();import QRCode from"qrcode";import isEmpty5 from"lodash/isEmpty";var Ch5BaseLog=class{constructor(e,t,i=!1,s=""){this.componentName=e,this.isDebugEnabled=t,this.isTraceEnabled=i,this.crId=s}componentName;isDebugEnabled;isTraceEnabled;crId;start(e){if(performance.mark(this.componentName+"-"+this.crId+"-"+e+"-start"),!0===this.isTraceEnabled){let t="";!1===Ch5Debug.CONSOLE_OVERRIDDEN&&(t=(new Date).toISOString()),console.group((""!==this.componentName?this.componentName+" ":"")+t+": "+this.crId+": "+e)}else!0===this.isDebugEnabled&&this.info(e,this.componentName)}log(...e){if(e&&e.length>0&&performance.mark(this.componentName+"-"+this.crId+"-"+e[0]),!0===this.isTraceEnabled)console.log(...e);else if(!0===this.isDebugEnabled){let t="";!1===Ch5Debug.CONSOLE_OVERRIDDEN&&(t=(new Date).toISOString());try{let i=String((new Error).stack).trim();null!==i&&(i&&(i=i.replace(/^Error\s+/,"")),i&&(i=i.split("\n")[1]),i&&(i=i.replace(/^\s+at Object./,"")),i&&(i=i.replace(/^\s+at HTMLElement./,"")),i&&(i=i.replace(/^\s+at /,"")),i&&(i=i.replace(/ \(.+\)$/,"")),i&&(i=i.replace(/\@.+/,"")),i&&""!==i&&(i="Method is "+i+":")),console.log(t+":"+this.crId+":"+i+":",e)}catch(i){console.log(t+":"+this.crId+":",e)}}}info(e,...t){if(!0===this.isDebugEnabled){let i="";!1===Ch5Debug.CONSOLE_OVERRIDDEN&&(i=(new Date).toISOString());try{let s=String((new Error).stack).trim();null!==s&&(s&&(s=s.replace(/^Error\s+/,"")),s&&(s=s.split("\n")[1]),s&&(s=s.replace(/^\s+at Object./,"")),s&&(s=s.replace(/^\s+at HTMLElement./,"")),s&&(s=s.replace(/^\s+at /,"")),s&&(s=s.replace(/ \(.+\)$/,"")),s&&(s=s.replace(/\@.+/,"")),s&&""!==s&&(s="Method is "+s+":")),console.info(i+":"+this.crId+":"+s+e+":"+t)}catch(s){console.info(i+":"+this.crId+":"+e+":"+t)}}}error(e,...t){if(!0===this.isDebugEnabled){let i="";!1===Ch5Debug.CONSOLE_OVERRIDDEN&&(i=(new Date).toISOString());try{let s=String((new Error).stack).trim();null!==s&&(s&&(s=s.replace(/^Error\s+/,"")),s&&(s=s.split("\n")[1]),s&&(s=s.replace(/^\s+at Object./,"")),s&&(s=s.replace(/^\s+at HTMLElement./,"")),s&&(s=s.replace(/^\s+at /,"")),s&&(s=s.replace(/ \(.+\)$/,"")),s&&(s=s.replace(/\@.+/,"")),s&&""!==s&&(s="Method is "+s+":")),console.error(i+":"+this.crId+":"+s+e+":"+t)}catch(s){console.error(i+":"+this.crId+":"+e+":"+t)}}}stop(e=""){performance.mark(this.componentName+"-"+this.crId+"-"+e+"-stop"),!0===this.isTraceEnabled&&console.groupEnd()}},Ch5BaseClass=class e extends HTMLElement{static DIRECTION=["ltr","rtl"];static NO_SHOW_TYPES=["display","visibility","remove"];static ELEMENT_NAME="Ch5BaseClass";COMPONENT_NAME="Ch5BaseClass";primaryCssClass="ch5-base-class";childrenOfCurrentNode=null;_isInstantiated=!1;_nextSiblingIndexInParentChildNodes=0;_onrelease={};_onpress={};_crId="";CSS_CLASS_FOR_HIDE_VISIBILITY="ch5-hide-vis";CSS_CLASS_FOR_HIDE_DISPLAY="ch5-hide-dis";_cachedParentEl=null;_cachedNextSibling=null;_isDetachedFromDom=!1;_keepListeningOnSignalsAfterRemoval=!1;elementIsInViewPort=!0;elementIntersectionEntry={};elementIsVisible=!0;logger;_commonMutationObserver={};_subscribeAppendClassWhenInViewPort=!1;_ch5Properties;componentProperties=[];static COMPONENT_PROPERTIES=[];static BASE_COMPONENT_PROPERTIES=[{default:"",name:"appendClassWhenInViewPort",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"id",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"customClass",nameForSignal:"receiveStateCustomClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"customStyle",nameForSignal:"receiveStateCustomStyle",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!0,name:"disabled",nameForSignal:"receiveStateEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.DIRECTION[0],name:"dir",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:e.DIRECTION[0],isObservableProperty:!0},{default:!0,name:"show",nameForSignal:"receiveStateShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"debug",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"trace",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.NO_SHOW_TYPES[0],enumeratedValues:e.NO_SHOW_TYPES,name:"noshowType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.NO_SHOW_TYPES[0],isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateCustomClass",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateCustomStyle",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateEnable",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateShowPulse",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateHidePulse",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"swipeGestureEnabled",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];static COMMON_PROPERTIES={appendClassWhenInViewPort:this.getCommonProperty("appendClassWhenInViewPort"),customClass:this.getCommonProperty("customClass"),customStyle:this.getCommonProperty("customStyle"),debug:this.getCommonProperty("debug"),dir:this.getCommonProperty("dir"),disabled:this.getCommonProperty("disabled"),id:this.getCommonProperty("id"),noshowType:this.getCommonProperty("noshowType"),receiveStateCustomClass:this.getCommonProperty("receiveStateCustomClass"),receiveStateCustomStyle:this.getCommonProperty("receiveStateCustomStyle"),receiveStateEnable:this.getCommonProperty("receiveStateEnable"),receiveStateShow:this.getCommonProperty("receiveStateShow"),receiveStateShowPulse:this.getCommonProperty("receiveStateShowPulse"),receiveStateHidePulse:this.getCommonProperty("receiveStateHidePulse"),sendEventOnShow:this.getCommonProperty("sendEventOnShow"),show:this.getCommonProperty("show"),trace:this.getCommonProperty("trace"),swipeGestureEnabled:this.getCommonProperty("swipeGestureEnabled")};set appendClassWhenInViewPort(e){this._ch5Properties.set("appendClassWhenInViewPort",e,()=>{this._subscribeAppendClassWhenInViewPort||(this._subscribeAppendClassWhenInViewPort=!0,subscribeInViewPortChange(this,e=>{this.updateElementVisibility(e),this.updateInViewPortClass()}))})}get appendClassWhenInViewPort(){return this._ch5Properties.get("appendClassWhenInViewPort")}set customClass(e){this._ch5Properties.set("customClass",e,()=>{this.updateForChangeInCustomCssClass(this._ch5Properties.getPrevious("customClass").split(" "))})}get customClass(){return this._ch5Properties.get("customClass")}set customStyle(e){this._ch5Properties.set("customStyle",e,()=>{this.updateForChangeInCustomStyle()})}get customStyle(){return this._ch5Properties.get("customStyle")}set debug(e){this._ch5Properties.set("debug",e,()=>{this.logger.isDebugEnabled=this.debug})}get debug(){return this._ch5Properties.get("debug")}set dir(e){this._ch5Properties.set("dir",e)}get dir(){return this._ch5Properties.get("dir")}set disabled(e){this._ch5Properties.set("disabled",e,()=>{this.updateForChangeInDisabledStatus()})}get disabled(){return this._ch5Properties.get("disabled")}set id(e){this._ch5Properties.set("id",e)}get id(){return this._ch5Properties.get("id")}set noshowType(e){this._ch5Properties.set("noshowType",e,()=>{this.updateForChangeInShowStatus()})}get noshowType(){return this._ch5Properties.get("noshowType")}set receiveStateCustomClass(e){this._ch5Properties.set("receiveStateCustomClass",e,null,e=>{this._ch5Properties.setForSignalResponse("customClass",e,()=>{this.updateForChangeInCustomCssClass(this._ch5Properties.getPrevious("customClass").split(" "))})})}get receiveStateCustomClass(){return this._ch5Properties.get("receiveStateCustomClass")}set receiveStateCustomStyle(e){this._ch5Properties.set("receiveStateCustomStyle",e,null,e=>{this._ch5Properties.setForSignalResponse("customStyle",e,()=>{this.updateForChangeInCustomStyle()})})}get receiveStateCustomStyle(){return this._ch5Properties.get("receiveStateCustomStyle")}set show(e){this._ch5Properties.set("show",e,()=>{this.updateForChangeInShowStatus()})}get show(){return this._ch5Properties.get("show")}set receiveStateEnable(e){this._ch5Properties.set("receiveStateEnable",e,null,e=>{this._ch5Properties.setForSignalResponse("disabled",e,()=>{this.updateForChangeInDisabledStatus()})})}get receiveStateEnable(){return this._ch5Properties.get("receiveStateEnable")}set receiveStateHidePulse(e){this._ch5Properties.set("receiveStateHidePulse",e,null,e=>{this._ch5Properties.setForSignalResponse("show",e,()=>{this.handleHide(this)})})}get receiveStateHidePulse(){return this._ch5Properties.get("receiveStateHidePulse")}set receiveStateShowPulse(e){this._ch5Properties.set("receiveStateShowPulse",e,null,e=>{this._ch5Properties.setForSignalResponse("show",e,()=>{this.handleShow(this)})})}get receiveStateShowPulse(){return this._ch5Properties.get("receiveStateShowPulse")}set receiveStateShow(e){this._ch5Properties.set("receiveStateShow",e,null,e=>{this._ch5Properties.setForSignalResponse("show",e,()=>{this.updateForChangeInShowStatus()})})}get receiveStateShow(){return this._ch5Properties.get("receiveStateShow")}set sendEventOnShow(e){this._ch5Properties.set("sendEventOnShow",e,()=>{this.sendShowSignal(Boolean(e))})}get sendEventOnShow(){return this._ch5Properties.get("sendEventOnShow")}set onrelease(e){this._onrelease=e}get onrelease(){return this._onrelease}set onpress(e){this.logger.log("set onpress"),this._onpress=e}get onpress(){return this.logger.log("get onpress"),this._onpress}set trace(e){this._ch5Properties.set("trace",e,()=>{this.logger.isTraceEnabled=this.trace})}get trace(){return this._ch5Properties.get("trace")}set swipeGestureEnabled(e){this.logger.log("set swipeGestureEnabled('"+e+"')"),this._ch5Properties.set("swipeGestureEnabled",e)}get swipeGestureEnabled(){return this.swipeGestureEnabled}get util(){return utils_exports}constructor(t){super(),this._crId=Ch5Uid.getUid();const i=!!this.hasAttribute("debug")&&this.util.toBoolean(this.getAttribute("debug"),!0),s=!!this.hasAttribute("trace")&&this.util.toBoolean(this.getAttribute("trace"),!0);this.logger=new Ch5BaseLog(this.COMPONENT_NAME,i,s,this._crId),this.componentProperties=t,e.selectedComponentProperties=t,this._ch5Properties=new Ch5Properties(this,this.componentProperties)}resolveTemplateChildren(e){e&&this.util.isNotNil(e.content)&&0===e.content.childElementCount&&e.children.length>0&&Array.from(e.children).forEach(t=>{e.content.appendChild(t)})}static get selectedComponentProperties(){return this.COMPONENT_PROPERTIES}static set selectedComponentProperties(e){this.COMPONENT_PROPERTIES=e}static get observedAttributes(){const e=this.selectedComponentProperties,t=[];for(let i=0;i<e.length;i++)!0===e[i].isObservableProperty&&t.push(e[i].name.toLowerCase());return t}getCrId(){return this._crId}static getCommonProperty(t){return JSON.parse(JSON.stringify(e.BASE_COMPONENT_PROPERTIES.find(e=>e.name===t)))}attributeChangedCallback(e,t,i){if(this.logger.log('attributeChangedCallback("'+e+'","'+t+'","'+i+'")'),t!==i){const t=this.componentProperties.find(t=>t.name.toLowerCase()===e.toLowerCase()&&!0===t.isObservableProperty);if(t){this[t.name]=i}}this.logger.stop()}connectedCallback(){}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.unsubscribeFromSignals(),this.logger.stop()}cacheComponentChildrens(){this.childrenOfCurrentNode=Array.from(this.children).filter(e=>e.isConnected)}repaint(){try{const e=this.parentNode;if(this._isInstantiated=!1,!0===this.hasChildNodes()){for(let e=this.childNodes.length;e--;){let t=!0;this.childrenOfCurrentNode&&this.childrenOfCurrentNode.length>0&&Array.from(this.childrenOfCurrentNode).filter(i=>{null!==i&&Object.is(i,this.childNodes[e])&&(t=!1)}),!0===t&&this.removeChild(this.childNodes[e])}const t=document.createElement("div");null!==e&&(e.insertBefore(t,this.nextSibling),this.remove(),t.parentNode.insertBefore(this,t.nextSibling),t.remove())}}catch(e){console.log("Error encountered during repaint crId: "+this.getCrId()+" error ",e)}}updateCssClasses(){this.logger.log("from common - updateCssClasses()")}updateForChangeInCustomCssClass(e){const t=this.getTargetElementForCssClassesAndStyle();this.logger.start("updateForChangeInCustomCssClass()"),this.logger.log("updateForChangeInCustomCssClass(): _prevAddedCustomClasses - ",e),this.logger.log("from common - updateForChangeInCustomCssClass()",this.customClass),e.forEach(e=>{""!==e&&t.classList.remove(e)}),e=[],this.customClass.split(" ").forEach(i=>{""!==i&&(e.push(i),t.classList.add(i))}),this.logger.stop()}updateForChangeInCustomStyle(){this.getTargetElementForCssClassesAndStyle().style.cssText=this.customStyle}updateForChangeInShowStatus(){const e=this;!1===this.show?this.handleHide(e):this.handleShow(e)}handleHide(e){var t,i;switch(this.beforeHandlingHide(),this.logger.log("handleHide"),this.sendShowSignal(!1),e.classList.remove(this.CSS_CLASS_FOR_HIDE_DISPLAY),e.classList.remove(this.CSS_CLASS_FOR_HIDE_VISIBILITY),this.noshowType){case"visibility":e.classList.add(this.CSS_CLASS_FOR_HIDE_VISIBILITY);break;case"display":e.classList.add(this.CSS_CLASS_FOR_HIDE_DISPLAY);break;case"remove":"ch5-modal-dialog"===(null==(t=this.parentElement)?void 0:t.tagName.toLowerCase())||"ch5-overlay-panel"===(null==(i=this.parentElement)?void 0:i.tagName.toLowerCase())?setTimeout(()=>{null!==this.parentElement&&void 0!==this.parentElement&&(this._cachedParentEl=this.parentElement,this.logger.log(" removes element from DOM due to change in show signal, cached parent element"),null!==this.nextElementSibling&&void 0!==this.nextElementSibling&&(this._nextSiblingIndexInParentChildNodes=Array.from(this.parentElement.childNodes).findIndex(e=>e===this.nextElementSibling),this._cachedNextSibling=this.nextElementSibling,this.logger.log(" cached sibling element")),this._keepListeningOnSignalsAfterRemoval=!0,this._isDetachedFromDom=!0,this.parentElement.removeChild(this))}):null!==this.parentElement&&void 0!==this.parentElement&&(this._cachedParentEl=this.parentElement,this.logger.log(" removes element from DOM due to change in show signal, cached parent element"),null!==this.nextElementSibling&&void 0!==this.nextElementSibling&&(this._nextSiblingIndexInParentChildNodes=Array.from(this.parentElement.childNodes).findIndex(e=>e===this.nextElementSibling),this._cachedNextSibling=this.nextElementSibling,this.logger.log(" cached sibling element")),this._keepListeningOnSignalsAfterRemoval=!0,this._isDetachedFromDom=!0,this.parentElement.removeChild(this))}this.afterHandlingHide()}handleShow(e){if(this.beforeHandlingShow(),this.logger.log("handleShow"),e.classList.remove(this.CSS_CLASS_FOR_HIDE_DISPLAY),e.classList.remove(this.CSS_CLASS_FOR_HIDE_VISIBILITY),null!==this._cachedParentEl&&void 0!==this._cachedParentEl){const e=this._cachedParentEl;if(this._cachedParentEl=null,null!==this._cachedNextSibling&&void 0!==this._cachedNextSibling&&e===this._cachedNextSibling.parentElement){const t=this._cachedNextSibling;this._cachedNextSibling=null,e.insertBefore(this,t),this.logger.log(" inserted element before cached sibling due to change in show signal"),this._keepListeningOnSignalsAfterRemoval=!1}else{if(this._nextSiblingIndexInParentChildNodes){const t=e.childNodes[this._nextSiblingIndexInParentChildNodes];e.insertBefore(this,t)}else e.appendChild(this);this.logger.log(" appended element to parent due to change in show signal"),this._keepListeningOnSignalsAfterRemoval=!1}this._isDetachedFromDom=!1}this.sendShowSignal(!0),this.afterHandlingShow()}beforeHandlingShow(){}afterHandlingShow(){}beforeHandlingHide(){}afterHandlingHide(){}updateForChangeInDisabledStatus(){this.logger.log("updateForChangeInDisabledStatus()");const e=this.getTargetElementForCssClassesAndStyle();e.classList.remove(this.getCssClassDisabled()),!0===this.disabled&&e.classList.add(this.getCssClassDisabled())}getTargetElementForCssClassesAndStyle(){return this}initAttributes(){const e=this;for(let t=0;t<this.componentProperties.length;t++)if(!0===this.componentProperties[t].isObservableProperty&&this.hasAttribute(this.componentProperties[t].name.toLowerCase())){const i=this.componentProperties[t].name;e[i]=this.getAttribute(i)}}clearStringSignalSubscription(e,t){let i=null;if(e){const t=Ch5Signal.getSubscriptionSignalName(e);i=Ch5SignalFactory.getInstance().getStringSignal(t)}null!==i&&""!==t&&i.unsubscribe(t)}clearBooleanSignalSubscription(e,t){let i=null;if(e){const t=Ch5Signal.getSubscriptionSignalName(e);i=Ch5SignalFactory.getInstance().getBooleanSignal(t)}null!==i&&""!==t&&i.unsubscribe(t)}sendShowSignal(e){if(""!==this.sendEventOnShow){const t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnShow);null!==t&&t.publish(e)}}attributeChangeHandler(e,t,i){let s="";return this.hasAttribute(e)&&(s=t!==i?i:t),s}applyPreConfiguredAttributes(){const e=Ch5Config.getAttributesForElement(this);for(const t in e)e.hasOwnProperty(t)&&(this.hasAttribute(t)||this.setAttribute(t,e[t]))}_attributeValueAsString(e){let t="";return e=e.toLowerCase(),this.hasAttribute(e)&&(t=""+this.getAttribute(e)),t}contentCleanUp(){if(this.children.length){Array.from(this.children).forEach(e=>"TEMPLATE"!==e.nodeName&&e.remove())}}getCssClassDisabled(){return"ch5-disabled"}unsubscribeFromSignals(){this._keepListeningOnSignalsAfterRemoval}componentLoadedEvent(e,t){publishEvent("object",e,{loaded:!0,id:t})}updateInViewPortClass(){const e=this.getTargetElementForCssClassesAndStyle();this.elementIsInViewPort?e.classList.add(this.appendClassWhenInViewPort):e.classList.remove(this.appendClassWhenInViewPort)}updateElementVisibility(e){this.elementIsVisible=e}initCommonMutationObserver(e){this._commonMutationObserver=new Ch5MutationObserver(this),this._commonMutationObserver.isConnected=!0;let t=e;for(;Ch5MutationObserver.checkElementValidity(t);)this._commonMutationObserver.observe(t),t=t.parentNode}disconnectCommonMutationObserver(){this.util.isNotNil(this._commonMutationObserver)&&!isEmpty5(this._commonMutationObserver)&&this._commonMutationObserver.disconnectObserver()}convertAnalogValueBasedOnSignalResponse(e){const t=65535,i=-65535;let s=e;return s>32767?(s=s>t?t:s,s-=65536):s<-32768&&(s=s>i?s:i,s+=65536),s}static getSignalElementAttributeRegistryEntries(e){const t={};for(let i=0;i<e.length;i++)if(!0===e[i].isSignal){const s={};e[i].name.toLowerCase().startsWith("receivestate")?s.direction="state":e[i].name.toLowerCase().startsWith("sendevent")&&(s.direction="event"),s.contractName=!0,"string"===e[i].signalType?s.stringJoin=1:"boolean"===e[i].signalType?s.booleanJoin=1:"number"===e[i].signalType&&(s.numericJoin=1),t[e[i].name.toLowerCase()]=s}return t}},Ch5QrCode=class e extends Ch5BaseClass{COMPONENT_NAME="Ch5QrCode";static COMPONENT_PROPERTIES=[Ch5BaseClass.COMMON_PROPERTIES.debug,Ch5BaseClass.COMMON_PROPERTIES.trace,Ch5BaseClass.COMMON_PROPERTIES.id,Ch5BaseClass.COMMON_PROPERTIES.noshowType,Ch5BaseClass.COMMON_PROPERTIES.receiveStateShow,Ch5BaseClass.COMMON_PROPERTIES.show,{default:"#000000",name:"color",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"#000000",isObservableProperty:!0},{default:"#ffffff",name:"backgroundColor",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"#ffffff",isObservableProperty:!0},{default:160,name:"size",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:160,numberProperties:{min:160,max:4e3,conditionalMin:160,conditionalMax:4e3,conditionalMinValue:160,conditionalMaxValue:4e3},isObservableProperty:!0},{default:"",name:"qrCode",nameForSignal:"receiveStateQrCode",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateQrCode",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-qrcode";primaryCssClass="ch5-qrcode";_elContainer={};_canvasContainer={};calcuatedSizeFromCSS=0;set color(e){this._ch5Properties.set("color",e,()=>{this.debounceBuildQrCode()})}get color(){return this._ch5Properties.get("color")}set backgroundColor(e){this._ch5Properties.set("backgroundColor",e,()=>{this.debounceBuildQrCode()})}get backgroundColor(){return this._ch5Properties.get("backgroundColor")}set size(e){this._ch5Properties.set("size",e,()=>{this.debounceBuildQrCode()})}get size(){return this._ch5Properties.get("size")}set qrCode(e){this._ch5Properties.set("qrCode",e,()=>{this.debounceBuildQrCode()})}get qrCode(){return this._ch5Properties.get("qrCode")}set receiveStateQrCode(e){this._ch5Properties.set("receiveStateQrCode",e,null,e=>{this._ch5Properties.setForSignalResponse("qrCode",e,()=>{this.debounceBuildQrCode()})})}get receiveStateQrCode(){return this._ch5Properties.get("receiveStateQrCode")}constructor(){super(e.COMPONENT_PROPERTIES),this._isInstantiated||this.createInternalHtml(),this._isInstantiated=!0,this.initializeCssClasses()}connectedCallback(){super.connectedCallback(),this.logger.start("connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5ComponentLibrary.ROLES.Ch5QrCode),this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-qrcode"),this.appendChild(this._elContainer)),this.initAttributes(),this.initCommonMutationObserver(this),resizeObserver(this._elContainer,this.onWindowResizeHandler.bind(this)),customElements.whenDefined(e.ELEMENT_NAME).then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id),this.debounceBuildQrCode()}),this.logger.stop()}initializeCssClasses(){this._elContainer.classList.contains("ch5-qrcode--size-css")||this._elContainer.classList.add("ch5-qrcode--size-css")}onWindowResizeHandler(){if(this.hasAttribute("size"))this.calcuatedSizeFromCSS=0;else{const t=getComputedStyle(this),i=Number(t.getPropertyValue("--ch5-qrcode--size")),s=e.COMPONENT_PROPERTIES.find(e=>"size"===e.name);s&&s.numberProperties?i>=Number(s.numberProperties.min)&&i<=Number(s.numberProperties.max)?this.calcuatedSizeFromCSS=i:i<Number(s.numberProperties.min)?this.calcuatedSizeFromCSS=s.numberProperties.min:i>Number(s.numberProperties.max)?this.calcuatedSizeFromCSS=s.numberProperties.max:this.calcuatedSizeFromCSS=0:this.calcuatedSizeFromCSS=0}this.handleQrCode()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._canvasContainer=document.createElement("canvas"),this._elContainer.appendChild(this._canvasContainer),this._elContainer.classList.add(this.primaryCssClass),this.appendChild(this._elContainer),this.logger.stop()}debounceBuildQrCode=this.util.debounce(()=>{this.handleQrCode()},50);clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleQrCode(){var t,i;const s=this.qrCode,n=this.querySelector("canvas");let r=this.size;if(!this.hasAttribute("size")&&this.calcuatedSizeFromCSS>0&&(r=this.calcuatedSizeFromCSS),this.hasAttribute("size")?this._elContainer.style.setProperty("--ch5-qrcode--size",String(r)):this._elContainer.style.removeProperty("--ch5-qrcode--size"),n&&(n.setAttribute("width",String(r)),n.setAttribute("height",String(r))),s&&""!==s){let n=Ch5ColorUtils.col2hex(this.color);Ch5ColorUtils.validateColorName(this.color)||(n=null==(t=e.COMPONENT_PROPERTIES.find(e=>"color"===e.name))?void 0:t.default);let a=Ch5ColorUtils.col2hex(this.backgroundColor);Ch5ColorUtils.validateColorName(this.backgroundColor)||(a=null==(i=e.COMPONENT_PROPERTIES.find(e=>"backgroundColor"===e.name))?void 0:i.default);const l={errorCorrectionLevel:"H",type:"image/svg",width:r,margin:3,color:{light:a,dark:n}};QRCode.toCanvas(this._canvasContainer,s,l,function(e){e&&console.error(e)})}else if(n){const e=n.getContext("2d");e&&e.clearRect(0,0,r,r)}}getTargetElementForCssClassesAndStyle(){return this._elContainer}};Ch5ComponentLibrary.registerComponent(Ch5QrCode);var Ch5SegmentedGauge=class e extends Ch5Common{static ORIENTATION=["horizontal","vertical"];static GAUGE_LED_STYLE=["rectangle","circle"];static STATE_GRAPHIC=["green","yellow","red","blue","orange","white","inactive"];static COMPONENT_DATA={ORIENTATION:{default:e.ORIENTATION[0],values:e.ORIENTATION,key:"orientation",attribute:"orientation",classListPrefix:"--orientation-"},GAUGE_LED_STYLE:{default:e.GAUGE_LED_STYLE[0],values:e.GAUGE_LED_STYLE,key:"gaugeLedStyle",attribute:"gaugeLedStyle",classListPrefix:"--gauge-led-style-"},PRIMARY_STATE_GRAPHIC:{default:e.STATE_GRAPHIC[0],values:e.STATE_GRAPHIC,key:"primaryStateGraphic",attribute:"primaryStateGraphic",classListPrefix:"--segment-state-graphic-"},SECONDARY_STATE_GRAPHIC:{default:e.STATE_GRAPHIC[1],values:e.STATE_GRAPHIC,key:"secondaryStateGraphic",attribute:"secondaryStateGraphic",classListPrefix:"--segment-state-graphic-"},TERTIARY_STATE_GRAPHIC:{default:e.STATE_GRAPHIC[2],values:e.STATE_GRAPHIC,key:"tertiaryStateGraphic",attribute:"tertiaryStateGraphic",classListPrefix:"--segment-state-graphic-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,sendeventonclick:{direction:"event",booleanJoin:1,contractName:!0},sendeventonchange:{direction:"event",numericJoin:1,contractName:!0},receivestatevalue:{direction:"state",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:e.ORIENTATION[0],enumeratedValues:e.ORIENTATION,name:"orientation",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ORIENTATION[0],isObservableProperty:!0},{default:e.GAUGE_LED_STYLE[0],enumeratedValues:e.GAUGE_LED_STYLE,name:"gaugeLedStyle",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.GAUGE_LED_STYLE[0],isObservableProperty:!0},{default:e.STATE_GRAPHIC[0],enumeratedValues:e.STATE_GRAPHIC,name:"primaryStateGraphic",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.STATE_GRAPHIC[0],isObservableProperty:!0},{default:e.STATE_GRAPHIC[1],enumeratedValues:e.STATE_GRAPHIC,name:"secondaryStateGraphic",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.STATE_GRAPHIC[1],isObservableProperty:!0},{default:e.STATE_GRAPHIC[2],enumeratedValues:e.STATE_GRAPHIC,name:"tertiaryStateGraphic",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.STATE_GRAPHIC[2],isObservableProperty:!0},{default:0,name:"minValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:0,numberProperties:{min:0,max:65534,conditionalMin:0,conditionalMax:65534,conditionalMinValue:0,conditionalMaxValue:65534},isObservableProperty:!0},{default:65535,name:"maxValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:65535,numberProperties:{min:1,max:65535,conditionalMin:1,conditionalMax:65535,conditionalMinValue:1,conditionalMaxValue:65535},isObservableProperty:!0},{default:20,name:"numberOfSegments",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:20,numberProperties:{min:1,max:50,conditionalMin:1,conditionalMax:50,conditionalMinValue:1,conditionalMaxValue:50},isObservableProperty:!0},{default:0,name:"value",removeAttributeOnNull:!0,nameForSignal:"receiveStateValue",type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:65535,conditionalMin:0,conditionalMax:65535,conditionalMinValue:0,conditionalMaxValue:65535},isObservableProperty:!0},{default:!0,name:"touchSettable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnClick",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnChange",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-segmented-gauge";primaryCssClass="ch5-segmented-gauge";_ch5Properties;_elContainer={};defaultMaxValue=65535;defaultMinValue=0;mouseDown=!1;mouseDragEnd=!1;mouseLeave=!0;eventHandler={mouseover:[],mouseup:[],dragend:[]};_dirtyValue=0;_cleanValue=0;debounceSignalHandling=this.debounce(()=>{this.handleSendEventOnChange(),this.setDirtyHandler()},50);handleDebounceSignal=this.debounce(e=>{this.handleIndexValue(e)},30);setDirtyHandler=this.debounce(()=>{this._dirtyValue!==this._cleanValue&&(this.value=this._cleanValue,this.setValueForSegments())},500);set orientation(e){this._ch5Properties.set("orientation",e,()=>{this.handleOrientation()})}get orientation(){return this._ch5Properties.get("orientation")}set gaugeLedStyle(e){this._ch5Properties.set("gaugeLedStyle",e,()=>{this.handleGaugeLedStyle()})}get gaugeLedStyle(){return this._ch5Properties.get("gaugeLedStyle")}set primaryStateGraphic(e){this._ch5Properties.set("primaryStateGraphic",e,()=>{this.setValueForSegments()})}get primaryStateGraphic(){return this._ch5Properties.get("primaryStateGraphic")}set secondaryStateGraphic(e){this._ch5Properties.set("secondaryStateGraphic",e,()=>{this.setValueForSegments()})}get secondaryStateGraphic(){return this._ch5Properties.get("secondaryStateGraphic")}set tertiaryStateGraphic(e){this._ch5Properties.set("tertiaryStateGraphic",e,()=>{this.setValueForSegments()})}get tertiaryStateGraphic(){return this._ch5Properties.get("tertiaryStateGraphic")}set minValue(e){this._ch5Properties.set("minValue",e,()=>{e>=this.maxValue&&(this.minValue=this.defaultMinValue),this.setValueForSegments()})}get minValue(){return this._ch5Properties.get("minValue")}set maxValue(e){this._ch5Properties.set("maxValue",e,()=>{e<=this.minValue&&(this.maxValue=this.defaultMaxValue),this.setValueForSegments()})}get maxValue(){return this._ch5Properties.get("maxValue")}set numberOfSegments(e){this._ch5Properties.set("numberOfSegments",e,()=>{this.handleNumberOfSegments()})}get numberOfSegments(){return this._ch5Properties.get("numberOfSegments")}set value(e){this._ch5Properties.set("value",e,()=>{e<this.minValue?this.value=this.minValue:e>this.maxValue&&(this.value=this.maxValue),this._cleanValue=this.value,this.setValueForSegments()})}get value(){return this._ch5Properties.get("value")}set touchSettable(e){this._ch5Properties.set("touchSettable",e)}get touchSettable(){return this._ch5Properties.get("touchSettable")}set sendEventOnClick(e){this._ch5Properties.set("sendEventOnClick",e)}get sendEventOnClick(){return this._ch5Properties.get("sendEventOnClick")}set sendEventOnChange(e){this._ch5Properties.set("sendEventOnChange",e)}get sendEventOnChange(){return this._ch5Properties.get("sendEventOnChange")}set receiveStateValue(e){this._ch5Properties.set("receiveStateValue",e,null,e=>{this._ch5Properties.setForSignalResponse("value",e,()=>{this._cleanValue=this.value,this.setValueForSegments()})})}get receiveStateValue(){return this._ch5Properties.get("receiveStateValue")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.ignoreAttributes=["receivestatecustomclass","receivestatecustomstyle","receivestateshowpulse","receivestatehidepulse","sendeventonshow"],this.logger.start("constructor()",e.ELEMENT_NAME),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.initCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-segmented-gauge attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5SegmentedGauge),this._elContainer!==this&&this.appendChild(this._elContainer),this.handleTouchSettable=this.handleTouchSettable.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchMoveEvent=this.handleTouchMoveEvent.bind(this),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.handleNumberOfSegments(),customElements.whenDefined("ch5-segmented-gauge").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),this._elContainer.addEventListener("click",this.handleTouchSettable),this._elContainer.addEventListener("mousedown",this.handleMouseDown),this._elContainer.addEventListener("mouseleave",this.handleMouseLeave),this._elContainer.addEventListener("touchstart",this.handleTouchStart),this._elContainer.addEventListener("touchmove",this.handleTouchMove)}removeEventListeners(){super.removeEventListeners(),this._elContainer.removeEventListener("click",this.handleTouchSettable),this._elContainer.removeEventListener("mousedown",this.handleMouseDown),this._elContainer.removeEventListener("mouseleave",this.handleMouseLeave),this._elContainer.removeEventListener("touchstart",this.handleTouchStart),this._elContainer.removeEventListener("touchmove",this.handleTouchMove),Array.from(this._elContainer.children).forEach((e,t)=>{e.removeEventListener("mouseover",this.eventHandler.mouseover[t]),e.removeEventListener("mouseup",this.eventHandler.mouseup[t]),e.removeEventListener("touchmove",this.handleTouchMoveEvent),e.removeEventListener("dragend",this.eventHandler.dragend[t])})}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleOrientation(){Array.from(e.COMPONENT_DATA.ORIENTATION.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation)}handleGaugeLedStyle(){Array.from(e.COMPONENT_DATA.GAUGE_LED_STYLE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.GAUGE_LED_STYLE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.GAUGE_LED_STYLE.classListPrefix+this.gaugeLedStyle)}handleNumberOfSegments(){Array.from(this._elContainer.querySelectorAll(".ch5-segmented-gauge-segment")).forEach(e=>e.remove());for(let e=0;e<=this.numberOfSegments;e++){const t=document.createElement("div");t.classList.add(this.primaryCssClass+"-segment"),this._elContainer.appendChild(t),0===e&&t.classList.add("ch5-segmented-gauge--segment--state-graphic-hidden"),this.eventHandler.mouseover.push(this.handleMouseOverEvent.bind(this,e)),this.eventHandler.mouseup.push(this.handleMouseUpEvent.bind(this,e)),this.eventHandler.dragend.push(this.handleDragEndEvent.bind(this,e)),t.addEventListener("mouseover",this.eventHandler.mouseover[e]),t.addEventListener("mouseup",this.eventHandler.mouseup[e]),t.addEventListener("touchmove",this.handleTouchMoveEvent),t.addEventListener("dragend",this.eventHandler.dragend[e])}this.setValueForSegments()}handleMouseOverEvent(e){!0===this.mouseDragEnd&&!0===this.mouseLeave?(this.handleDebounceSignal(e),this.mouseDragEnd=!1,this.mouseDown=!1):!0===this.mouseDown&&this.handleDebounceSignal(e)}handleMouseUpEvent(e){!0===this.mouseDown&&(this.mouseDown=!1,this.handleDebounceSignal(e))}handleTouchMoveEvent(e){var t;if(!0===this.mouseDown){const i=document.elementFromPoint(e.touches[0].pageX,e.touches[0].pageY);if(null==i?void 0:i.classList.contains(this.primaryCssClass+"-segment")){const e=Array.prototype.indexOf.call(null==(t=null==i?void 0:i.parentElement)?void 0:t.children,i);this.handleIndexValue(e)}}}handleDragEndEvent(e,t){this.mouseDragEnd=!0,this.handleDebounceSignal(e)}handleIndexValue(e){if(!1===this.touchSettable)return;const t=this._elContainer.querySelectorAll(".ch5-segmented-gauge-segment");for(let i=0;i<t.length-1;i++)e>i?t[i+1].classList.add("active"):t[i+1].classList.remove("active");this._dirtyValue=Math.round(e/this.numberOfSegments*100*(this.maxValue-this.minValue)/100+this.minValue),this.debounceSignalHandling()}handleMouseDown(){this.mouseDown=!0,this.mouseLeave=!0}handleMouseLeave(){this.mouseDown=!1,this.mouseLeave=!1}handleTouchStart(){this.mouseDown=!0,this.mouseLeave=!0}handleTouchMove(e){const t=document.elementFromPoint(e.touches[0].pageX,e.touches[0].pageY);(null==t?void 0:t.classList.contains("ch5-segmented-gauge"))||(null==t?void 0:t.classList.contains("ch5-segmented-gauge-segment"))||(this.mouseDown=!1,this.mouseLeave=!1)}handleTouchSettable(e){!0===this.touchSettable&&this.handleSendEventOnClick()}handleSendEventOnClick(){var e,t;this.sendEventOnClick&&(null==(e=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick))||e.publish(!0),null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick))||t.publish(!1))}handleSendEventOnChange(){var e;this.sendEventOnChange&&(null==(e=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventOnChange))||e.publish(this._dirtyValue))}setValueForSegments(){const t=this._elContainer.querySelectorAll(".ch5-segmented-gauge-segment"),i=Math.round((this.value-this.minValue)*this.numberOfSegments/(this.maxValue-this.minValue)),s=Math.round(60*this.numberOfSegments/100),n=Math.round(25*this.numberOfSegments/100),r=100-s-n;for(let a=0;a<t.length-1;a++)a<this.numberOfSegments&&a<s?t[a+1].classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.PRIMARY_STATE_GRAPHIC.classListPrefix+this.primaryStateGraphic):a<this.numberOfSegments&&a<s+n?t[a+1].classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SECONDARY_STATE_GRAPHIC.classListPrefix+this.secondaryStateGraphic):a<this.numberOfSegments&&a<s+n+r&&t[a+1].classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.TERTIARY_STATE_GRAPHIC.classListPrefix+this.tertiaryStateGraphic),a<i?t[a+1].classList.add("active"):t[a+1].classList.remove("active")}initCssClass(){this.logger.start("initCssClass"),this._elContainer.classList.add(this.primaryCssClass),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.GAUGE_LED_STYLE.classListPrefix+this.gaugeLedStyle),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};Ch5SegmentedGauge.registerCustomElement(),Ch5SegmentedGauge.registerSignalAttributeTypes();import"hammerjs";import _29 from"lodash";var HtmlCallback=class{_pattern=new RegExp("([\\w\\.]*)\\((.*)\\)","i");_callbacks=[];_context={};constructor(e,t){this.context=e,this.prepareCallbacks(t)}run(e){this._callbacks.forEach(t=>{const i=this.getNestedMethod(t.reference);if(!_29.isNil(i))if(this.isNativeMethod(i))i.apply(null,t.arguments);else{let s=t.arguments;_29.isNil(e)?s=t.arguments:s[0]=e,i.apply(this.context,s)}})}set callbacks(e){this._callbacks=e}get callbacks(){return this._callbacks}set context(e){this._context=e}get context(){return this._context}prepareCallbacks(e){if(_29.isNil(e))return;const t=window,i=e.split(";");this._callbacks=i.filter(e=>{if(this._pattern.test(e)){const t=e.match(this._pattern),i=_29.isNil(t)?"":t[1];if(!_29.isUndefined(this.getNestedMethod(i)))return!0;console.warn("Undefined method "+e)}return!1}).map(e=>{const i=e.match(this._pattern),s=_29.isNil(i)?"":i[1];let n=(_29.isNil(i)||_29.isNil(i[2])?"":i[2]).split(",");return n=n.map(e=>{const i=e.replace(/['"]/g,"");return e.indexOf("'")>-1?i:_29.isNaN(parseFloat(e))?"true"===i||"false"===i?"true"===i:t[i]:parseFloat(i)}),{reference:s,arguments:n}})}getNestedMethod(e,t){const i=window;if(_29.isNil(e))return;const s=e.split(".");let n=null;return n=_29.isUndefined(t)?i[s[0]]:t[s[0]],_29.isObject(n)&&!_29.isFunction(n)&&(n=this.getNestedMethod(s[1],n)),n}isNativeMethod(e){return-1!==e.toString().indexOf("[native code]")}};import{isNil as isNil16}from"lodash";var Ch5Select=class e extends Ch5Common{static ELEMENT_NAME="ch5-select";static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatevalue:{direction:"state",stringJoin:1,contractName:!0},receivestatesize:{direction:"state",numericJoin:1,contractName:!0},receivestatetemplatevars:{direction:"state",stringJoin:1,contractName:!0},sendeventonfocus:{direction:"event",booleanJoin:1,contractName:!0},sendeventonchange:{direction:"event",booleanJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static MAX_SIZE=30;static MODE_VALUES=["plain","panel"];static FEEDBACK_MODE_VALUES=["direct","submit"];static COMPONENT_DATA={MODE_VALUES:{default:e.MODE_VALUES[0],values:e.MODE_VALUES,key:"mode_values",classListPrefix:"--"},FEEDBACK_MODE_VALUES:{default:e.FEEDBACK_MODE_VALUES[0],values:e.FEEDBACK_MODE_VALUES,key:"feedback_mode_values",classListPrefix:"--"}};static DEFAULT_SIGNAL_VALUE_SYNC_TIMEOUT=1500;static PLACEHOLDER_DEFAULT="";static CH5_SELECT_MAIN_STYLE_CLASS="ch5-select";static OPENED_STYLE_CLASS="ch5-select__panel-open";static MAIN_PANEL_STYLE_CLASS="ch5-select__main";static SELECTED_ITEMS_STYLE_CLASS="ch5-select__selected_items";static MODE_PANEL_STYLE_CLASS="ch5-select__panel";static MODE_COMBO_STYLE_CLASS="ch5-select__combo";static PANEL_ITEMS_STYLE_CLASS="ch5-select__panel__items";static COMBO_TRIGGER_STYLE_CLASS="ch5-select__combo_trigger";static PANEL_ITEM_STYLE_CLASS="ch5-select__panel__item";static SELECTION_IN_PROGRESS_STYLE_CLASS="ch5-select__selection-in-progress";static ITEM_SELECTED_STYLE_CLASS="ch5-select__panel__item--selected";primaryCssClass="ch5-select";iconPosition="first";mainPanel={};selectedOptionsPanel={};selectPanel={};comboTrigger={};templateVarsData=[];_selectionTimeout=null;_multiselectionTimeout=null;receiveStateSizeSubscription="";receiveStateValueSubscription="";receiveStateTemplateVarsSubscription="";_optionTemplateHTML="";_lastReceivedSignalValue=-1;_cleanValue=-1;_lastSelectedOptIdx=null;_size=0;_multiselect=!1;_selectedValue=-1;_selectedValues=[];_cleanValues=[];_multiselectedValuesMap=[];_panelScrollHeight="0px";_minWidth="";_maxWidth="";_minHeight="";_maxHeight="";_resize=!1;_mode=e.MODE_VALUES[0];_feedbackMode=e.FEEDBACK_MODE_VALUES[0];_signalValueSyncTimeout=e.DEFAULT_SIGNAL_VALUE_SYNC_TIMEOUT;_indexId="";_receiveStateValue=null;_receiveStateSize=null;_receiveStateTemplateVars=null;_sendEventOnFocus=null;_sendEventOnChange=null;_dirty=!1;_ondirtyCallback={};_oncleanCallback={};_noneSelectedPrompt=e.PLACEHOLDER_DEFAULT;_comboTriggerHammer=null;constructor(){super(),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._handleSelectPanelToggle=this._handleSelectPanelToggle.bind(this),this._handleOptionSelected=this._handleOptionSelected.bind(this),this.closeSelectPanel=this.closeSelectPanel.bind(this),this._wasInstatiated=!1}set ondirtyCallback(e){null==e&&(e={}),this._ondirtyCallback=e}get ondirtyCallback(){return this._ondirtyCallback}set ondirty(e){this.ondirtyCallback=e}get ondirty(){return this.ondirtyCallback}set oncleanCallback(e){null==e&&(e={}),this._oncleanCallback=e}get oncleanCallback(){return this._oncleanCallback}set onclean(e){this.oncleanCallback=e}get onclean(){return this.oncleanCallback}connectedCallback(){Promise.all([customElements.whenDefined("ch5-select")]).then(()=>{this.info("connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Select),this.setAttribute("data-ch5-id",this.getCrId()),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Spinner),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this._initOptionTemplate(),""===this._optionTemplateHTML?(this.info("add mutation observer in order to extract template data"),this._startReadyObserver()):(this.info("connectedCallback initializations"),this.initializations()),this.initCommonMutationObserver(this),this.info("Callback loaded - ch5-select"),this._wasInstatiated=!0})}disconnectedCallback(){this.removeEventListeners(),this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver()}unsubscribeFromSignals(){this.info("unsubscribeFromSignal()"),super.unsubscribeFromSignals(),this.clearStringSignalSubscription(this._receiveStateSize,this.receiveStateSizeSubscription),this._receiveStateSize="",this.clearStringSignalSubscription(this._receiveStateTemplateVars,this.receiveStateTemplateVarsSubscription),this._receiveStateTemplateVars="",this.clearStringSignalSubscription(this._receiveStateValue,this.receiveStateValueSubscription),this._receiveStateValue=""}initializations(){this._addMainClass(),this._updateModeClass(),this.initAttributes(),this.multiselect?this._cleanValues=this.selectedValues.slice(0):this._cleanValue=this.selectedValue,this._createMainPanel(),this.templateVarsData=this._getTemplateVarsFromDefaultConfig(),this.selectedOptionsPanel.innerHTML=this.noneSelectedPrompt,this._updateCh5SelectDimensions(),this.shouldComputeDropdownHeight(),this._createSelectPanel(),this.attachEventListeners()}shouldComputeDropdownHeight(){if(this.panelScrollHeight.toString().includes("%")&&!isNil16(this.parentElement)&&this.parentElement.offsetHeight>0){const e=parseInt(this.panelScrollHeight,10);this.panelScrollHeight=e>0?this.parentElement.offsetHeight/100*e+"px":""}}_initOptionTemplate(){if(""!==this._optionTemplateHTML||!0===this._wasInstatiated)return;const e=this.getElementsByTagName("template")[0];e&&e.innerHTML&&e.innerHTML.length>0?(this.info("optionTemplate.innerHtml ",e.innerHTML),this._validateTmplFirstElAsCh5SelectOption(e.content),this._optionTemplateHTML=e.innerHTML.trim(),e.remove()):e&&e.firstElementChild&&e.firstElementChild.outerHTML&&e.firstElementChild.outerHTML.length>0&&(this.info("optionTemplate.firstElementChild.outerHTML ",e.firstElementChild.outerHTML),this._validateTmplFirstElAsCh5SelectOption(e),this._optionTemplateHTML=e.firstElementChild.outerHTML.trim(),e.remove())}_startReadyObserver(){if(this.querySelector("."+e.MAIN_PANEL_STYLE_CLASS))return this.mainPanel=this.querySelector("."+e.MAIN_PANEL_STYLE_CLASS),this.selectedOptionsPanel=this.querySelector("."+e.SELECTED_ITEMS_STYLE_CLASS),this.selectPanel=this.querySelector("."+e.PANEL_ITEMS_STYLE_CLASS),void this.attachEventListeners();const t=new MutationObserver(e=>{this.info("mutationObserver Callback"),e.forEach(e=>{if(this.info("mutation",e),"childList"===e.type&&e.addedNodes&&e.addedNodes.length>0){let i=null;for(let t=0;t<e.addedNodes.length;t++)if("template"===e.addedNodes[t].nodeName.toLowerCase()){i=e.addedNodes[t];break}if(null!==i){this.info("templateElement innerhtml",i.innerHTML),this._validateTmplFirstElAsCh5SelectOption(i);let e=i.innerHTML;""===e.trim()&&(e=i.firstElementChild.outerHTML,this._optionTemplateHTML=e,this.initializations(),t.disconnect(),i.remove())}}})});t.observe(this,{childList:!0,subtree:!1,attributes:!1,characterData:!1})}_validateTmplFirstElAsCh5SelectOption(e){if("ch5-select-option"!==e.firstElementChild.nodeName.toLowerCase())throw new Error(`ch5-select, id: ${this.getAttribute("data-ch5-id")}\n - no ch5-select-option provided`)}_updateCh5SelectDimensions(){let e=(this._getStyleWidthProps()+this._getStyleHeightProps()).trim();""===e&&(e=this._getCssDimensionsUsingParent(!0)),this.style.cssText+=e,this._isValidElement(this.mainPanel)&&(this.mainPanel.style.cssText=this._getStyleHeightProps())}_createMainPanel(){!0!==this._wasInstatiated&&(this.mainPanel=document.createElement("div"),this.mainPanel.classList.add(e.MAIN_PANEL_STYLE_CLASS),this.selectedOptionsPanel=document.createElement("div"),this.selectedOptionsPanel.classList.add(e.SELECTED_ITEMS_STYLE_CLASS),this.mainPanel.appendChild(this.selectedOptionsPanel),this._createComboTrigger(),this.appendChild(this.mainPanel))}_createSelectPanel(){this.selectPanel instanceof HTMLElement&&(this.selectPanel.remove(),this.selectPanel={}),this.selectPanel=document.createElement("div"),this.selectPanel.classList.add(e.PANEL_ITEMS_STYLE_CLASS),this.appendChild(this.selectPanel),this._updateSelectPanelScrollHeight(),this._applyResize(),this.renderCh5SelectOptions()}_createComboTrigger(){!this._isPanel()&&this._isValidElement(this.mainPanel)&&(this.comboTrigger=document.createElement("span"),this.comboTrigger.classList.add(e.COMBO_TRIGGER_STYLE_CLASS),this.comboTrigger.innerHTML=this._getCh5SelectOpenTriggerIcon(),this.mainPanel.appendChild(this.comboTrigger))}_handleSelectPanelToggle(){this._isOpened()?this.closeSelectPanel():this.openSelectPanel()}_isOpened(){return this.classList.contains(e.OPENED_STYLE_CLASS)}openSelectPanel(){this.classList.contains(e.SELECTION_IN_PROGRESS_STYLE_CLASS)||this.classList.add(e.OPENED_STYLE_CLASS)}closeSelectPanel(){this.classList.remove(e.OPENED_STYLE_CLASS)}static get observedAttributes(){return Ch5Common.observedAttributes.concat(["size","iconposition","multiselect","selectedvalue","panelscrollheight","minwidth","maxwidth","minheight","maxheight","resize","mode","feedbackmode","signalvaluesynctimeout","indexid","receivestatevalue","receivestatesize","receivestatetemplatevars","sendeventonfocus","sendeventonchange","noneselectedprompt","ondirty","onclean"])}attributeChangedCallback(t,i,s){if(i!==s){switch(this.info('ch5-select attributeChangedCallback("'+t+'","'+i+'","'+s+")"),t){case"size":this.size=this.getAttribute("size")||1;break;case"multiselect":this.multiselect=this.hasAttribute("multiselect");break;case"selectedvalue":this.selectedValue=this.getAttribute("selectedValue")||0;break;case"panelscrollheight":this.panelScrollHeight=this.getAttribute("panelScrollHeight")||"";break;case"minwidth":this.minWidth=this.getAttribute("minWidth")||"";break;case"maxwidth":this.maxWidth=this.getAttribute("maxWidth")||"";break;case"minheight":this.minHeight=this.getAttribute("minHeight")||"";break;case"maxheight":this.maxHeight=this.getAttribute("maxHeight")||"";break;case"resize":this.resize=this.hasAttribute("resize");break;case"mode":this.mode=this.getAttribute("mode")||e.MODE_VALUES[0];break;case"feedbackmode":this.feedbackMode=this.getAttribute("feedbackMode")||e.FEEDBACK_MODE_VALUES[0];break;case"signalvaluesynctimeout":this.signalValueSyncTimeout=this.getAttribute("signalValueSyncTimeout")||e.DEFAULT_SIGNAL_VALUE_SYNC_TIMEOUT;break;case"indexid":this.indexId=this.getAttribute("indexId")||"";break;case"receivestatevalue":this.receiveStateValue=this.getAttribute("receiveStateValue")||"";break;case"receivestatesize":this.receiveStateSize=this.getAttribute("receiveStateSize")||"";break;case"receivestatetemplatevars":this.receiveStateTemplateVars=this.getAttribute("receiveStateTemplateVars")||"";break;case"sendeventonfocus":this.sendEventOnFocus=this.getAttribute("sendEventOnFocus")||"";break;case"sendeventonchange":this.sendEventOnChange=this.getAttribute("sendEventOnChange")||"";break;case"noneselectedprompt":this.noneSelectedPrompt=this.getAttribute("noneSelectedPrompt");break;case"ondirty":this.ondirtyCallback=new HtmlCallback(this,this.getAttribute("ondirty"));break;case"onclean":this.oncleanCallback=new HtmlCallback(this,this.getAttribute("onclean"));break;default:super.attributeChangedCallback(t,i,s)}"dir"===t&&this._updateOptionsDirAttr()}}initAttributes(){super.initAttributes(),this.info("initAttributes()"),this.hasAttribute("size")&&(this.size=this.getAttribute("size")),this.multiselect=this.hasAttribute("multiselect"),this.hasAttribute("selectedValue")&&(this.selectedValue=this.getAttribute("selectedValue")),this.hasAttribute("panelScrollHeight")&&(this.panelScrollHeight=this.getAttribute("panelScrollHeight")),this.hasAttribute("minWidth")&&(this.minWidth=this.getAttribute("minWidth")),this.hasAttribute("maxWidth")&&(this.maxWidth=this.getAttribute("maxWidth")),this.hasAttribute("minHeight")&&(this.minHeight=this.getAttribute("minHeight")),this.hasAttribute("maxHeight")&&(this.maxHeight=this.getAttribute("maxHeight")),this.resize=this.hasAttribute("resize"),this.hasAttribute("mode")&&(this.mode=this.getAttribute("mode")),this.hasAttribute("feedbackMode")&&(this.feedbackMode=this.getAttribute("feedbackMode")),this.hasAttribute("signalValueSyncTimeout")&&(this.signalValueSyncTimeout=this.getAttribute("signalValueSyncTimeout")),this.hasAttribute("indexId")&&(this.indexId=this.getAttribute("indexId")),this.hasAttribute("receiveStateValue")&&(this.receiveStateValue=this.getAttribute("receiveStateValue")),this.hasAttribute("receiveStateSize")&&(this.receiveStateSize=this.getAttribute("receiveStateSize")),this.hasAttribute("receiveStateTemplateVars")&&(this.receiveStateTemplateVars=this.getAttribute("receiveStateTemplateVars")),this.hasAttribute("sendEventOnFocus")&&(this.sendEventOnFocus=this.getAttribute("sendEventOnFocus")),this.hasAttribute("sendEventOnChange")&&(this.sendEventOnChange=this.getAttribute("sendEventOnChange")),this.hasAttribute("noneSelectedPrompt")&&(this.noneSelectedPrompt=this.getAttribute("noneSelectedPrompt"))}attachEventListeners(){super.attachEventListeners(),this.removeEventListeners(),this.addEventListener("focus",this._onFocus),this.addEventListener("blur",this._onBlur),this.addEventListener("option-selected",this._handleOptionSelected),this._isPlain()&&(this.addEventListener("blur",this.closeSelectPanel),this._comboTriggerHammer=new Hammer.Manager(this.mainPanel),this._comboTriggerHammer.add(new Hammer.Tap({event:"tap"})),this._comboTriggerHammer.on("tap",this._handleSelectPanelToggle))}removeEventListeners(){super.removeEventListeners(),this.removeEventListener("focus",this._onFocus),this.removeEventListener("blur",this._onBlur),this.removeEventListener("option-selected",this._handleOptionSelected),this._isPlain()&&(null!==this._comboTriggerHammer&&this._comboTriggerHammer.off("tap",this._handleSelectPanelToggle),this.removeEventListener("blur",this.closeSelectPanel))}set size(e){e=Number(e),(isNaN(e)||e<1)&&(e=1),this._size!==e&&(this._size=e,this.setAttribute("size",e.toString()),this.renderCh5SelectOptions())}get size(){return this.hasTemplateVars()&&this.templateVarsData.length>this._size?this._size:this.hasTemplateVars()?this.templateVarsData.length:this._size}set multiselect(e){this._multiselect!==e&&(this._multiselect=e,!0===e?this.setAttribute("multiselect",e.toString()):this.removeAttribute("multiselect"))}get multiselect(){return this._multiselect}set selectedValue(e){e=Number(e),isNaN(e)&&(e=0),this._selectedValue!==e&&(this._selectedValue=e,this.setAttribute("selectedvalue",e.toString()),this._markOptionAsSelected(this.selectedValue),this._updateSingleSelectionInMainPanel(),!0===this.getDirty()&&this._selectedValue===this._cleanValue&&(this.dirty=!1))}get selectedValue(){return this._selectedValue}set selectedValues(e){e instanceof Array==!1&&(e=[]),this._selectedValues=e,this._updateMultiSelectionInMainPanel()}get selectedValues(){return this._selectedValues}set panelScrollHeight(e){e=this._checkAndSetStringValue(e),this._panelScrollHeight!==e&&(this._panelScrollHeight=e,this.setAttribute("panelscrollheight",e.toString()),this._updateSelectPanelScrollHeight())}get panelScrollHeight(){return this._panelScrollHeight}set minWidth(e){e=this._checkAndSetStringValue(e),this._minWidth!==e&&(this._minWidth=e,this.setAttribute("minwidth",e))}get minWidth(){return this._minWidth}set maxWidth(e){e=this._checkAndSetStringValue(e),this._maxWidth!==e&&(this._maxWidth=e,this.setAttribute("maxwidth",e))}get maxWidth(){return this._maxWidth}set minHeight(e){e=this._checkAndSetStringValue(e),this._minHeight!==e&&(this._minHeight=e,this.setAttribute("minheight",e))}get minHeight(){return this._minHeight}set maxHeight(e){e=this._checkAndSetStringValue(e),this._maxHeight!==e&&(this._maxHeight=e,this.setAttribute("maxheight",e))}get maxHeight(){return this._maxHeight}set resize(e){this._resize!==e&&(this._resize=e,!0===e?this.setAttribute("resize",e.toString()):this.removeAttribute("resize"),this._applyResize())}get resize(){return this._resize}set mode(t){e.MODE_VALUES.some(e=>e===t)||(t=e.MODE_VALUES[0]),this._mode!==t&&(this._mode=t,this.setAttribute("mode",t.toString()),this._updateModeClass())}get mode(){return this._mode}_isPlain(){return this.mode===e.MODE_VALUES[0]}_isPanel(){return this.mode===e.MODE_VALUES[1]}set feedbackMode(t){e.FEEDBACK_MODE_VALUES.some(e=>e===t)||(t=e.FEEDBACK_MODE_VALUES[0]),this._feedbackMode!==t&&(this._feedbackMode=t,this.setAttribute("feedbackmode",t.toString()))}get feedbackMode(){return this._feedbackMode}set signalValueSyncTimeout(t){t=Number(t),(isNaN(t)||t<0)&&(t=e.DEFAULT_SIGNAL_VALUE_SYNC_TIMEOUT),this._signalValueSyncTimeout!==t&&(this._signalValueSyncTimeout=t,this.setAttribute("signalvaluesynctimeout",t.toString()))}get signalValueSyncTimeout(){return this._signalValueSyncTimeout}set indexId(e){e=this._checkAndSetStringValue(e),this._indexId!==e&&(this._indexId=e,this.setAttribute("indexid",e))}get indexId(){return this._indexId}set receiveStateValue(e){e=this._checkAndSetStringValue(e),this._receiveStateValue!==e&&(this._receiveStateValue=e,this.setAttribute("receivestatevalue",e),this._handleReceiveSignalValue())}get receiveStateValue(){return this._attributeValueAsString("receivestatevalue")}set receiveStateSize(e){e=this._checkAndSetStringValue(e),this._receiveStateSize!==e&&(this._receiveStateSize=e,this.setAttribute("receivestatesize",e),this._handleReceiveSignalSize())}get receiveStateSize(){return this._attributeValueAsString("receivestatesize")}set receiveStateTemplateVars(e){e=this._checkAndSetStringValue(e),this._receiveStateTemplateVars!==e&&(this._receiveStateTemplateVars=e,this.setAttribute("receivestatetemplatevars",e),this._handleReceiveSignalTemplateVars())}get receiveStateTemplateVars(){return this._attributeValueAsString("receivestatetemplatevars")}set sendEventOnFocus(e){e=this._checkAndSetStringValue(e),this._sendEventOnFocus!==e&&(this._sendEventOnFocus=e,this.setAttribute("sendeventonfocus",e))}get sendEventOnFocus(){return this._sendEventOnFocus}set sendEventOnChange(e){e=this._checkAndSetStringValue(e),this._sendEventOnChange!==e&&(this._sendEventOnChange=e,this.setAttribute("sendeventonchange",e))}get sendEventOnChange(){return this._sendEventOnChange}_getStyleWidthProps(){return`${null===this.minWidth||""===this.minWidth?"":`min-width:${this.minWidth};`} ${null==this.maxWidth||""===this._maxWidth?"":`max-width:${this.maxWidth};`}`}_getStyleHeightProps(){return`${null===this.minHeight||""===this.minHeight?"":`min-height:${this.minHeight};`} ${null===this.maxHeight||""===this.maxHeight?"":`max-height:${this.maxHeight};`}`}_getCh5SelectOpenTriggerIcon(){return'<svg role="img" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path></svg>'}_getCssDimensionsUsingParent(e){const t=this.parentElement;if(t&&this._isValidElement(t)){const i=t.getBoundingClientRect();let s="";if(i.width>0&&(s=`min-width: 0; max-width:${i.width}px;`),e)return s;let n="";return i.height>0&&(n=`min-height: 0; max-height:${i.height}px;`),s+n}return""}_updateSelectPanelScrollHeight(){this._isValidElement(this.selectPanel)&&(this.selectPanel.style.maxHeight=parseFloat(this.panelScrollHeight)>0?this.panelScrollHeight:"")}_applyResize(){const e=this.parentElement;if(e&&this._isValidElement(this.selectPanel))if(e.style.position="relative",this.resize){const t=e.getBoundingClientRect();this.selectPanel.style.width="auto",this.selectPanel.style.maxWidth=`${t.width}px`;const i=this.getBoundingClientRect(),s=Math.abs(t.left-i.left);this.selectPanel.style.left=`${s}px`}else this.selectPanel.style.removeProperty("width"),this.selectPanel.style.removeProperty("maxWidth"),this.selectPanel.style.removeProperty("left")}_isValidElement(e){return"object"==typeof e&&e instanceof HTMLElement}_addMainClass(){this.classList.add(e.CH5_SELECT_MAIN_STYLE_CLASS)}_updateModeClass(){this._isPlain()?(this.classList.remove(e.MODE_PANEL_STYLE_CLASS),this.classList.add(e.MODE_COMBO_STYLE_CLASS)):(this.classList.remove(e.MODE_COMBO_STYLE_CLASS),this.classList.add(e.MODE_PANEL_STYLE_CLASS))}_getOptionTemplateWithReplacedVars(e,t){const i=this.getOptionTemplateVars(t);return null!==i&&Object.keys(i).forEach(t=>{const s="{{"+t+"}}",n=i[t];e=this.textReplace(e,s,n,!0)}),e}_getProcessedOptionEl(e){let t=this._optionTemplateHTML;this.hasTemplateVars()&&(t=this._getOptionTemplateWithReplacedVars(t,e));const i=document.createElement("template");return i.innerHTML=t,null!==this.indexId&&(Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(i,e,this.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(i,e,this.indexId)),i.content.firstChild}getOptionsListSize(){return this.selectPanel.querySelectorAll("ch5-select-option").length}buildOptions(t){t=void 0!==t?t:0,this.info(`Build ch5-select options starting with index: ${t}`);for(let i=t;i<this.size;i++){const t=this._getProcessedOptionEl(i),s=i;t.setAttribute("data-ch5-opt-idx",String(s)),t.classList.add(e.PANEL_ITEM_STYLE_CLASS),t.dir=this.dir,this.selectPanel.appendChild(t)}Ch5AugmentVarSignalsNames.differentiateTmplElemsAttrs(this,this.getAttribute("contractname")||"",parseInt(this.getAttribute("booleanjoinoffset")||"0",10)||0,parseInt(this.getAttribute("numericJoinOffset")||"0",10)||0,parseInt(this.getAttribute("stringJoinOffset")||"0",10)||0)}removeLastOptsFromList(e,t){for(let i=e;i<t;i++){const e=i,t=this._getOptionElByIdx(e);t instanceof HTMLElement&&(this.info(`Removing ch5-select-option ${e}`),t.remove())}}renderCh5SelectOptions(){if(!this._isValidElement(this.selectPanel))return;const e=this.getOptionsListSize();0===e?this.buildOptions():this.size<e?this.removeLastOptsFromList(this.size,e):this.size>e&&this.buildOptions(e),this.multiselect?(this.selectedValues.forEach(e=>{const t=this._getOptionElByIdx(e);t&&this._setOptionSelected(t)}),this._updateMultiSelectionInMainPanel()):(this._markOptionAsSelected(this.selectedValue),this._updateSingleSelectionInMainPanel())}textReplace(e,t,i,s){let n="";return"string"==typeof e&&""!==e&&(n=!0===s?e.replace(new RegExp(t,"g"),i):e.replace(new RegExp(t),i)),n}_getTemplateVarsFromDefaultConfig(){return Ch5Config.getTemplateVarsForElement(this)}hasTemplateVars(){return this.templateVarsData.length>0}getOptionTemplateVars(e){const t=this.templateVarsData[e];return null!==t&&"object"==typeof t&&Object.keys(t).length>0?t:null}_unsubscribeOldSignal(e,t,i){let s=null;const n=Ch5Signal.getSubscriptionSignalName(e);switch(i){case"number":s=Ch5SignalFactory.getInstance().getNumberSignal(n);break;case"string":s=Ch5SignalFactory.getInstance().getStringSignal(n)}null!==s&&""!==t&&(s.unsubscribe(t),this.receiveStateSizeSubscription="")}_handleReceiveSignalSize(){if(""!==this.receiveStateSize&&""!==this.receiveStateSizeSubscription&&(this._unsubscribeOldSignal(this.receiveStateSize,this.receiveStateSizeSubscription,"number"),this.receiveStateSizeSubscription=""),""===this.receiveStateSize||null===this.receiveStateSize)return;const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateSize),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&(this.receiveStateSizeSubscription=t.subscribe(e=>{const i=Number(e);!isNaN(i)&&t.hasChangedSinceInit()?(this.info(`Received new size signal value: ${e}`),this.setAttribute("size",String(i))):this.info("Ch5Select receiveSizeSignal signal value for "+this.getAttribute("data-ch5-id")+" is invalid")}))}_handleReceiveSignalTemplateVars(){if(""!==this.receiveStateTemplateVars&&""!==this.receiveStateTemplateVarsSubscription&&(this._unsubscribeOldSignal(this.receiveStateTemplateVars,this.receiveStateTemplateVarsSubscription,"string"),this.receiveStateTemplateVarsSubscription=""),""===this.receiveStateTemplateVars||null===this.receiveStateTemplateVars)return;const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateTemplateVars),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&(this.receiveStateTemplateVarsSubscription=t.subscribe(e=>{let t=null;try{t=JSON.parse(e)}catch(e){this.info("Ch5Select receiveTemplateVarsSignal signal value for "+this.getAttribute("data-ch5-id")+" cannot be parsed")}t instanceof Array&&null!==t?(this.templateVarsData=t,this.selectPanel.innerHTML="",this.renderCh5SelectOptions()):this.info("Ch5Select receiveTemplateVarsSignal signal value for "+this.getAttribute("data-ch5-id")+" is invalid")}))}_setSelectionTimeoutCallback(e){const t=""===this.receiveStateValue||null===this.receiveStateValue||void 0===this.receiveStateValue||""===this.receiveStateValueSubscription,i=this._optionsHaveReceiveSignalSelectedAttr();t&&!i||(null!==this._selectionTimeout&&(clearTimeout(this._selectionTimeout),this._selectionTimeout=null),this.info("New selection timeout set..."),this._selectionTimeout=window.setTimeout(()=>{const t=i?this._cleanValue:this.lastReceivedSignalValue;t!==e&&(this.setAttribute("selectedValue",String(t)),this._fireChangeEvent(t,e),this.info("Selection timeout: selectedValue was updated to the last value received from receivedSignalValue or receiveStateSelected signals: "+t),this.dirty=!1),clearTimeout(this._selectionTimeout),this._selectionTimeout=null},this._signalValueSyncTimeout))}_handleOptionSelected(e){const t=e.detail.set;let i=e.detail.idx;if(this.multiselect){const s=this._getOptionElByIdx(i),n=e.detail.confirmed||!1;this._updateMultiselectedValuesMap(t,i,n),t?(this._addToSelectedOptions(i),this._setOptionSelected(s)):(this._removeFromSelectedOptions(i),this._unsetOptionSelected(s)),this.dirty=!0,this._hasFeedbackModeSubmit()||this._setMultiselectionTimeoutCallback(),this._multiselectValuesAreAllConfirmed()&&(this.info("Multi-selection confirmed, cancel confirmation timeout fallback..."),null!==this._multiselectionTimeout&&(clearTimeout(this._multiselectionTimeout),this._multiselectionTimeout=null),this._multiselectionTimeoutCallback())}else{const s=this.selectedValue;if(e.detail.resetDirty&&(this.dirty=!1,this._cleanValue=t||s!==i?i:0),!t){if(s!==i)return;i=-1,this._lastSelectedOptIdx=s}if(s!==i){const n=this._getOptionElByIdx(t?i:s);n instanceof HTMLElement&&(t?this._markOptionAsSelected(i,n):this._unsetOptionSelected(n),this._closeSelectPanelIfPlain(),this.setAttribute("selectedValue",String(i)),!0!==e.detail.resetDirty&&i!==this._cleanValue&&(this.dirty=!0),this._fireChangeEvent(i,s),this._hasFeedbackModeSubmit()||(this._setSelectionTimeoutCallback(i),this.sendOnChangeSignal(i)))}else s===i&&this._closeSelectPanelIfPlain()}}_multiselectValuesAreAllConfirmed(){return this._multiselectedValuesMap.every(e=>!0===e.confirmed)}_optionsHaveReceiveSignalSelectedAttr(){const e=document.createElement("template");e.innerHTML=this._optionTemplateHTML;const t=e.content.firstChild;return null!==t&&t.hasAttribute("receiveStateSelected")&&null!==t.getAttribute("receiveStateSelected")}_setMultiselectionTimeoutCallback(){this._optionsHaveReceiveSignalSelectedAttr()&&(null!==this._multiselectionTimeout&&(clearTimeout(this._multiselectionTimeout),this._multiselectionTimeout=null),this.info("New multi-selection timeout set..."),this._multiselectionTimeout=window.setTimeout(()=>{this._multiselectionTimeoutCallback(),clearTimeout(this._multiselectionTimeout),this._multiselectionTimeout=null},this._signalValueSyncTimeout))}_multiselectionTimeoutCallback(){const e=this._multiselectedValuesMap.length>0?this._multiselectedValuesMap.filter(e=>{const t=this._isCleanValue(e.idx);if(!t&&e.selected&&e.confirmed||t&&!e.selected&&!e.confirmed)return 0===e.idx?"0":e.idx}).map(e=>e.idx):[],t=this._multiselectedValuesMap.length>0?this._multiselectedValuesMap.filter(e=>{const t=this._isCleanValue(e.idx);if((t||0===t)&&!e.selected&&e.confirmed)return 0===e.idx?"0":e.idx}).map(e=>e.idx):[],i=this._cleanValues.filter(i=>-1===e.indexOf(i)&&-1===t.indexOf(i)),s=[...e,...i].sort((e,t)=>e-t);this.info("Update multiselect selected values using confirmed values and previous unchanged selected values",s),this.setValue(s)}_isCleanValue(e){return this._cleanValues.filter(t=>t===e)[0]}_updateMultiselectedValuesMap(e,t,i){if("number"!=typeof t)return;const s=this._isCleanValue(t),n=this._multiselectedValuesMap.filter(e=>e.idx===t)[0];!this._hasFeedbackModeSubmit()||!n||s||e?n?(n.selected=e,n.confirmed=i):this._multiselectedValuesMap.push({idx:t,selected:e,confirmed:i}):this._multiselectedValuesMap=this._multiselectedValuesMap.filter(e=>e.idx!==t)}_hasFeedbackModeSubmit(){return this.feedbackMode===e.FEEDBACK_MODE_VALUES[1]}_fireChangeEvent(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{newValue:e,oldValue:t},bubbles:!0,cancelable:!1}))}_fireDirtyOrCleanEvent(){this._hasFeedbackModeSubmit()&&(this.dirty?(this.dispatchEvent(new CustomEvent("dirty",{bubbles:!0,cancelable:!1})),this.ondirtyCallback instanceof HtmlCallback?this.ondirtyCallback.run({}):this.ondirtyCallback instanceof Function&&this.ondirtyCallback()):(this.dispatchEvent(new CustomEvent("clean",{bubbles:!0,cancelable:!1})),this.oncleanCallback instanceof HtmlCallback?this.oncleanCallback.run({}):this.oncleanCallback instanceof Function&&this.oncleanCallback()))}sendOnChangeSignal(e){if("string"!=typeof this.sendEventOnChange||""===this.sendEventOnChange)return;const t=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventOnChange);null!==t&&t.publish(e)}_markOptionAsSelected(t,i){if(this.multiselect||!this._isValidElement(this.selectPanel))return;const s=this.querySelector("ch5-select-option."+e.ITEM_SELECTED_STYLE_CLASS);if(this._unsetOptionSelected(s),t>=0){void 0===i&&(i=null);const e=null!==i?i:this._getOptionElByIdx(t);this._setOptionSelected(e)}}_setOptionSelected(e){e instanceof HTMLElement&&"function"==typeof e.applySelectedStyleClass&&e.applySelectedStyleClass()}_unsetOptionSelected(e){e instanceof HTMLElement&&"function"==typeof e.removeSelectedStyleClass&&e.removeSelectedStyleClass()}_getOptionElByIdx(e){return this.querySelector(`ch5-select-option[data-ch5-opt-idx="${e}"]`)}_handleReceiveSignalValue(){if(""!==this.receiveStateValue&&""!==this.receiveStateValueSubscription&&(this._unsubscribeOldSignal(this.receiveStateValue,this.receiveStateValueSubscription,"number"),this.receiveStateValueSubscription=""),this.multiselect||""===this.receiveStateValue||null===this.receiveStateValue)return;const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&(this.receiveStateValueSubscription=t.subscribe(e=>{const i=Number(e);if(!isNaN(i)&&t.hasChangedSinceInit())if(this.info(`Received signal value: ${e}`),this.lastReceivedSignalValue=i,null===this._selectionTimeout){const e=this.selectedValue;this.setAttribute("selectedValue",String(this.lastReceivedSignalValue)),this.dirty=!1,this._fireChangeEvent(this.lastReceivedSignalValue,e)}else Number(this.selectedValue)===this.lastReceivedSignalValue&&(this.dirty=!1);else this.info("Ch5Select receiveStateValue signal value for "+this.getAttribute("data-ch5-id")+" is invalid")}))}_addToSelectedOptions(e){"number"==typeof e&&-1===this.selectedValues.indexOf(e)&&(this.selectedValues.push(e),this.selectedValues.sort((e,t)=>e-t),this._updateMultiSelectionInMainPanel())}_removeFromSelectedOptions(e){"number"==typeof e&&(this.selectedValues=this.selectedValues.filter(t=>t!==e))}_closeSelectPanelIfPlain(){this._isPlain()&&setTimeout(()=>{this.closeSelectPanel()},100)}submit(){if(this._hasFeedbackModeSubmit()&&this.getDirty())if(this.multiselect)this.info("submit():",this._multiselectedValuesMap),this._setMultiselectionTimeoutCallback(),this._multiselectedValuesMap.length>0&&this._multiselectedValuesMap.forEach(e=>this._triggerOptSendSignalOnClick(e.idx));else{this._setSelectionTimeoutCallback(this.selectedValue),this.sendOnChangeSignal(this.selectedValue);let e=this.selectedValue;0===e&&Number(this._lastSelectedOptIdx)>0&&(e=this._lastSelectedOptIdx),this.info("submit():",e),this._triggerOptSendSignalOnClick(e)}}_triggerOptSendSignalOnClick(e){const t=this._getOptionElByIdx(e);t instanceof HTMLElement&&t.sendClickSignal()}get dirty(){return this._dirty}set dirty(e){this._dirty!==e&&(this._dirty=e,this._fireDirtyOrCleanEvent())}getDirty(){return this.dirty}reset(){(this._hasFeedbackModeSubmit()||this.getDirty())&&(this.multiselect?(this.info("reset() to:",this._cleanValues),this.setValue(this._cleanValues)):(this.info("reset() to:",this._cleanValue),this.setAttribute("selectedValue",String(this._cleanValue)),this.dirty=!1,this._fireChangeEvent(this.lastReceivedSignalValue,this.selectedValue)))}setValue(e){if(this.info("setValue() to:",e),this.multiselect){const t=this.selectedValues.filter(t=>-1===e.indexOf(t));t.length>0&&t.forEach(e=>{const t=this._getOptionElByIdx(e);this._removeFromSelectedOptions(e),this._unsetOptionSelected(t),null!==t&&t.defaultTmplIsUsed()&&t.setToggleValue(!1)});const i=e.filter(e=>-1===this.selectedValues.indexOf(e));i.length>0&&i.forEach(e=>{const t=this._getOptionElByIdx(e);this._addToSelectedOptions(e),this._setOptionSelected(t),null!==t&&t.defaultTmplIsUsed()&&t.setToggleValue(!0)}),this.dirty=!1,this._multiselectedValuesMap=[],this._cleanValues=this.selectedValues.slice(0)}else{const t=this.selectedValue;this.lastReceivedSignalValue=e,this.dirty=!1,this.setAttribute("selectedValue",String(e)),this._fireChangeEvent(e,t)}}getValue(){return this.multiselect?(this.info("getValue():",this.selectedValues),this.selectedValues):(this.info("getValue():",this.selectedValue),this.selectedValue)}get lastReceivedSignalValue(){return this._lastReceivedSignalValue}set lastReceivedSignalValue(e){this._lastReceivedSignalValue!==e&&(this._lastReceivedSignalValue=e,this._cleanValue=e)}_updateSingleSelectionInMainPanel(){const e=this._getOptionElByIdx(this.selectedValue);e instanceof HTMLElement?(this.selectedOptionsPanel.innerHTML=e.innerHTML,this._setSelectedClass(!0)):(this.selectedOptionsPanel.innerHTML=this.noneSelectedPrompt,this._setSelectedClass(!1))}get noneSelectedPrompt(){return this._getTranslatedValue("noneSelectedPrompt",this._noneSelectedPrompt)||this._noneSelectedPrompt}set noneSelectedPrompt(t){t=this._checkAndSetStringValue(t,e.PLACEHOLDER_DEFAULT);const i=this._getTranslatedValue("noneSelectedPrompt",t);i!==this._noneSelectedPrompt&&(this.setAttribute("noneSelectedPrompt",i),this._noneSelectedPrompt=t,(!this.multiselect&&-1===this.selectedValue||this.multiselect&&0===this.selectedValues.length)&&(this.selectedOptionsPanel.innerHTML=i))}_updateMultiSelectionInMainPanel(){if(this.selectedValues.length>0){const e=[];this.selectedValues.forEach(t=>{const i=this._getOptionElByIdx(t);i instanceof HTMLElement&&e.push(i.innerHTML)});const t=e.join(", "),i=this.selectedOptionsPanel.getBoundingClientRect(),s=document.createElement("span");s.style.position="absolute",s.style.visibility="hidden",s.style.fontSize=window.getComputedStyle(this.mainPanel).fontSize,s.textContent=t,this.appendChild(s);s.getBoundingClientRect().width<=i.width?this.selectedOptionsPanel.innerHTML=t:this.selectedOptionsPanel.innerHTML=`${this.selectedValues.length} items selected`,this.removeChild(s),this._setSelectedClass(!0)}else this.selectedOptionsPanel.innerHTML=this.noneSelectedPrompt,this._setSelectedClass(!1)}_isFocused(){return this.hasAttribute("focused")}_onFocus(e){if(this._isFocused())return void e.stopImmediatePropagation();this.info("Ch5Select._onFocus()"),this.setAttribute("focused",""),this._sendFocusSignal(!0);const t=new Event(e.type,e);this.dispatchEvent(t),e.preventDefault(),e.stopPropagation()}_onBlur(e){if(!this._isFocused())return void e.stopImmediatePropagation();this.info("Ch5Select._onBlur()"),this.removeAttribute("focused"),this._sendFocusSignal(!1);const t=new Event(e.type,e);this.dispatchEvent(t),e.preventDefault(),e.stopPropagation()}_sendFocusSignal(e){if(!("string"==typeof this.sendEventOnFocus&&""!==this.sendEventOnFocus))return;const t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnFocus);null!==t&&t.publish(e)}getCssClassDisabled(){return`${this.primaryCssClass}--disabled`}_setSelectedClass(e){e?this.classList.add("ch5-select—selected"):this.classList.remove("ch5-select—selected")}_updateOptionsDirAttr(){if(!this._isValidElement(this.selectPanel))return;const t=this.selectPanel.querySelectorAll("."+e.PANEL_ITEM_STYLE_CLASS);if(0!==t.length)for(let e=0;e<t.length;e++)t[e].dir=this.dir}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5Select.ELEMENT_NAME,Ch5Select),Ch5Select.registerSignalAttributeTypes(),Ch5Select.registerSignalAttributeDefaults(Ch5Select.ELEMENT_NAME);import"hammerjs";var Ch5SelectOption=class e extends Ch5Common{constructor(){super(),this._onClick=this._onClick.bind(this),this._onPress=this._onPress.bind(this),this._onPressUp=this._onPressUp.bind(this)}static get observedAttributes(){return Ch5Common.observedAttributes.concat(["iconposition","receivestateselected","receivestatelabel","receivestateurl","receivestatescriptlabelhtml","sendeventonclick","data-ch5-opt-idx"])}get iconPosition(){return this._iconPosition}set iconPosition(e){e=this._checkAndSetStringValue(e),this._iconPosition!==e&&(this._iconPosition=e,this.setAttribute("iconposition",e))}get useDefaultTmpl(){return this._useDefaultTmpl}set useDefaultTmpl(e){e=this.checkIfValueIsTruey(e.toString()),this._useDefaultTmpl!==e&&(this._useDefaultTmpl=e)}get receiveStateSelected(){return this._attributeValueAsString("receivestateselected")}set receiveStateSelected(e){e=this._checkAndSetStringValue(e),this._receiveStateSelected!==e&&(this._receiveStateSelected=e,this.setAttribute("receivestateselected",e),this._handleReceiveSignalSelected(),null!==this._ch5Toggle&&this.defaultTmplIsUsed()&&this._ch5Toggle.setAttribute("receiveStateSelected",e))}get receiveStateLabel(){return this._attributeValueAsString("receivestatelabel")}set receiveStateLabel(e){e=this._checkAndSetStringValue(e),this._receiveStateLabel!==e&&(this._receiveStateLabel=e,this.setAttribute("receivestatelabel",e),this._handleReceiveSignalLabel())}get receiveStateUrl(){return this._receiveStateUrl}set receiveStateUrl(e){e=this._checkAndSetStringValue(e),this._receiveStateUrl!==e&&(this._receiveStateUrl=e,this.setAttribute("receivestateurl",e))}get receiveStateScriptLabelHTML(){return this._receiveStateScriptLabelHTML}set receiveStateScriptLabelHTML(e){e=this._checkAndSetStringValue(e),this._receiveStateScriptLabelHTML!==e&&(this._receiveStateScriptLabelHTML=e,this.setAttribute("receivestatescriptlabelhtml",e),null!==this._ch5Toggle&&this.defaultTmplIsUsed()&&this._ch5Toggle.setAttribute("receiveStateScriptLabelHTML",e))}get sendEventOnClick(){return this._sendEventOnClick}set sendEventOnClick(e){e=this._checkAndSetStringValue(e),this._sendEventOnClick!==e&&(this._sendEventOnClick=e,this.setAttribute("sendeventonclick",e),null!==this._ch5Toggle&&this.defaultTmplIsUsed()&&this._ch5Toggle.setAttribute("sendEventOnClick",e))}get idx(){return this._idx}set idx(e){this._idx!==e&&(this._idx=e)}get optLabel(){return this._optLabel}set optLabel(e){if(this._optLabel!==e&&(this._optLabel=e,this.hasAttribute("useDefaultTmpl"))){const t=this.querySelector("#"+this._getDefaultTmplLabelId());t instanceof HTMLElement&&(t.textContent=e)}}static ELEMENT_NAME="ch5-select-option";static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateselected:{direction:"state",booleanJoin:1,contractName:!0},receivestatelabel:{direction:"state",stringJoin:1,contractName:!0},receivestateurl:{direction:"state",stringJoin:1,contractName:!0},receivestatescriptlabelhtml:{direction:"state",stringJoin:1,contractName:!0},sendeventonclick:{direction:"event",booleanJoin:1,contractName:!0}};static ICON_POSITION_VALUES=["first","last"];static ITEM_STYLE_CLASS="ch5-select__panel__item";static ITEM_STYLE_DEFAULT_TMPL_CLASS="ch5-select__panel__item__default_tmpl";_idx=-1;receiveStateSelectedSubscription="";_iconPosition=e.ICON_POSITION_VALUES[0];_useDefaultTmpl=!1;_receiveStateSelected=null;_receiveStateLabel=null;_receiveStateLabelSubscription="";_optLabel="";_receiveStateUrl=null;_receiveStateScriptLabelHTML=null;_sendEventOnClick=null;_parentCh5Select=null;_optionHammer=null;_ch5Toggle=null;static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}connectedCallback(){this._parentCh5Select=this.closest("ch5-select"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5SelectOption),this._initDefaultTemplate(),this.intializations(),this.attachEventListeners()}disconnectedCallback(){this.removeEventListeners(),this.unsubscribeFromSignals()}unsubscribeFromSignals(){this.info("unsubscribeFromSignals()"),super.unsubscribeFromSignals(),this.clearBooleanSignalSubscription(this._receiveStateSelected,this.receiveStateSelectedSubscription),this._receiveStateSelected="",this.clearStringSignalSubscription(this._receiveStateLabel,this._receiveStateLabelSubscription),this._receiveStateLabel=""}intializations(){this.setAttribute("data-ch5-id",this.getCrId()),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5SelectOption),this.classList.contains(e.ITEM_STYLE_CLASS)||this.classList.add(e.ITEM_STYLE_CLASS),this.initializeAttributes()}attributeChangedCallback(t,i,s){if(i!==s)switch(this.info('ch5-select-option attributeChangedCallback("'+t+'","'+i+'","'+s+")"),t){case"iconposition":this.iconPosition=this.getAttribute("iconPosition")||e.ICON_POSITION_VALUES[0];break;case"receivestateselected":this.receiveStateSelected=this.getAttribute("receiveStateSelected");break;case"receivestatelabel":this.receiveStateLabel=this.getAttribute("receiveStateLabel");break;case"receivestateurl":this.receiveStateUrl=this.getAttribute("receiveStateUrl");break;case"receivestatescriptlabelhtml":this.receiveStateScriptLabelHTML=this.getAttribute("receiveStateScriptLabelHTML");break;case"sendeventonclick":this.sendEventOnClick=this.getAttribute("sendEventOnClick");break;case"data-ch5-opt-idx":this.idx=Number(s);break;default:super.attributeChangedCallback(t,i,s)}}initializeAttributes(){super.initAttributes(),this.iconPosition=this.getAttribute("iconPosition")||e.ICON_POSITION_VALUES[0],this.receiveStateSelected=this.getAttribute("receiveStateSelected"),this.receiveStateLabel=this.getAttribute("receiveStateLabel"),this.receiveStateUrl=this.getAttribute("receiveStateUrl"),this.receiveStateScriptLabelHTML=this.getAttribute("receiveStateScriptLabelHTML"),this.sendEventOnClick=this.getAttribute("sendEventOnClick"),this.idx=Number(this.getAttribute("data-ch5-opt-idx"))}attachEventListeners(){super.attachEventListeners(),this._optionHammer=new Hammer.Manager(this),this._optionHammer.add(new Hammer.Tap({event:"tap"})),this._optionHammer.on("tap",this._onClick),this._optionHammer.add(new Hammer.Press({time:500})),this._optionHammer.on("press",this._onPress),this._optionHammer.on("pressup",this._onPressUp)}removeEventListeners(){super.removeEventListeners(),null!==this._optionHammer&&(this._optionHammer.off("tap",this._onClick),this._optionHammer.off("press",this._onPress),this._optionHammer.off("pressup",this._onPressUp))}repaint(){this.info("<ch5-select-option /> doen't need repaint")}_initDefaultTemplate(){this.hasAttribute("useDefaultTmpl")&&(this.innerHTML=this._getDefaultTemplate(),this.classList.add(e.ITEM_STYLE_DEFAULT_TMPL_CLASS),this._ch5Toggle=this.querySelector("ch5-toggle"))}_isParentMultiselect(){return null!==this._parentCh5Select&&this._parentCh5Select.multiselect}_parentHasFeedbackModeSubmit(){return null!==this._parentCh5Select&&this._parentCh5Select.feedbackMode===Ch5Select.FEEDBACK_MODE_VALUES[1]}_getParentSyncTimeout(){return this._parentCh5Select.signalValueSyncTimeout}_getDefaultTmplLabelId(){return this.getCrId()+"-opt-label"}_getDefaultTemplate(){let t='<ch5-image refreshRate="0"';null!==this.receiveStateUrl&&""!==this.receiveStateUrl&&(t+=` receiveStateUrl="${this.receiveStateUrl}"`),t+="></ch5-image>";const i=`<span id="${this._getDefaultTmplLabelId()}">${this.optLabel}</span>`;let s="<ch5-toggle";null!==this.receiveStateScriptLabelHTML&&""!==this.receiveStateScriptLabelHTML&&(s+=` receiveStateScriptLabelHTML="${this.receiveStateScriptLabelHTML}"`),null!==this.sendEventOnClick&&""!==this.sendEventOnClick&&(s+=` sendEventOnClick="${this.sendEventOnClick}"`),null!==this.receiveStateSelected&&""!==this.receiveStateSelected&&(s+=` receiveStateValue="${this.receiveStateSelected}"`),this._parentHasFeedbackModeSubmit()&&(s+=' feedbackMode="submit"'),s+=` signalValueSyncTimeout="${this._getParentSyncTimeout()}"></ch5-toggle>`;let n="";return this.iconPosition===e.ICON_POSITION_VALUES[0]?n+=t+(this._isParentMultiselect()?s:"")+i:n+=i+(this._isParentMultiselect()?s:"")+t,n+="",n}defaultTmplIsUsed(){return this.classList.contains(e.ITEM_STYLE_DEFAULT_TMPL_CLASS)}triggerToggleClickSignal(e){null!==this._ch5Toggle&&this._ch5Toggle.value!==e&&this._ch5Toggle.toggleChecked()}_clickReceivedFromCh5Toggle(e){if("ch5-toggle"===e.tagName.toLowerCase())return!0;return!!e.closest("ch5-select-option > ch5-toggle")}setToggleValue(e){null!==this._ch5Toggle&&(this._ch5Toggle.setClean(),this._ch5Toggle.value=e)}_onClick(e){if(this.info("Ch5SelectOption._onClick()"),this.defaultTmplIsUsed()&&this._isParentMultiselect()){const t=!this.classList.contains(Ch5Select.ITEM_SELECTED_STYLE_CLASS);return this.dispatchEvent(this._getOptionSelectedEvent()),void(this._clickReceivedFromCh5Toggle(e.target)||this.triggerToggleClickSignal(t))}this.dispatchEvent(this._getOptionSelectedEvent(!0)),this._parentHasFeedbackModeSubmit()||this.sendClickSignal()}sendClickSignal(){if("string"==typeof this.sendEventOnClick&&""!==this.sendEventOnClick){const e=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick);null!==e&&(e.publish(!0),e.publish(!1))}}_getOptionSelectedEvent(e,t){const i={idx:this.idx,set:"boolean"==typeof e?e:!this.classList.contains(Ch5Select.ITEM_SELECTED_STYLE_CLASS)};return t="boolean"==typeof t&&t,this._isParentMultiselect()?i.confirmed=t:i.resetDirty=t,new CustomEvent("option-selected",{detail:i,bubbles:!0,cancelable:!1})}applySelectedStyleClass(){this.classList.add(Ch5Select.ITEM_SELECTED_STYLE_CLASS)}removeSelectedStyleClass(){this.classList.remove(Ch5Select.ITEM_SELECTED_STYLE_CLASS)}_handleReceiveSignalSelected(){if(""!==this.receiveStateSelected&&""!==this.receiveStateSelectedSubscription){const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateSelected),t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&""!==this.receiveStateSelectedSubscription&&(t.unsubscribe(this.receiveStateSelectedSubscription),this.receiveStateSelectedSubscription="")}if(""===this.receiveStateSelected||null===this.receiveStateSelected)return;const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateSelected),t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&(this.receiveStateSelectedSubscription=t.subscribe(e=>{this.info(`Option ${this.idx} received selected signal value: ${e}`),this.dispatchEvent(this._getOptionSelectedEvent(e,!0))}))}_handleReceiveSignalLabel(){if(""!==this.receiveStateLabel&&""!==this._receiveStateLabelSubscription){const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateLabel),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&""!==this._receiveStateLabelSubscription&&(t.unsubscribe(this._receiveStateLabelSubscription),this._receiveStateLabelSubscription="")}if(""===this.receiveStateLabel||null===this.receiveStateLabel)return;const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateLabel),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&(this._receiveStateLabelSubscription=t.subscribe(e=>{this.optLabel=e}))}getCssClassDisabled(){return"ch5-select__panel__item--disabled"}_onPress(){null!==this._parentCh5Select&&this._parentCh5Select.classList.add("ch5-select—pressed")}_onPressUp(){null!==this._parentCh5Select&&this._parentCh5Select.classList.remove("ch5-select—pressed")}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5SelectOption.ELEMENT_NAME,Ch5SelectOption),Ch5SelectOption.registerSignalAttributeTypes();var Ch5SignalLevelGauge=class e extends Ch5Common{static ORIENTATION=["horizontal","vertical"];static SIZE=["regular","small","large","x-large"];static COMPONENT_DATA={ORIENTATION:{default:e.ORIENTATION[0],values:e.ORIENTATION,key:"orientation",attribute:"orientation",classListPrefix:"--orientation-"},SIZE:{default:e.SIZE[0],values:e.SIZE,key:"size",attribute:"size",classListPrefix:"--size-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatevalue:{direction:"state",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:e.ORIENTATION[0],enumeratedValues:e.ORIENTATION,name:"orientation",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ORIENTATION[0],isObservableProperty:!0},{default:0,name:"value",removeAttributeOnNull:!0,nameForSignal:"receiveStateValue",type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:65535,conditionalMin:0,conditionalMax:65535,conditionalMinValue:0,conditionalMaxValue:65535},isObservableProperty:!0},{default:0,name:"minValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:0,numberProperties:{min:0,max:65534,conditionalMin:0,conditionalMax:65534,conditionalMinValue:0,conditionalMaxValue:65534},isObservableProperty:!0},{default:65535,name:"maxValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:65535,numberProperties:{min:1,max:65535,conditionalMin:1,conditionalMax:65535,conditionalMinValue:1,conditionalMaxValue:65535},isObservableProperty:!0},{default:6,name:"numberOfBars",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:6,numberProperties:{min:1,max:15,conditionalMin:1,conditionalMax:15,conditionalMinValue:1,conditionalMaxValue:15},isObservableProperty:!0},{default:1,name:"signalBarSpacing",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:1,numberProperties:{min:0,max:6,conditionalMin:0,conditionalMax:6,conditionalMinValue:0,conditionalMaxValue:6},isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.SIZE[0],enumeratedValues:e.SIZE,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZE[0],isObservableProperty:!0}];static ELEMENT_NAME="ch5-signal-level-gauge";primaryCssClass="ch5-signal-level-gauge";_resizeObserver=null;_ch5Properties;_elContainer={};set orientation(e){this._ch5Properties.set("orientation",e,()=>{this.handleOrientation()})}get orientation(){return this._ch5Properties.get("orientation")}set minValue(e){this._ch5Properties.set("minValue",e,()=>{e>=this.maxValue&&(this.minValue=0),this.handleValue()})}get minValue(){return this._ch5Properties.get("minValue")}set maxValue(e){this._ch5Properties.set("maxValue",e,()=>{e<=this.minValue&&(this.maxValue=65535),this.handleValue()})}get maxValue(){return this._ch5Properties.get("maxValue")}set numberOfBars(e){this._ch5Properties.set("numberOfBars",e,()=>{this.handleNumberOfBars()})}get numberOfBars(){return this._ch5Properties.get("numberOfBars")}set signalBarSpacing(e){this._ch5Properties.set("signalBarSpacing",e,()=>{this._elContainer.style.gap=this.signalBarSpacing+"px"})}get signalBarSpacing(){return this._ch5Properties.get("signalBarSpacing")}set value(e){this._ch5Properties.set("value",e,()=>{e<this.minValue?this.value=this.minValue:e>this.maxValue&&(this.value=this.maxValue),this.handleValue()})}get value(){return this._ch5Properties.get("value")}set receiveStateValue(e){this._ch5Properties.set("receiveStateValue",e,null,e=>{this._ch5Properties.setForSignalResponse("value",e,()=>{this.handleValue()})})}get receiveStateValue(){return this._ch5Properties.get("receiveStateValue")}set size(e){this._ch5Properties.set("size",e,()=>{this.handleSize()})}get size(){return this._ch5Properties.get("size")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.ignoreAttributes=["receivestatecustomclass","receivestatecustomstyle","receivestatehidepulse","receivestateshowpulse","sendeventonshow"],this.logger.start("constructor()",e.ELEMENT_NAME),this._wasInstatiated||this.createInternalHtml(),this._resizeObserverCallBack=this._resizeObserverCallBack.bind(this),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-signal-level-gauge attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5SignalLevelGauge),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.handleNumberOfBars(),this._elContainer.style.gap=this.signalBarSpacing+"px",customElements.whenDefined("ch5-signal-level-gauge").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),subscribeInViewPortChange(this,()=>{this.elementIsInViewPort&&this.handleNumberOfBars()}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),unSubscribeInViewPortChange(this),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this._elContainer=document.createElement("div"),this._elContainer.classList.add("ch5-signal-level-gauge"),this.appendChild(this._elContainer),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this.updateCssClass()}attachEventListeners(){super.attachEventListeners(),this._resizeObserver=new ResizeObserver(this._resizeObserverCallBack),this._resizeObserver.observe(this._elContainer)}removeEventListeners(){var e;super.removeEventListeners(),null==(e=this._resizeObserver)||e.unobserve(this._elContainer)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}_resizeObserverCallBack(){this.handleNumberOfBars()}handleOrientation(){Array.from(e.COMPONENT_DATA.ORIENTATION.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this.handleNumberOfBars()}handleValue(){this._elContainer.querySelectorAll(".ch5-signal-level-gauge--selected-bar-color").forEach(e=>e.classList.remove("ch5-signal-level-gauge--selected-bar-color"));const e=Math.floor((this.value-this.minValue)*this.numberOfBars/(this.maxValue-this.minValue));Array.from(this._elContainer.children).forEach((t,i)=>{i<e&&i<this.numberOfBars?(t.classList.add(this.primaryCssClass+"--selected-bar-color"),t.classList.remove(this.primaryCssClass+"--bar-color")):(t.classList.remove(this.primaryCssClass+"--selected-bar-color"),t.classList.add(this.primaryCssClass+"--bar-color"))})}handleNumberOfBars(){Array.from(this._elContainer.children).forEach(e=>e.remove());const e=this._elContainer.offsetHeight/this.numberOfBars,t=this._elContainer.offsetWidth/this.numberOfBars;for(let i=1;i<=this.numberOfBars;i++){const s=document.createElement("div");s.classList.add("ch5-signal-level-gauge--bar-color"),s.style.height="horizontal"===this.orientation?e*i+"px":e+"px",s.style.width="horizontal"===this.orientation?t+"px":t*i+"px",this._elContainer.appendChild(s)}this.handleValue()}handleSize(){Array.from(e.COMPONENT_DATA.SIZE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this.handleNumberOfBars()}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this._elContainer.style.gap=this.signalBarSpacing+"px",this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};Ch5SignalLevelGauge.registerCustomElement(),Ch5SignalLevelGauge.registerSignalAttributeTypes();var Ch5CommonInput=class e extends Ch5Common{static FEEDBACKMODES=["direct","submit"];_elInput={};_signalValueSyncTimeout=1500;_cleanValue="";_clean=!0;_dirtyValue="";_dirty=!1;_submitted=!1;_dirtyTimerHandle=null;_feedbackMode="";_value="";_required=!1;_ondirtyCallback={};_oncleanCallback={};constructor(){super()}getDirty(){return"submit"===this.feedbackMode&&this._dirty}get feedbackMode(){return this._feedbackMode}set feedbackMode(t){this._feedbackMode!==t&&(e.FEEDBACKMODES.indexOf(t)<0&&(t=e.FEEDBACKMODES[0]),this.setAttribute("feedbackMode",t),this._feedbackMode=t)}get signalValueSyncTimeout(){return this._signalValueSyncTimeout}set signalValueSyncTimeout(e){e=Number(e),isNaN(e)&&(e=1500),this._signalValueSyncTimeout!==e&&(this.setAttribute("signalValueSyncTimeout",e+""),this._signalValueSyncTimeout=e)}set cleanValue(e){this.cleanValue!==e&&null==e&&(e=""),this._cleanValue=e}get cleanValue(){return this._cleanValue}set dirtyValue(e){this.dirtyValue!==e&&null==e&&(e=""),this._dirtyValue=e}get dirtyValue(){return this._dirtyValue}set value(e){this.info("Set input value ("+e+")"),this.value!==e&&null==e&&(e=""),this._value=e,this.setAttribute("value",this.value)}get value(){return this._value}setValue(e){this.value=e}getValue(){return this.value}set required(e){this.required!==e&&null==e&&(e=!1),this._required=e,this._elInput instanceof HTMLElement&&(!0!==this._required?this._elInput.removeAttribute("required"):this._elInput.required=this._required)}get required(){return this._required}set oncleanCallback(e){null==e&&(e={}),this._oncleanCallback=e}get oncleanCallback(){return this._oncleanCallback}set onclean(e){this.oncleanCallback=e}get onclean(){return this.oncleanCallback}set ondirtyCallback(e){null==e&&(e={}),this._ondirtyCallback=e}get ondirtyCallback(){return this._ondirtyCallback}set ondirty(e){this.ondirtyCallback=e}get ondirty(){return this.ondirtyCallback}setClean(){this._clean=!0,this._dirty=!1,this._submitted=!1}setDirty(){this._dirty=!0,this._clean=!1}getValid(){return!0}static get observedAttributes(){return["required","signalvaluesynctimeout","feedbackmode","onclean","ondirty"]}attributeChangedCallback(t,i,s){if(i!==s)switch(super.attributeChangedCallback(t,i,s),t){case"required":this.required="false"!==s;break;case"signalvaluesynctimeout":this.hasAttribute("signalvaluesynctimeout")?this.signalValueSyncTimeout=s:this.signalValueSyncTimeout="";break;case"feedbackmode":this.hasAttribute("feedbackmode")?this.feedbackMode=s:this.feedbackMode=e.FEEDBACKMODES[0];break;case"onclean":this.onclean=new HtmlCallback(this,s);break;case"ondirty":this.ondirty=new HtmlCallback(this,s)}}initAttributes(){if(super.initAttributes(),this.hasAttribute("tabindex")&&(this.tabIndex=Number(this.getAttribute("tabindex"))),this.hasAttribute("feedbackmode")?this.feedbackMode=this.getAttribute("feedbackmode"):this.feedbackMode=e.FEEDBACKMODES[0],this.hasAttribute("required")){const e="false"!==this.getAttribute("required");this.required=e}this.hasAttribute("onclean")&&(this.onclean=new HtmlCallback(this,this.getAttribute("onclean"))),this.hasAttribute("ondirty")&&(this.ondirty=new HtmlCallback(this,this.getAttribute("ondirty")))}runEventHandlers(e,t){switch(e){case"clean":this.runOncleanHandler(t);break;case"dirty":this.runOndirtyHandler(t)}}runOncleanHandler(e){this.onclean instanceof HtmlCallback?this.onclean.run(e):this.onclean instanceof Function&&this.onclean.call(this,e)}runOndirtyHandler(e){this.ondirty instanceof HtmlCallback?this.ondirty.run(e):this.ondirty instanceof Function&&this.ondirty.call(this,e)}};import{create}from"nouislider";import"hammerjs";import{Subject as Subject4}from"rxjs";import _30 from"lodash";var Ch5PressableFingerStateMode2=(e=>(e[e.Idle=0]="Idle",e[e.Start=1]="Start",e[e.FingerDown=2]="FingerDown",e))(Ch5PressableFingerStateMode2||{}),Ch5PressableSlider=class _Ch5PressableSlider{static FingerState=class{mode;touchHoldTimer=null;touchStartLocationX;touchStartLocationY;touchPointId=-1;constructor(){this.mode=0,this.touchStartLocationX=0,this.touchStartLocationY=0,this.touchPointId=-1,this.touchHoldTimer=null}getTouchFromTouchList(e){if(void 0!==e.changedTouches)for(let t=0;t<e.changedTouches.length;t++)if(e.changedTouches[t].identifier===this.touchPointId)return e.changedTouches[t];return null}reset(){this.mode=0,this.touchStartLocationX=0,this.touchStartLocationY=0,this.touchPointId=-1,null!==this.touchHoldTimer&&(window.clearTimeout(this.touchHoldTimer),this.touchHoldTimer=null)}};_fingerState=new _Ch5PressableSlider.FingerState;_ch5Component;_options;_pressEvent;_releaseEvent;_touchStart=!1;_touchEnd=!1;_pressed=!1;_released=!0;_hammerManager=null;_gestureableSubscription=null;observablePressed;TOUCH_TIMEOUT=250;PRESS_MOVE_THRESHOLD=10;CLICK_MOVE_THRESHOLD=1;isTouch=!1;isMouse=!1;sliderValue="";constructor(e,t){this._ch5Component=e,this._options=t||null,this.observablePressed=new Subject4,this._pressEvent=new CustomEvent("press",{bubbles:!0,cancelable:!1}),this._releaseEvent=new CustomEvent("release",{bubbles:!0,cancelable:!1}),this._onClick=this._onClick.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onMouseLeave=this._onMouseLeave.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onTouchCancel=this._onTouchCancel.bind(this),this._onTouchHoldTimer=this._onTouchHoldTimer.bind(this),this._onHold=this._onHold.bind(this),this._onRelease=this._onRelease.bind(this),this._onPanEnd=this._onPanEnd.bind(this),this._onMouseMove=this._onMouseMove.bind(this)}get ch5Component(){return this._ch5Component}get options(){return this._options}get pressDelayTime(){return null===this._options||_30.isNil(this._options.pressDelayTime)?this.TOUCH_TIMEOUT:this._options.pressDelayTime}get pressDelayMoveDistance(){return null===this._options||_30.isNil(this._options.pressDelayDistance)?this.PRESS_MOVE_THRESHOLD:this._options.pressDelayDistance}get clickDelayMoveDistance(){return null===this.options||_30.isNil(this.options.clickDelayDistance)?this.CLICK_MOVE_THRESHOLD:this.options.clickDelayDistance}init(){this._hammerManager=new Hammer(this._ch5Component,{touchAction:"auto"}),this._subscribeToGestureableProp(),this._attachEvents()}setPressed(e){!0===this._pressed?!1===e&&this._onRelease():!0===e&&this._onHold()}destroy(){this._unsubscribeFromGestureableProp(),this._removeEvents()}_attachEvents(){this._ch5Component.addEventListener("click",this._onClick),this._ch5Component.addEventListener("mousedown",this._onMouseDown,{passive:!0}),this._ch5Component.addEventListener("mouseup",this._onMouseUp),this._ch5Component.addEventListener("mousemove",this._onMouseMove),this._ch5Component.addEventListener("mouseleave",this._onMouseLeave),this._ch5Component.addEventListener("mouseout",this._onMouseLeave),this._ch5Component.addEventListener("touchstart",this._onTouchStart,{passive:!0}),this._ch5Component.addEventListener("touchmove",this._onTouchMove),this._ch5Component.addEventListener("touchend",this._onTouchEnd),this._ch5Component.addEventListener("touchcancel",this._onTouchCancel)}_removeEvents(){this._ch5Component.removeEventListener("click",this._onClick),this._ch5Component.removeEventListener("mousedown",this._onMouseDown),this._ch5Component.removeEventListener("mouseup",this._onMouseUp),this._ch5Component.removeEventListener("mouseleave",this._onMouseLeave),this._ch5Component.removeEventListener("touchstart",this._onTouchStart),this._ch5Component.removeEventListener("touchmove",this._onTouchMove),this._ch5Component.removeEventListener("touchend",this._onTouchEnd),this._ch5Component.removeEventListener("touchcancel",this._onTouchCancel),this._removeEventsFromHammer()}_subscribeToGestureableProp(){this._attachEventsFromHammer()}_unsubscribeFromGestureableProp(){null!==this._gestureableSubscription&&(this._gestureableSubscription.unsubscribe(),this._gestureableSubscription=null)}_attachEventsFromHammer(){null!==this._hammerManager&&(this._hammerManager.on("press",this._onHold),this._hammerManager.on("pressup",this._onRelease),this._hammerManager.on("panend",this._onPanEnd))}_removeEventsFromHammer(){null!==this._hammerManager&&(this._hammerManager.off("press",this._onHold),this._hammerManager.off("pressup",this._onRelease),this._hammerManager.off("panend",this._onPanEnd),this._hammerManager.destroy(),this._hammerManager=null)}_onClick(e){this._touchStart=!1,this._touchEnd=!1}_onMouseDown(e){if(this._touchStart)return;if(this.isTouch)return;this.isMouse=!0,this.isTouch=!1;const t=e,i=e.clientX,s=e.clientY,{left:n,width:r,height:a,top:l}=this._ch5Component.getBoundingClientRect(),o=r>a?(i-n)/r:1-(s-l)/a;0===this._fingerState.mode&&(this._fingerState.mode=1,this._fingerState.touchHoldTimer=window.setTimeout(this._onTouchHoldTimer,this.pressDelayTime),this._fingerState.touchStartLocationX=t.clientX,this._fingerState.touchStartLocationY=t.clientY),this.sliderValue=o<=.25?"lower":o>=.75?"upper":""}_onMouseMove(e){if(!this.isTouch&&1===this._fingerState.mode){const t=e;if(null!==t){const e=t.clientX-this._fingerState.touchStartLocationX,i=t.clientY-this._fingerState.touchStartLocationY;Math.sqrt(e**2+i**2)>this.clickDelayMoveDistance&&(this._touchStart=!1,this._fingerState.reset())}}}_onMouseUp(e){if(!0===this._pressed&&this._onRelease(),this.isTouch)return;null!==e&&(1===this._fingerState.mode&&this._fingerIsDownActions(),this._touchEnd||(this._touchEnd=!0),2===this._fingerState.mode&&this._onRelease(),this._fingerState.reset())}_onMouseLeave(e){if(this.isTouch)return;null!==e&&(1===this._fingerState.mode&&this._fingerIsDownActions(),this._touchEnd||(this._touchEnd=!0),2===this._fingerState.mode&&this._onRelease(),this._fingerState.reset())}_onTouchStart(e){const t=e.touches[0].clientX,i=e.touches[0].clientY,{left:s,width:n,height:r,top:a}=this._ch5Component.getBoundingClientRect(),l=n>r?(t-s)/n:1-(i-a)/r;this.sliderValue=l<=.25?"lower":l>=.75?"upper":""}_onTouchMove(e){if(!this.isMouse&&1===this._fingerState.mode){const t=e,i=this._fingerState.getTouchFromTouchList(t);if(null!==i){const e=i.clientX-this._fingerState.touchStartLocationX,t=i.clientY-this._fingerState.touchStartLocationY;Math.sqrt(e**2+t**2)>this.pressDelayMoveDistance&&(this._touchStart=!1,this._fingerState.reset())}}}_onTouchHoldTimer(e){this._fingerState.touchHoldTimer=null,this._fingerIsDownActions()}_fingerIsDownActions(){this._fingerState.mode=2,this._onHold(),null!==this._fingerState.touchHoldTimer&&(window.clearTimeout(this._fingerState.touchHoldTimer),this._fingerState.touchHoldTimer=null)}_onTouchEnd(e){if(this._pressed&&this._onRelease(),this.isMouse)return;const t=e;null!==this._fingerState.getTouchFromTouchList(t)&&(1===this._fingerState.mode&&this._fingerIsDownActions(),this._touchEnd||(this._touchEnd=!0),2===this._fingerState.mode&&this._onRelease(),this._fingerState.reset())}_onTouchCancel(e){this._onTouchEnd(e)}_onHold(){if(!this._pressed){this._addCssPressClass(),this._pressed=!0,this._released=!1,""!==this.sliderValue&&this.observablePressed.next({pressed:this._pressed,range:this.sliderValue}),this._ch5Component.setAttribute("pressed","true"),this._ch5Component.dispatchEvent(this._pressEvent);const onPressAttrib=this._ch5Component.getAttribute("onpress");if(null!==onPressAttrib)try{eval(onPressAttrib)}catch(e){}}}_onRelease(){if(!this._released){setTimeout(()=>{this._removeCssPressClass()},this.pressDelayTime),this._pressed=!1,this._released=!0,""!==this.sliderValue&&this.observablePressed.next({pressed:this._pressed,range:this.sliderValue}),this._ch5Component.removeAttribute("pressed"),this._ch5Component.dispatchEvent(this._releaseEvent);const onReleaseAttrib=this._ch5Component.getAttribute("onrelease");if(null!==onReleaseAttrib)try{eval(onReleaseAttrib)}catch(e){}}}_onPanEnd(){this._onRelease()}_addCssPressClass(){null!==this._options&&void 0!==this._options.cssTargetElement.classList&&this._options.cssPressedClass.split(" ").forEach(e=>{var t;null==(t=this._options)||t.cssTargetElement.classList.add(e)})}_removeCssPressClass(){null!==this._options&&void 0!==this._options.cssTargetElement.classList&&this._options.cssPressedClass.split(" ").forEach(e=>{var t;null==(t=this._options)||t.cssTargetElement.classList.remove(e)})}};import _32 from"lodash";import _31 from"lodash";var Ch5SliderTitleLabel=class e extends Ch5Label{constructor(t){super("ch5-slider"),this.parent=t,this.ignoreAttributes=["disabled","debug","show","customclass","customstyle","noshowtype","receivestatecustomclass","receivestatecustomstyle","receivestateshow","receivestateshowpulse","receivestatehidepulse","receivestateenable","sendeventonshow","gestureable","dir","appendclasswheninviewport"],this.logger.start("constructor()",e.ELEMENT_NAME),_31.isNil(t)?this._parentCh5Slider=this.getParentButton():(this._parentCh5Slider=t,this.createInternalHtml(),this.initAttributes(),this.updateCssClass(),this._parentCh5Slider.setValues("title",this.getTargetElementForCssClassesAndStyle()))}parent;static ELEMENT="ch5-slider-title-label";primaryCssClass="ch5-slider-title-label";_parentCh5Slider;static get observedAttributes(){const t=Ch5Label.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT,e.SIGNAL_ATTRIBUTE_TYPES)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-slider-button attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this._parentCh5Slider.setValues&&this._parentCh5Slider.setValues("title",this.getTargetElementForCssClassesAndStyle()),this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),super.connectedCallback(),this.setAttribute("data-ch5-id",this.getCrId()),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){super.createInternalHtml(),this.logger.start("createInternalHtml()"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}getParentButton(){const e=t=>_31.isNil(t)||"CH5-SLIDER"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}attachEventListeners(){super.attachEventListeners()}removeEventListeners(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals()}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClass(),this.logger.stop()}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5SliderTitleLabel.ELEMENT,Ch5SliderTitleLabel),Ch5SliderTitleLabel.registerSignalAttributeTypes();var Ch5Slider=class e extends Ch5CommonInput{static ELEMENT_NAME="ch5-slider";static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,sendeventonchange:{direction:"event",numericJoin:1,contractName:!0},sendeventonchangehigh:{direction:"event",numericJoin:1,contractName:!0},receivestatevalue:{direction:"state",numericJoin:1,contractName:!0},receivestatevaluehigh:{direction:"state",numericJoin:1,contractName:!0},receivestateshowonoffonly:{direction:"state",booleanJoin:1,contractName:!0},sendeventonupper:{direction:"event",booleanJoin:1,contractName:!0},receivestateupper:{direction:"state",booleanJoin:1,contractName:!0},sendeventonlower:{direction:"event",booleanJoin:1,contractName:!0},receivestatelower:{direction:"state",booleanJoin:1,contractName:!0},sendeventonhandleclick:{direction:"event",booleanJoin:1,contractName:!0},contractname:{contractName:!0}};static MIN_VALUE=0;static MAX_VALUE=65535;static DEFAULT_STEP=1;static HANDLE_SHAPE=["rounded-rectangle","rectangle","circle","oval"];static ORIENTATION=["horizontal","vertical"];static SIZE=["regular","x-small","small","large","x-large"];static HANDLE_SIZE=["regular","x-small","small","large","x-large"];static STRETCH=["both","height","width"];static TOOL_TIP_SHOW_TYPE=["off","on","auto"];static TOOL_TIP_DISPLAY_TYPE=["%","value"];static COMPONENT_DATA={HANDLE_SHAPE:{default:e.HANDLE_SHAPE[0],values:e.HANDLE_SHAPE,key:"handleShape",attribute:"handleShape",classListPrefix:"--shape--"},ORIENTATION:{default:e.ORIENTATION[0],values:e.ORIENTATION,key:"orientation",attribute:"orientation",classListPrefix:"--orientation--"},SIZE:{default:e.SIZE[0],values:e.SIZE,key:"size",attribute:"size",classListPrefix:"--size--"},HANDLE_SIZE:{default:e.HANDLE_SIZE[0],values:e.HANDLE_SIZE,key:"handleSize",attribute:"handleSize",classListPrefix:"--handle-size--"},STRETCH:{default:e.STRETCH[0],values:e.STRETCH,key:"stretch",attribute:"stretch",classListPrefix:"--stretch--"},TOOL_TIP_SHOW_TYPE:{default:e.TOOL_TIP_SHOW_TYPE[0],values:e.TOOL_TIP_SHOW_TYPE,key:"toolTipShowType",attribute:"toolTipShowType",classListPrefix:"--tooltip--"},TOOL_TIP_DISPLAY_TYPE:{default:e.TOOL_TIP_DISPLAY_TYPE[0],values:e.TOOL_TIP_DISPLAY_TYPE,key:"toolTipDisplayType",attribute:"toolTipDisplayType",classListPrefix:"--tooltip-display-type-"},ON_OFF_ONLY:{default:!1,values:[!0,!1],key:"onOffOnly",attribute:"onOffOnly",classListPrefix:"--on-off-only-"}};static COMPONENT_PROPERTIES=[{default:0,name:"min",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:0,numberProperties:{min:-65535,max:65534,conditionalMin:-65535,conditionalMax:65534,conditionalMinValue:-65535,conditionalMaxValue:65534},isObservableProperty:!0},{default:65535,name:"max",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:65535,numberProperties:{min:-65534,max:65535,conditionalMin:-65534,conditionalMax:65535,conditionalMinValue:-65534,conditionalMaxValue:65535},isObservableProperty:!0},{default:"",name:"ticks",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.HANDLE_SHAPE[0],enumeratedValues:e.HANDLE_SHAPE,name:"handleShape",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.HANDLE_SHAPE[0],isObservableProperty:!0},{default:!1,name:"range",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.ORIENTATION[0],enumeratedValues:e.ORIENTATION,name:"orientation",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ORIENTATION[0],isObservableProperty:!0},{default:e.SIZE[0],enumeratedValues:e.SIZE,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZE[0],isObservableProperty:!0},{default:e.HANDLE_SIZE[0],enumeratedValues:e.HANDLE_SIZE,name:"handleSize",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.HANDLE_SIZE[0],isObservableProperty:!0},{default:"",enumeratedValues:e.STRETCH,name:"stretch",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.STRETCH[0],isObservableProperty:!0},{default:!1,name:"noHandle",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:1,name:"step",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:1,max:65535,conditionalMin:1,conditionalMax:65535,conditionalMinValue:1,conditionalMaxValue:65535},isObservableProperty:!0},{default:!1,name:"showTickValues",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:e.TOOL_TIP_SHOW_TYPE[0],enumeratedValues:e.TOOL_TIP_SHOW_TYPE,name:"toolTipShowType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.TOOL_TIP_SHOW_TYPE[0],isObservableProperty:!0},{default:e.TOOL_TIP_DISPLAY_TYPE[0],enumeratedValues:e.TOOL_TIP_DISPLAY_TYPE,name:"toolTipDisplayType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.TOOL_TIP_DISPLAY_TYPE[0],isObservableProperty:!0},{default:!1,name:"tapSettable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateValue",signalType:"object",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateValueHigh",signalType:"object",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:0,name:"value",nameForSignal:"receiveStateValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:-65535,max:65535,conditionalMin:-65535,conditionalMax:65535,conditionalMinValue:-65535,conditionalMaxValue:65535},isObservableProperty:!0},{default:65535,name:"valueHigh",nameForSignal:"receiveStateValueHigh",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:-65534,max:65535,conditionalMin:-65534,conditionalMax:65535,conditionalMinValue:-65534,conditionalMaxValue:65535},isObservableProperty:!0},{default:!1,name:"onOffOnly",nameForSignal:"receiveStateShowOnOffOnly",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateShowOnOffOnly",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnUpper",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnLower",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnChange",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnChangeHigh",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnHandleClick",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static OFFSET_THRESHOLD=30;_render=this.debounce(()=>{this.createSlider()},25);_ch5Properties;isAdvancedSlider=!1;_elContainer={};_elTitleContainer={};_elSliderContainer={};_elOnContainer={};_elOffContainer={};_innerContainer={};_tgtEls=[];_tooltip={};_titlePresent=-1;_userLowValue=-1;_userHighValue=-1;isResizeInProgress=!1;RESIZE_DEBOUNCE=500;primaryCssClass="ch5-slider";_wasRendered=!1;isSliderStarted=!1;sliderTouch=null;_isPressedSubscription=null;_repeatDigitalInterval=null;_receiveStateValueSignal="";_subReceiveValueId="";_subReceiveAnalogValueId="";_receiveStateValueSignalHigh="";_subReceiveValueHighId="";_subReceiveAnalogValueHighId="";_pressable=null;sliderEvent={};sliderStartEvent={};sliderEndEvent={};focusEvent={};blurEvent={};changeEvent={};dirtyEvent={};cleanEvent={};_cleanValueHigh="";_dirtyValueHigh="";_dirtyTimerHandleHigh=null;_cleanLow=!0;_dirtyLow=!1;_cleanHigh=!0;_dirtyHigh=!1;_animationTimer=void 0;_tooltipValueFromSignal=void 0;_tooltipHighValueFromSignal=void 0;_rcbSignalValue=void 0;_rcbSignalValueHigh=void 0;_animatingHandle={0:!1,1:!1};set range(e){this._ch5Properties.set("range",e,()=>{this._render()})}get range(){return this._ch5Properties.get("range")}set showTickValues(e){this._ch5Properties.set("showTickValues",e,()=>{this._render()})}get showTickValues(){return this._ch5Properties.get("showTickValues")}set tapSettable(e){this._ch5Properties.set("tapSettable",e,()=>{this._render()})}get tapSettable(){return this._ch5Properties.get("tapSettable")}set handleShape(e){this._ch5Properties.set("handleShape",e,()=>{this.handleHandleShape()})}get handleShape(){return this._ch5Properties.get("handleShape")}set value(e){this._ch5Properties.set("value",e,()=>{this.handleValue(),this.setCleanValue(this.value)})}get value(){return this._ch5Properties.get("value")}get valueHigh(){return this._ch5Properties.get("valueHigh")}set valueHigh(e){this._ch5Properties.set("valueHigh",e,()=>{this.handleValueHigh(),this._cleanValueHigh=this.valueHigh})}set noHandle(e){this._ch5Properties.set("noHandle",e,()=>{this.handleTapSettable()})}get noHandle(){return this._ch5Properties.get("noHandle")}get max(){return this._ch5Properties.get("max")}set max(e){this._ch5Properties.set("max",e,()=>{this.handleMax()})}get min(){return this._ch5Properties.get("min")}set min(e){this._ch5Properties.set("min",e,()=>{this.handleMin()})}set orientation(e){this._ch5Properties.set("orientation",e,()=>{this.handleOrientation()})}get orientation(){return this._ch5Properties.get("orientation")}set size(e){this._ch5Properties.set("size",e,()=>{this.sizeHandler()})}get size(){return this._ch5Properties.get("size")}set handleSize(e){this._ch5Properties.set("handleSize",e,()=>{this.handleHandleSize()})}get handleSize(){return this._ch5Properties.get("handleSize")}set step(e){this._ch5Properties.set("step",e,()=>{this.ticks&&(this.step=1),this.handleMax()})}get step(){return this._ch5Properties.get("step")}set stretch(e){this._ch5Properties.set("stretch",e,()=>{this.handleStretch()})}get stretch(){return this._ch5Properties.get("stretch")}set ticks(e){this._ch5Properties.set("ticks",e,()=>{this.ticks?this._elContainer.classList.add("ch5-slider-ticks"):this._elContainer.classList.remove("ch5-slider-ticks"),this._render()})}get ticks(){return this._ch5Properties.get("ticks")}set toolTipShowType(t){this._ch5Properties.set("toolTipShowType",t,()=>{this.handleToolTipShowType(),this.toolTipShowType===e.TOOL_TIP_SHOW_TYPE[1]?(this.subscribeToAnalogSignal(),this.subscribeToAnalogHighSignal()):this.unsubscribeFromAnalogSignals()})}get toolTipShowType(){return this._ch5Properties.get("toolTipShowType")}set toolTipDisplayType(e){this._ch5Properties.set("toolTipDisplayType",e,()=>{this.handleToolTipDisplayType()})}get toolTipDisplayType(){return this._ch5Properties.get("toolTipDisplayType")}set sendEventOnChange(e){this._ch5Properties.set("sendEventOnChange",e)}get sendEventOnChange(){return this._ch5Properties.get("sendEventOnChange")}set sendEventOnChangeHigh(e){this._ch5Properties.set("sendEventOnChangeHigh",e)}get sendEventOnChangeHigh(){return this._ch5Properties.get("sendEventOnChangeHigh")}set sendEventOnHandleClick(e){this._ch5Properties.set("sendEventOnHandleClick",e)}get sendEventOnHandleClick(){return this._ch5Properties.get("sendEventOnHandleClick")}get receiveStateValue(){return this._attributeValueAsString("receivestatevalue")}set receiveStateValue(e){if(""===e||this._receiveStateValueSignal===e||null==e)return;if(""!==this._receiveStateValueSignal&&void 0!==this._receiveStateValueSignal&&null!==this._receiveStateValueSignal){const e=Ch5Signal.getSubscriptionSignalName(this._receiveStateValueSignal),t=Ch5SignalFactory.getInstance().getObjectSignal(e);null!==t&&t.unsubscribe(this._subReceiveValueId)}this._receiveStateValueSignal=e;const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateValueSignal),i=Ch5SignalFactory.getInstance().getObjectSignal(t);null!==i&&(this._subReceiveValueId=i.subscribe(e=>{if(void 0===e||!e.hasOwnProperty("rcb")||!e.rcb.hasOwnProperty("value")||!i.hasChangedSinceInit())return;const t=e.rcb,s=t.time;let n=t.value;this.min<0&&n>32767&&(n-=65536),this._rcbSignalValue={rcb:{value:n,time:s,startv:void 0!==t.startv?t.startv:this.value,startt:void 0!==t.startt?t.startt:Date.now()}},this.setCleanValue(n),this._wasRendered=!1,this._ch5Properties.setForSignalResponse("value",n,()=>{}),this._wasRendered=!0,null===this._dirtyTimerHandle&&(this._wasRendered&&0===s?(this._render(),this._tooltipValueFromSignal=n,this._adjustTooltipValue(0)):this._setSliderValue(n,0,s),this._setCleanLow(),this.setClean())}))}get receiveStateValueHigh(){return this._attributeValueAsString("receivestatevaluehigh")}set receiveStateValueHigh(e){if(Ch5Common.isNil(e)||this._receiveStateValueSignalHigh===e)return;if(""!==this._receiveStateValueSignalHigh&&void 0!==this._receiveStateValueSignalHigh&&null!==this._receiveStateValueSignalHigh){const e=Ch5Signal.getSubscriptionSignalName(this._receiveStateValueSignalHigh),t=Ch5SignalFactory.getInstance().getObjectSignal(e);null!==t&&t.unsubscribe(this._subReceiveValueHighId)}this._receiveStateValueSignalHigh=e;const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateValueSignalHigh),i=Ch5SignalFactory.getInstance().getObjectSignal(t);null!==i&&(this._subReceiveValueHighId=i.subscribe(e=>{if(void 0===e||!e.hasOwnProperty("rcb")||!e.rcb.hasOwnProperty("value")||!i.hasChangedSinceInit())return;const t=e.rcb,s=t.time;let n=t.value;this.min<0&&n>32767&&(n-=65536),this._rcbSignalValueHigh={rcb:{value:n,time:s,startv:void 0!==t.startv?t.startv:this.valueHigh,startt:void 0!==t.startt?t.startt:Date.now()}},this._cleanValueHigh=n,this._wasRendered=!1,this._ch5Properties.setForSignalResponse("valueHigh",n,()=>{}),this._wasRendered=!0,null===this._dirtyTimerHandleHigh&&(this._wasRendered&&0===s?(this._render(),this._tooltipHighValueFromSignal=n,this._adjustTooltipValue(1)):this._setSliderValue(n,1,s),this._setCleanHigh(),this.setClean())}))}set onOffOnly(e){this._ch5Properties.set("onOffOnly",e,()=>{this.handleOnOffOnly()})}get onOffOnly(){return this._ch5Properties.get("onOffOnly")}set receiveStateShowOnOffOnly(e){this._ch5Properties.set("receiveStateShowOnOffOnly",e,null,e=>{this._ch5Properties.setForSignalResponse("onOffOnly",e,()=>{this.handleOnOffOnly()})})}get receiveStateShowOnOffOnly(){return this._ch5Properties.get("receiveStateShowOnOffOnly")}set sendEventOnUpper(e){this._ch5Properties.set("sendEventOnUpper",e,null,e=>{"%"===this.toolTipDisplayType&&(this.toolTipShowType="off")})}get sendEventOnUpper(){return this._ch5Properties.get("sendEventOnUpper")}set sendEventOnLower(e){this._ch5Properties.set("sendEventOnLower",e,null,e=>{"%"===this.toolTipDisplayType&&(this.toolTipShowType="off")})}get sendEventOnLower(){return this._ch5Properties.get("sendEventOnLower")}constructor(){super(),this.logger.start("Ch5Slider.constructor()"),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.eventBinding(),this.logger.stop()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i.concat(["feedbackmode","signalvaluesynctimeout","dir"]))}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}connectedCallback(){this.logger.start("Ch5Slider.connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Slider),this.setAttribute("data-ch5-id",this.getCrId()),this._pressable=new Ch5PressableSlider(this._innerContainer,{cssTargetElement:this._innerContainer,cssPressedClass:this.primaryCssClass+"--pressed"}),Promise.all([customElements.whenDefined("ch5-slider")]).then(()=>{this.cacheComponentChildrens();const e=this.querySelector(".noUi-target");e instanceof HTMLElement&&e.remove(),this._elContainer.parentElement!==this&&this.appendChild(this._elContainer),this.initAttributes(),this.updateCssClasses(),this._wasRendered&&void 0!==this._innerContainer.noUiSlider&&null!==this._innerContainer.noUiSlider||this._renderPromise().then(()=>{this._wasRendered=!0,window.setTimeout(()=>{this._applySignalReceivedBeforeRender()},0)}),this.attachEventListeners(),this.initCommonMutationObserver(this),this.setCleanValue(this.value),this._cleanValueHigh=this.valueHigh,Ch5AugmentVarSignalsNames.customDifferentiateTmplElemsAttrs(this,this.getAttribute("contractname")||"",parseInt(this.getAttribute("booleanjoinoffset")||"0",10)||0,parseInt(this.getAttribute("numericjoinoffset")||"0",10)||0,parseInt(this.getAttribute("stringjoinoffset")||"0",10)||0)}),this.titleHelper(),this.onOffButtonHelper(),this.handleOnOffOnly(),!1===this._innerContainer.isConnected&&this._elSliderContainer.insertBefore(this._innerContainer,this._elOnContainer),this.logger.stop()}eventBinding(){this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onSliderSlide=this._onSliderSlide.bind(this),this._onSliderStart=this._onSliderStart.bind(this),this._onSliderStop=this._onSliderStop.bind(this),this._onSliderChange=this._onSliderChange.bind(this),this._stopRcbAnimation=this._stopRcbAnimation.bind(this),this._onMouseLeave=this._onMouseLeave.bind(this),this._onTouchMoveEnd=this._onTouchMoveEnd.bind(this),this.sendEventOnHandleClickHandle=this.sendEventOnHandleClickHandle.bind(this)}setCleanValue(e){this._cleanValue=e}disconnectedCallback(){this.logger.start("Ch5Slider.disconnectedCallback()"),this.removeEvents(),this.unsubscribeFromSignals();const e=this._innerContainer;_32.isNil(e)||_32.isNil(e.noUiSlider)||e.noUiSlider.destroy(),null!==this._pressable&&this._pressable.destroy(),this.disconnectCommonMutationObserver(),this.logger.stop()}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-slider attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this.unsubscribeFromObjectSignals(),this.unsubscribeFromAnalogSignals()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}submit(){this.logger.start("Ch5Slider.submit()"),"submit"===this.feedbackMode&&!0===this._dirtyLow&&(this._submitted=!0,this._setDirtyHandler(0),this._sendValueForChangeSignal(this._userLowValue)),"submit"===this.feedbackMode&&!0===this.range&&!0===this._dirtyHigh&&(this._submitted=!0,this._setDirtyHandler(1),this._sendHighValueForChangeSignal(this._userHighValue)),this.logger.stop()}reset(){this.logger.start("Ch5Slider.reset()"),this._dirtyLow&&(this._setSliderValue(Number(this._cleanValue),0),this.value=Number(this._cleanValue),this._setCleanLow()),this._dirtyHigh&&(this._setSliderValue(Number(this._cleanValueHigh),1),this.valueHigh=Number(this._cleanValueHigh),this._setCleanHigh()),this.setClean(),this.logger.stop()}setClean(){this._cleanLow&&this._cleanHigh&&(this._clean=!0,this._dirty=!1,this._submitted=!1,"submit"===this.feedbackMode&&(this.dispatchEvent(this.cleanEvent=new CustomEvent("clean",{bubbles:!0,cancelable:!1})),this.onclean instanceof HtmlCallback?this.onclean.run({}):this.onclean instanceof Function&&this.onclean()))}setDirty(){super.setDirty(),"submit"===this.feedbackMode&&(this.dispatchEvent(this.dirtyEvent=new CustomEvent("dirty",{bubbles:!0,cancelable:!1})),this.ondirty instanceof HtmlCallback?this.ondirty.run({}):this.ondirty instanceof Function&&this.ondirty())}setDirtyValue(e,t){switch(e){case 0:this._setDirtyLow(),this._dirtyValue=Number(t[e]);break;case 1:this._setDirtyHigh(),this._dirtyValueHigh=Number(t[e])}}updateForChangeInDisabledStatus(){super.updateForChangeInDisabledStatus(),!0===this.disabled?this._innerContainer.setAttribute("disabled","true"):this._innerContainer.removeAttribute("disabled")}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._elOnContainer=document.createElement("div"),this._elOnContainer.classList.add("slider-on-button"),this._elOffContainer=document.createElement("div"),this._elOffContainer.classList.add("slider-off-button"),this._innerContainer=document.createElement("div"),this._elTitleContainer=document.createElement("div"),this._elTitleContainer.classList.add("ch5-title-container"),this._elSliderContainer=document.createElement("div"),this._elSliderContainer.classList.add("ch5-slider-button-container"),this._elContainer.classList.add("ch5-slider"),this._elSliderContainer.appendChild(this._elOffContainer),this._elSliderContainer.appendChild(this._innerContainer),this._elSliderContainer.appendChild(this._elOnContainer),this._elContainer.appendChild(this._elTitleContainer),this._elContainer.appendChild(this._elSliderContainer),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}!1===this._innerContainer.isConnected&&this._elSliderContainer.insertBefore(this._innerContainer,this._elOnContainer)}updateCssClasses(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this.handleTapSettable(),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.HANDLE_SHAPE.classListPrefix+this.handleShape),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ON_OFF_ONLY.classListPrefix+this.onOffOnly),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.HANDLE_SIZE.classListPrefix+this.handleSize),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.TOOL_TIP_SHOW_TYPE.classListPrefix+this.toolTipShowType),this.logger.stop()}attachEventListeners(){super.attachEventListeners(),null!==this._innerContainer.querySelector(".noUi-handle")&&(this._innerContainer.addEventListener("mouseleave",this._onMouseLeave),this._innerContainer.addEventListener("touchmove",this._onMouseLeave)),null!==this._pressable&&(this._pressable.init(),this._subscribeToPressableIsPressed()),this.stretch&&resizeObserver(this.parentElement,this.onWindowResizeHandler.bind(this))}removeEvents(){if(super.removeEventListeners(),null!==this._innerContainer.querySelector(".noUi-handle")){const e=this._innerContainer.querySelector(".noUi-handle");e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("click",this.sendEventOnHandleClickHandle),this._innerContainer.removeEventListener("mouseleave",this._onMouseLeave),this._innerContainer.removeEventListener("touchmove",this._onMouseLeave),e.removeEventListener("pointermove",e=>{e.stopPropagation()})}_32.isNil(this._pressable)||this._unsubscribeFromPressableIsPressed()}getTargetElementForCssClassesAndStyle(){return this._elContainer}createSlider(){this._renderPromise().then(()=>{window.setTimeout(()=>{this._applySignalReceivedBeforeRender()},0)})}_renderPromise(){return new Promise((e,t)=>{var i,s,n,r,a,l,o,h;if(null===this._innerContainer||void 0===this._innerContainer)return t(!1);const c=this._parsedSliderOptions();try{Ch5Common.isNil(this._innerContainer.noUiSlider)||null==(s=null==(i=this._innerContainer)?void 0:i.noUiSlider)||s.destroy();const t=create(this._innerContainer,c);null==(r=null==(n=this._innerContainer)?void 0:n.noUiSlider)||r.on("slide",this._onSliderChange),null==(l=null==(a=this._innerContainer)?void 0:a.noUiSlider)||l.on("start",this._onSliderStart),null==(h=null==(o=this._innerContainer)?void 0:o.noUiSlider)||h.on("end",this._onSliderStop);const u=this._innerContainer.querySelector(".noUi-handle");u.addEventListener("focus",this._onFocus),u.addEventListener("blur",this._onBlur),u.addEventListener("click",this.sendEventOnHandleClickHandle),u.addEventListener("pointermove",e=>{e.stopPropagation()}),this._tgtEls=[],this._tgtEls.push(this._innerContainer.querySelectorAll(".noUi-connect")),this._tgtEls.push(this._innerContainer.querySelectorAll(".noUi-origin")),this._tooltip=this._innerContainer.querySelectorAll(".noUi-tooltip"),e(t)}catch(e){t(e)}})}onWindowResizeHandler(){this.isResizeInProgress||(this.isResizeInProgress=!0,setTimeout(()=>{this.stretch&&(this.stretchHandler(),this._render()),this.isResizeInProgress=!1},this.RESIZE_DEBOUNCE))}_subscribeToPressableIsPressed(){null===this._isPressedSubscription&&null!==this._pressable&&(this._isPressedSubscription=this._pressable.observablePressed.subscribe(e=>{!1===e.pressed?(null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),this.handleSendEvent(e.range,!1)):(this.handleSendEvent(e.range,!0),null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),this._repeatDigitalInterval=window.setInterval(()=>{this.handleSendEvent(e.range,!0)},400))}))}_unsubscribeFromPressableIsPressed(){null!==this._repeatDigitalInterval&&window.clearInterval(this._repeatDigitalInterval),null!==this._isPressedSubscription&&(this._isPressedSubscription.unsubscribe(),this._isPressedSubscription=null)}_setSliderValue(e,t,i){var s,n,r,a;if(!_32.isNil(this._innerContainer)&&!_32.isNil(this._innerContainer.noUiSlider)){const l=void 0!==i?Math.round(i):0;e<this.min?e=this.min:e>this.max&&(e=this.max);let o=[e,null];1===t&&(e<this.value?e=this.value+1:e>this.max&&(e=this.max),o=[null,e]),isNaN(l)||l<=0||l>12e4?(this._stopRcbAnimation(t),null==(n=null==(s=this._innerContainer)?void 0:s.noUiSlider)||n.set(o)):(null==(a=null==(r=this._innerContainer)?void 0:r.noUiSlider)||a.set(o),this._adjustTooltipValue(t),this._startRcbAnimation(l,t))}}_onSliderSlide(e,t){this.logger.start("Ch5Slider._onSliderSlide()"),this.dispatchEvent(this.sliderEvent=new CustomEvent("slider",{bubbles:!0,cancelable:!1,detail:{handle:t,value:e}})),this.logger.stop()}_onSliderStart(e,t){this.logger.start("Ch5Slider._onSliderStart()"),this._innerContainer.removeEventListener("touchmove",this._onTouchMoveEnd),this._innerContainer.addEventListener("touchmove",this._onMouseLeave),this.dispatchEvent(this.sliderStartEvent=new CustomEvent("slidestart",{bubbles:!0,cancelable:!1,detail:{handle:t,value:e}})),this.isSliderStarted=!0,this.logger.stop()}_onSliderStop(e,t){this.logger.start("Ch5Slider._onSliderStop()"),this.isSliderStarted=!1,this.sliderTouch=null,this.dispatchEvent(this.sliderEndEvent=new CustomEvent("slideend",{bubbles:!0,cancelable:!1,detail:{handle:t,value:e}})),this.logger.stop()}_onSliderChange(e,t){this.logger.start("Ch5Slider._onSliderChange()"),this._applyHandleValueToComponent(t,e),void 0!==e&&"direct"===this._feedbackMode&&this._sendHandleValueSignal(t,e),this.dispatchEvent(this.sliderEvent=new CustomEvent("slider",{bubbles:!0,cancelable:!1,detail:{handle:t,value:e}})),this._dirty||this.setDirty(),this._dirty&&this.setDirtyValue(t,e),this._maybeSetComponentClean(),this.logger.stop()}_onFocus(e){this.logger.start("Ch5Slider._onFocus()"),e.cancelable&&e.preventDefault(),e.stopPropagation(),this.dispatchEvent(this.focusEvent=new CustomEvent("focus",{bubbles:!0,cancelable:!1})),this.logger.stop()}_onTouchMoveEnd(e){this.isSliderStarted=!1,e.cancelable&&e.preventDefault(),e.stopPropagation()}_onMouseLeave(t){if(!0===this.isSliderStarted){const i=this._innerContainer.querySelector(".noUi-handle");let s=null,n=null;if("touchmove"===t.type){if(_32.isNil(this.sliderTouch)){const e=t.touches[0]||t.changedTouches[0];this.sliderTouch={clientX:e.clientX,clientY:e.clientY}}const i=t.touches[0]||t.changedTouches[0];s=i.clientX,n=i.clientY;let r=0,a=0;if(!s||!n)return;"vertical"===this.orientation?(r=Math.abs(this.sliderTouch.clientX-s),a=this._innerContainer.clientWidth+e.OFFSET_THRESHOLD):(r=Math.abs(this.sliderTouch.clientY-n),a=this._innerContainer.clientHeight+e.OFFSET_THRESHOLD),a<r&&(this.isSliderStarted=!1,this._innerContainer.addEventListener("touchmove",this._onTouchMoveEnd),this.dispatchEvent(this.blurEvent=new CustomEvent("touchend",{bubbles:!1,cancelable:!1})))}else{s=t.clientX,n=t.clientY;let r=0,a=0;if(!s||!n)return;"vertical"===this.orientation?(r=Math.abs(this._innerContainer.clientLeft-s),a=this._innerContainer.clientWidth+e.OFFSET_THRESHOLD):(r=Math.abs(this._innerContainer.clientTop-n),a=this._innerContainer.clientHeight+e.OFFSET_THRESHOLD),a<r&&(this.isSliderStarted=!1,this.dispatchEvent(this.blurEvent=new CustomEvent("mouseup",{bubbles:!0,cancelable:!1})),i.blur())}}}_onBlur(e){this.logger.start("Ch5Slider._onBlur()"),e.cancelable&&e.preventDefault(),e.stopPropagation(),this.dispatchEvent(this.blurEvent=new CustomEvent("blur",{bubbles:!0,cancelable:!1})),this.logger.stop()}_applyHandleValueToComponent(e,t){switch(e){case 0:this._userLowValue=Number(t[e]);break;case 1:this._userHighValue=Number(t[e])}}_sendHandleValueSignal(e,t){const i=Math.round(Number(t[e]));switch(e){case 0:this._setDirtyHandler(e),this._sendValueForChangeSignal(i);break;case 1:this._setDirtyHandler(e),this._sendHighValueForChangeSignal(i)}}_sendValueForChangeSignal(e){let t=null;Ch5Common.isNotNil(this.sendEventOnChange)&&(t=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventOnChange),null!==t&&t.value!==e&&t.publish(e))}_sendHighValueForChangeSignal(e){let t=null;this.range&&Ch5Common.isNotNil(this.sendEventOnChangeHigh)&&(t=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventOnChangeHigh),null!==t&&t.publish(e))}_setDirtyHandler(e){switch(this.logger.start("Ch5Slider._setDirtyHandler"),e){case 0:null!==this._dirtyTimerHandle&&clearTimeout(this._dirtyTimerHandle),this._dirtyTimerHandle=window.setTimeout(()=>this._onDirtyTimerFinished(e),this._signalValueSyncTimeout);break;case 1:null!==this._dirtyTimerHandleHigh&&clearTimeout(this._dirtyTimerHandleHigh),this._dirtyTimerHandleHigh=window.setTimeout(()=>this._onDirtyTimerFinished(e),this._signalValueSyncTimeout)}this.logger.stop()}_onDirtyTimerFinished(e){switch(this.logger.start("Ch5Slider._onDirtyTimerFinished"),e){case 0:if(this._dirtyTimerHandle=null,this._dirtyValue!==this._cleanValue){const e=Number(this._cleanValue);this._setSliderValue(e,0),this.value=e,this._setCleanLow(),this._applyTooltipValue(this._tooltip[0],e)}break;case 1:if(this._dirtyTimerHandleHigh=null,this._dirtyValueHigh!==this._cleanValueHigh){const e=Number(this._cleanValueHigh);this._setSliderValue(e,1),this.valueHigh=e,this._setCleanHigh(),this._applyTooltipValue(this._tooltip[1],e)}}this.setClean(),this.logger.stop()}_maybeSetComponentClean(){this._dirtyValue===this._cleanValue&&this._setCleanLow(),this._dirtyValueHigh===this._cleanValueHigh&&this._setCleanHigh(),this.setClean()}_parsedSliderOptions(){let e=this.tapSettable?"tap":"none";!1===this.tapSettable&&(this.sendEventOnUpper||this.sendEventOnLower)&&!0===this.isAdvancedSlider&&(e="hover","%"===this.toolTipDisplayType&&(this.toolTipShowType="off"));let t="ltr";t="vertical"===this.orientation?"rtl"===this.dir?"ltr":"rtl":this.dir,Ch5Common.isNil(t)&&(t="ltr");const i=this._connectDisplayFormatter(),s=this.step;let n={min:this.min,max:this.max};const r=this._parsedTicks();let a={};"object"==typeof r&&(this._maybeSetMinAndMaxFromPips(r),n=this._getRangeFromPips(r),a={mode:"positions",density:100,values:Object.keys(r).map(e=>Number(e)),format:{to:e=>this.showTickValues?e:""}},this.handleValue(),this.handleValueHigh());const l="off"!==this.toolTipShowType&&(this.range?[{to:this._toolTipDisplayTypeFormatter.bind(this)},{to:this._toolTipDisplayTypeFormatter.bind(this)}]:[{to:this._toolTipDisplayTypeFormatter.bind(this)}]);return{start:this._getStartValue(),animate:!1,step:s,behaviour:e,connect:i,direction:t,range:n,orientation:this.orientation,pips:0!==Object.getOwnPropertyNames(r).length?a:void 0,tooltips:l}}_getRangeFromPips(e){const t={};for(const i in e)if(e.hasOwnProperty(i)){if(Object.keys(e)[0]===i){if(0===Number(i)){t.min=Number(this.min);continue}t.min=Number(this.min)}if(Object.keys(e)[Object.keys(e).length-1]===i){if(100===Number(i)){t.max=Number(this.max);continue}t.max=Number(this.max)}t[i+"%"]=Number(e[i])}return t}_maybeSetMinAndMaxFromPips(e){for(const t in e)e.hasOwnProperty(t)&&(Object.keys(e)[0]===t&&0===Number(t)&&(this.min=Number(e[t])),Object.keys(e)[Object.keys(e).length-1]===t&&100===Number(t)&&(this.max=Number(e[t])))}_parsedTicks(){if(Ch5Common.isNotNil(this.ticks))try{const e=JSON.parse(this.ticks);if(e&&"object"==typeof e)return e}catch(e){return!1}return!1}_setDirtyHigh(){this._dirtyHigh=!0,this._cleanHigh=!1}_setDirtyLow(){this._dirtyLow=!0,this._cleanLow=!1}_setCleanLow(){this._cleanLow=!0,this._dirtyLow=!1}_setCleanHigh(){this._cleanHigh=!0,this._dirtyHigh=!1}_toolTipDisplayTypeFormatter(e){return"%"===this.toolTipDisplayType?this._tooltipValueToPercent(e):Math.round(e).toString()}_tooltipValueToPercent(e){const t=Math.round(e);if(isNaN(t))return e;return Math.round(100*(t-this.min)/(this.max-this.min)).toString()+"%"}_connectDisplayFormatter(){return!0===this.range?[!1,!0,!1]:[!0,!1]}_startRcbAnimation(e,t){const i={transitionProperty:"transform",transitionTimingFunction:"linear"};i.transitionDuration=e.toString()+"ms",this._setStyleParameters(i),void 0!==this._animationTimer&&(window.clearTimeout(this._animationTimer),this._animationTimer=void 0),this._animatingHandle[t]=!0,this._animationTimer=window.setTimeout(()=>this._stopRcbAnimation(t),e)}_stopRcbAnimation(e){if(void 0===this._animationTimer)return;this._animatingHandle[e]=!1,window.clearTimeout(this._animationTimer),this._animationTimer=void 0;this._setStyleParameters({transitionProperty:"none",transitionDuration:"0ms",transitionTimingFunction:"ease"})}_setStyleParameters(e){for(const t of this._tgtEls)for(const i of Array.from(t))for(const t in e)if(e.hasOwnProperty(t)){const s=e[t];i.style[t]=s}}subscribeToAnalogSignal(){if(this.receiveStateValue){const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&(this._subReceiveAnalogValueId=t.subscribe(e=>{null===this._dirtyTimerHandle&&this._applyTooltipValue(this._tooltip[0],e),this._tooltipValueFromSignal=e}))}}subscribeToAnalogHighSignal(){if(this.receiveStateValueHigh){const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateValueHigh),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&(this._subReceiveAnalogValueHighId=t.subscribe(e=>{null===this._dirtyTimerHandleHigh&&this._applyTooltipValue(this._tooltip[1],e),this._tooltipHighValueFromSignal=e}))}}unsubscribeFromAnalogSignals(){const e=Ch5SignalFactory.getInstance();if(""!==this._subReceiveAnalogValueId&&""!==this._receiveStateValueSignal){const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateValueSignal),i=e.getNumberSignal(t);null!==i&&(i.unsubscribe(this._subReceiveAnalogValueId),this._subReceiveAnalogValueId="")}if(""!==this._subReceiveAnalogValueHighId&&""!==this._receiveStateValueSignalHigh){const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateValueSignalHigh),i=e.getNumberSignal(t);null!==i&&(i.unsubscribe(this._subReceiveAnalogValueHighId),this._subReceiveAnalogValueHighId="")}}unsubscribeFromObjectSignals(){const e=Ch5SignalFactory.getInstance();if(""!==this._subReceiveValueId&&""!==this._receiveStateValueSignal){const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateValueSignal),i=e.getObjectSignal(t);null!==i&&(i.unsubscribe(this._subReceiveValueId),this._receiveStateValueSignal="")}if(""!==this._subReceiveValueHighId&&""!==this._receiveStateValueSignalHigh){const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateValueSignalHigh),i=e.getObjectSignal(t);null!==i&&(i.unsubscribe(this._subReceiveValueHighId),this._receiveStateValueSignalHigh="")}}_applyTooltipValue(e,t){null!=e&&(this.min<0&&t>32767&&(t-=65536),t>this.max?t=this.max:t<this.min&&(t=this.min),e.textContent=this._toolTipDisplayTypeFormatter(t))}_calculatedValueWhileInRamp(){let e=this.value;if(void 0!==this._rcbSignalValue&&void 0!==this._rcbSignalValue.rcb.startv&&void 0!==this._rcbSignalValue.rcb.startt){const t=(this._rcbSignalValue.rcb.value-this._rcbSignalValue.rcb.startv)/this._rcbSignalValue.rcb.time,i=Date.now()-this._rcbSignalValue.rcb.startt;e=Math.round(t*i+this._rcbSignalValue.rcb.startv)}return e}_calculatedHighValueWhileInRamp(){let e=this.value;if(void 0!==this._rcbSignalValueHigh&&void 0!==this._rcbSignalValueHigh.rcb.startv&&void 0!==this._rcbSignalValueHigh.rcb.startt){const t=(this._rcbSignalValueHigh.rcb.value-this._rcbSignalValueHigh.rcb.startv)/this._rcbSignalValueHigh.rcb.time,i=Date.now()-this._rcbSignalValueHigh.rcb.startt;e=Math.round(t*i+this._rcbSignalValueHigh.rcb.startv)}return e}_applySignalReceivedBeforeRender(){void 0!==this._rcbSignalValue&&0!==this._rcbSignalValue.rcb.time&&void 0!==this._rcbSignalValue.rcb.startv&&void 0!==this._rcbSignalValue.rcb.startt&&this._setSliderValue(this._rcbSignalValue.rcb.value,0,this._rcbSignalValue.rcb.time-(Date.now()-this._rcbSignalValue.rcb.startt)),void 0!==this._rcbSignalValueHigh&&0!==this._rcbSignalValueHigh.rcb.time&&void 0!==this._rcbSignalValueHigh.rcb.startv&&void 0!==this._rcbSignalValueHigh.rcb.startt&&this._setSliderValue(this._rcbSignalValueHigh.rcb.value,1,this._rcbSignalValueHigh.rcb.time-(Date.now()-this._rcbSignalValueHigh.rcb.startt))}_adjustTooltipValue(e){const t=0===e?0:1;void 0!==this._tooltipValueFromSignal&&0===e&&this._applyTooltipValue(this._tooltip[t],this._tooltipValueFromSignal),void 0!==this._tooltipHighValueFromSignal&&1===e&&this._applyTooltipValue(this._tooltip[t],this._tooltipHighValueFromSignal)}_getStartValue(){let e=this.value,t=this.valueHigh;this.value<this.min&&(e=this.min),this.value>this.max&&(e=this.max),this.valueHigh>this.max&&(t=this.max),this.valueHigh<=this.value&&(t=this.value);let i=!1===this.range?e:[e,t];return this._cleanValue=e,!0===this.range&&(this._cleanValueHigh=t),this._wasRendered||(i=this._getStartValueWhileInRamp()),i}_getStartValueWhileInRamp(){let e,t;return e=void 0!==this._rcbSignalValue&&void 0!==this._rcbSignalValue.rcb.startv&&0!==this._rcbSignalValue.rcb.time?this._calculatedValueWhileInRamp():this.value,t=void 0!==this._rcbSignalValueHigh&&void 0!==this._rcbSignalValueHigh.rcb.startv&&0!==this._rcbSignalValueHigh.rcb.time?this._calculatedHighValueWhileInRamp():this.valueHigh,this.value<this.min&&(e=this.min),this.value>this.max&&(e=this.max),this.valueHigh>this.max&&(t=this.max),this.valueHigh<=this.value&&(t=this.value),this._cleanValue=e,!0===this.range&&(this._cleanValueHigh=t),this.range?[e,t]:e}handleHandleShape(){Array.from(e.COMPONENT_DATA.HANDLE_SHAPE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.HANDLE_SHAPE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.HANDLE_SHAPE.classListPrefix+this.handleShape)}handleSendEvent(e,t){var i,s;this.range||!1===this.isAdvancedSlider||this.disabled||(""!==this.sendEventOnUpper&&null!==this.sendEventOnUpper&&void 0!==this.sendEventOnUpper&&"upper"===e?null==(i=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnUpper))||i.publish(t):""!==this.sendEventOnLower&&null!==this.sendEventOnLower&&void 0!==this.sendEventOnLower&&"lower"===e&&(null==(s=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnLower))||s.publish(t)))}sendEventOnHandleClickHandle(){var e,t;this.sendEventOnHandleClick&&!this.disabled&&(null==(e=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnHandleClick))||e.publish(!0),null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnHandleClick))||t.publish(!1))}handleValue(){var e,t;this.value>this.max?this.value=this.max:this.value<this.min&&(this.value=this.min),this.range&&this.value>this.valueHigh&&(this.value=this.valueHigh-1),null!==this._dirtyTimerHandle&&(clearTimeout(this._dirtyTimerHandle),this._dirtyTimerHandle=null),this._wasRendered&&(null==(t=null==(e=this._innerContainer)?void 0:e.noUiSlider)||t.set(this.value))}handleValueHigh(){var e,t;!1!==this.range&&(this.valueHigh>this.max?this.valueHigh=this.max:this.valueHigh<this.min&&(this.valueHigh=this.min),this.valueHigh<=this.value&&(this.valueHigh=this.value),null!==this._dirtyTimerHandleHigh&&(clearTimeout(this._dirtyTimerHandleHigh),this._dirtyTimerHandleHigh=null),this._wasRendered&&(null==(t=null==(e=this._innerContainer)?void 0:e.noUiSlider)||t.set([this.value,this.valueHigh])))}handleMax(){this.max<=this.min&&(this.max=this.min+1),this.value>this.max&&(this.value=this.max);const e=(this.max-this.min)/this.step;0!==(this.max-this.min)%this.step&&(this.max=this.min+Math.floor(e)*this.step),this._render()}handleMin(){this.min>=this.max&&(this.min=this.max-1),this.value<this.min&&(this.value=this.min),this._render()}handleOrientation(){Array.from(e.COMPONENT_DATA.ORIENTATION.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this._render()}sizeHandler(){Array.from(e.COMPONENT_DATA.SIZE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this._render()}handleHandleSize(){Array.from(e.COMPONENT_DATA.HANDLE_SIZE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.HANDLE_SIZE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.HANDLE_SIZE.classListPrefix+this.handleSize),this._render()}handleStretch(){Array.from(e.COMPONENT_DATA.STRETCH.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.STRETCH.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.STRETCH.classListPrefix+this.stretch),this.stretchHandler(),this._render()}stretchHandler(){let e=this.offsetHeight,t=this.offsetWidth,i=this.offsetHeight;if(this.stretch||(e=0,t=0),this._elContainer&&this._elContainer.style){const s=this.parentElement;this.stretch&&this.stretch.trim().length>0&&s&&(t=s.offsetWidth,e=s.offsetHeight,i=1===this._titlePresent?e-24:e,"height"===this.stretch?(!0===this.isAdvancedSlider?(this._elSliderContainer.style.height=i+"px",this._elContainer.style.height=e+"px",this._elSliderContainer.style.removeProperty("width")):this._elContainer.style.height=e+"px",this._elContainer.style.removeProperty("width")):"width"===this.stretch?(!0===this.isAdvancedSlider?(this._elSliderContainer.style.width=t+"px",this._elContainer.style.width=t+"px",this._elSliderContainer.style.removeProperty("height")):this._elContainer.style.width=t+"px",this._elContainer.style.removeProperty("height")):"both"===this.stretch&&(!0===this.isAdvancedSlider?(this._elSliderContainer.style.width=t+"px",this._elSliderContainer.style.height=i+"px",this._elContainer.style.width=t+"px",this._elContainer.style.height=e+"px"):(this._elContainer.style.width=t+"px",this._elContainer.style.height=e+"px")))}}handleOnOffOnly(){this.range||!1===this.isAdvancedSlider?Array.from(e.COMPONENT_DATA.ON_OFF_ONLY.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.ON_OFF_ONLY.classListPrefix+String(t))}):(Array.from(e.COMPONENT_DATA.ON_OFF_ONLY.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.ON_OFF_ONLY.classListPrefix+String(t))}),!0===this.onOffOnly?this._innerContainer.classList.add("ch5-hide-vis"):this._innerContainer.classList.remove("ch5-hide-vis"),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ON_OFF_ONLY.classListPrefix+String(this.onOffOnly)))}handleTapSettable(){!0===this.noHandle?this._elContainer.classList.add("nohandle"):this._elContainer.classList.remove("nohandle")}handleToolTipShowType(){Array.from(e.COMPONENT_DATA.TOOL_TIP_SHOW_TYPE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.TOOL_TIP_SHOW_TYPE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.TOOL_TIP_SHOW_TYPE.classListPrefix+this.toolTipShowType),this._render()}onOffButtonHelper(){let e=null,t=null;if(!0===this.range)this._elOffContainer.classList.remove("ch5-advanced-slider-button"),this._elOnContainer.classList.remove("ch5-advanced-slider-button"),this.isAdvancedSlider=!1,this._elContainer.classList.remove("ch5-advanced-slider-container");else{const i=this.getElementsByTagName("ch5-slider-button");if(0===i.length){this._elOffContainer.classList.add("ch5-advanced-slider-button"),this._elOnContainer.classList.add("ch5-advanced-slider-button");0!==this.getElementsByTagName("ch5-slider-title-label").length?(this.isAdvancedSlider=!0,this._elContainer.classList.add("ch5-advanced-slider-container")):(this.isAdvancedSlider=!1,this._elContainer.classList.remove("ch5-advanced-slider-container"))}else this._elOffContainer.classList.remove("ch5-advanced-slider-button"),this._elOnContainer.classList.remove("ch5-advanced-slider-button"),this.isAdvancedSlider=!0,this._elContainer.classList.add("ch5-advanced-slider-container"),Array.from(i).forEach(i=>{"off"===i.getAttribute("key")?(t=i,this.stretch&&"horizontal"===this.orientation?i.classList.add("ch5-slider-horizontal-stretch"):"vertical"!==this.orientation||"both"!==this.stretch&&"width"!==this.stretch||i.classList.add("ch5-slider-vertical-stretch"),this._elContainer.classList.add("ch5-slider-off-button")):"on"===i.getAttribute("key")&&(e=i,this.stretch&&"horizontal"===this.orientation?i.classList.add("ch5-slider-horizontal-stretch"):"vertical"!==this.orientation||"both"!==this.stretch&&"width"!==this.stretch||i.classList.add("ch5-slider-vertical-stretch"),this._elContainer.classList.add("ch5-slider-on-button"))}),e&&this._elOnContainer.appendChild(e),t&&this._elOffContainer.appendChild(t)}}titleHelper(){if(!1===this.range){const t=this.getElementsByTagName("ch5-slider-title-label");Array.from(t).forEach((t,i)=>{if(!(i>=1)){if(t.parentElement instanceof e){const e=new Ch5SliderTitleLabel(this);Ch5SliderTitleLabel.observedAttributes.forEach(i=>{t.hasAttribute(i)&&e.setAttribute(i,t.getAttribute(i)+"")})}this._elContainer.classList.add("ch5-slider-title")}})}else this._elContainer.classList.remove("ch5-slider-title")}helper(e,t){Array.from(e.children).forEach(e=>e.remove()),e.appendChild(t)}setValues(e,t){!1===this.range&&("title"===e?(""!==t.innerHTML?this._titlePresent=1:this._titlePresent=-1,this.helper(this._elTitleContainer,t)):"on"===e?this.helper(this._elOnContainer,t):"off"===e&&this.helper(this._elOffContainer,t))}handleToolTipDisplayType(){Array.from(e.COMPONENT_DATA.TOOL_TIP_DISPLAY_TYPE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.TOOL_TIP_DISPLAY_TYPE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.TOOL_TIP_DISPLAY_TYPE.classListPrefix+this.toolTipDisplayType),this._render()}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5Slider.ELEMENT_NAME,Ch5Slider),Ch5Slider.registerSignalAttributeTypes(),Ch5Slider.registerSignalAttributeDefaults(Ch5Slider.ELEMENT_NAME);import _34 from"lodash";import _33 from"lodash";var Ch5SliderButtonLabel=class e extends Ch5Label{constructor(t){super("Ch5-slider-button"),this.parent=t,this.ignoreAttributes=["disabled","debug","show","customclass","customstyle","noshowtype","receivestatecustomclass","receivestatecustomstyle","receivestateshow","receivestateshowpulse","receivestatehidepulse","receivestateenable","sendeventonshow","gestureable","dir","appendclasswheninviewport","label","receivestatelabel"],this.logger.start("constructor()",e.ELEMENT_NAME),_33.isNil(t)?this._parentCh5Slider=this.getParentButton():this._parentCh5Slider=t}parent;static ELEMENT="ch5-slider-button-label";primaryCssClass="ch5-slider-button-label";_parentCh5Slider;debounceCreateBtnLabel=this.debounce(()=>{_33.isNil(this._parentCh5Slider)&&(this._parentCh5Slider=this.getParentButton()),this._parentCh5Slider.setValues()},50);static get observedAttributes(){const t=Ch5Label.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-slider-button attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.debounceCreateBtnLabel(),this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.setAttribute("role",Ch5RoleAttributeMapping.ch5SliderButton),this.setAttribute("data-ch5-id",this.getCrId()),super.connectedCallback(),this.createInternalHtml(),this.initAttributes(),this.updateCssClass(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){super.createInternalHtml(),this.logger.start("createInternalHtml()"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}getParentButton(){const e=t=>_33.isNil(t)||"CH5-SLIDER-BUTTON"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}attachEventListeners(){super.attachEventListeners()}removeEventListeners(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals()}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this.logger.stop()}handleLabel(){}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5SliderButtonLabel.ELEMENT,Ch5SliderButtonLabel);var Ch5SliderButton=class e extends Ch5ButtonBase{static KEY=["on","off"];static inheritedObsAttrs=["key","labelinnerhtml","label","sgicontheme","iconclass","pressed","selected","shape","halignlabel","valignlabel","type","iconurl","iconurlfilltype","sendeventonclick","receivestatelabel","receivestateiconclass","receivestateiconurl"];static COMPONENT_DATA={KEY:{default:e.KEY[0],values:e.KEY,key:"key",attribute:"key",classListPrefix:"--key-"}};static COMPONENT_PROPERTIES=[{default:"",enumeratedValues:e.KEY,name:"key",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelInnerHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-slider-button";primaryCssClass="ch5-button";debounceCreateSliderButton=this.debounce(()=>{this.setButtonDisplay(),this.updateInternalHtml()},50);set key(e){this._ch5Properties.set("key",e,()=>{this.debounceCreateSliderButton()})}get key(){return this._ch5Properties.get("key")}set labelInnerHTML(e){this._ch5Properties.set("labelInnerHTML",e,()=>{this.createSliderButtonLabel(),this.debounceCreateSliderButton()})}get labelInnerHTML(){return this._ch5Properties.get("labelInnerHTML")}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=["disabled","debug","show","customclass","customstyle","noshowtype","receivestatecustomclass","receivestatecustomstyle","receivestateshow","receivestateshowpulse","receivestatehidepulse","receivestateenable","sendeventonshow","gestureable","dir","appendclasswheninviewport"],this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}static get observedAttributes(){const t=[];for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&t.push(e.COMPONENT_PROPERTIES[i].name.toLowerCase());return t.concat(e.inheritedObsAttrs)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),e.inheritedObsAttrs.includes(t.toLowerCase())){if(i!==s){this.logger.log('ch5-slider-button attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.debounceCreateSliderButton()}this.logger.stop()}createSliderButtonLabel(){const e=this.getElementsByTagName("ch5-slider-button-label"),t=Array.prototype.slice.call(e).filter(e=>e.parentNode.nodeName.toString().toLowerCase()===this.nodeName.toString().toLowerCase());let i=null;t&&t.length>0&&!_34.isNil(t[0].children[0])?i=t[0]:(i=document.createElement("ch5-slider-button-label"),this.appendChild(i));let s=i.querySelector("template");null!==s&&i.removeChild(s),s=document.createElement("template"),s.innerHTML=this.decodeInnerHTMLForAttribute(this.labelInnerHTML),i.appendChild(s)}buttonIgnoredAttributes(){const e=["iconposition","orientation","checkboxshow","checkboxposition","pressdelaytime","pressdelaydistance","size","stretch","formtype","mode","customclassselected","customclasspressed","customclassdisabled","receivestatemode","receivestateselected","receivestatescriptlabelhtml","receivestatetype","sendeventontouch","backgroundimageurl","backgroundimagefilltype","receivestatebackgroundimageurl","receivestatecustomclass","receivestatecustomstyle","disabled","show","customclass","customstyle"];for(let t=0;t<e.length;t++)this.hasAttribute(e[t].toLowerCase())&&this.removeAttribute(e[t].toLowerCase());this.setAttribute("iconPosition","top")}connectedCallback(){var t,i,s,n;this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.setAttribute("data-ch5-id",this.getCrId()),this.buttonIgnoredAttributes(),((null==(t=this.parentElement)?void 0:t.classList.contains("slider-on-button"))||(null==(i=this.parentElement)?void 0:i.classList.contains("slider-off-button")))&&(this.getAttribute("key")&&"on"!==(null==(s=this.getAttribute("key"))?void 0:s.toLowerCase())&&"off"!==(null==(n=this.getAttribute("key"))?void 0:n.toLowerCase())||(super.connectedCallback(),this.initAttributes(),this.updateCssClass(),this.handleLabel(),this.logger.stop()))}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}createInternalHtml(){super.createInternalHtml(),this.logger.start("createInternalHtml()"),this.clearComponentContent(),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}for(let i=0;i<e.inheritedObsAttrs.length;i++)if(this.hasAttribute(e.inheritedObsAttrs[i].toLowerCase())){const s=e.inheritedObsAttrs[i].toLowerCase();t[s]=this.getAttribute(s)}this.debounceCreateSliderButton()}attachEventListeners(){super.attachEventListeners()}removeEventListeners(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}labelHelper(){const e=this.getElementsByTagName("ch5-slider-button-label");Array.from(e).forEach((e,t)=>{if(t>=1)return;const i=new Ch5SliderButtonLabel(this);Ch5SliderButtonLabel.observedAttributes.forEach(t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t)+"")})})}setValues(){""===this.receiveStateLabel&&this.debounceCreateSliderButton()}handleLabel(){null!==this.receiveStateLabel&&""!==this.receiveStateLabel.trim()||this.hasAttribute("labelInnerHtml")||this.getElementsByTagName("ch5-slider-button-label").length>=1&&this.labelHelper()}setButtonDisplay(){this.setButtonDisplayDetails("ch5-slider-button")}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this.logger.stop()}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5SliderButton.ELEMENT_NAME,Ch5SliderButton),Ch5SliderButton.registerSignalAttributeTypes(),Ch5SliderButton.registerSignalAttributeDefaults(Ch5SliderButton.ELEMENT_NAME);import{isNil as isNil17}from"lodash";var Ch5SpinnerTemplate=class e{static ERROR={structure:"Wrong template structure"};_templateDefined=!1;_element={};_wrapperElement={};_scrollableArea={};_highlightElement={};_overlayElement={};_templateElement={};_childrenObject=null;_initialchildrenObject=null;_appendedItemIndex=0;_prependedItemIndex=0;_clonedItems={};constructor(e){this.element=e,this.checkTemplateDefined(),!0===this._templateDefined&&(this.templateElement=this._element.querySelector("template"))}destruct(){this.childrenObject=null,this.wrapperElement={},this.scrollableArea={},this.templateElement={},this.prependedItemIndex=this.element.size}set element(e){void 0===e&&null===e||(this._element=e)}get element(){return this._element}set wrapperElement(e){void 0===e&&null===e||(this._wrapperElement=e)}get wrapperElement(){return this._wrapperElement}set scrollableArea(e){void 0===e&&null===e||(this._scrollableArea=e)}get scrollableArea(){return this._scrollableArea}set highlightElement(e){void 0===e&&null===e||(this._highlightElement=e)}get highlightElement(){return this._highlightElement}set templateElement(e){void 0===e&&null===e||(this._templateElement=e,this.iconPositioning())}get templateElement(){return this._templateElement}set childrenObject(e){void 0===e&&null===e||(this._childrenObject=e)}get childrenObject(){return this._childrenObject}set initialchildrenObject(e){void 0===e&&null===e||(this._initialchildrenObject=e)}get initialchildrenObject(){return this._initialchildrenObject}set overlayElement(e){void 0===e&&null===e||(this._overlayElement=e)}get overlayElement(){return this._overlayElement}set appendedItemIndex(e){(e>this.element.size||e!==this.appendedItemIndex&&null==e)&&(e=0),e>=this.element.size&&(e=0),this._appendedItemIndex=e}get appendedItemIndex(){return this._appendedItemIndex}set prependedItemIndex(e){(e>this.element.size||e!==this.prependedItemIndex&&null==e)&&(e=0),e<=0&&(e=this.element.size-1),this._prependedItemIndex=e}get prependedItemIndex(){return this._prependedItemIndex}addChild(e){return null!=e&&(e.classList.add(Ch5Spinner.primaryCssClass+"__item"),e.style.display="flex",void 0===this.childrenObject||null===this.childrenObject?(this.childrenObject=[e],this.initialchildrenObject=[e]):(this.childrenObject.push(e),this.initialchildrenObject.push(e))),e}generateTemplate(e){const t=this.element.getItemHeightValue(),i=this.element.getItemHeightMeasurementUnit(),s=this.element.visibleItemScroll,n=this.element.endless;this.overlayElement=document.createElement("div"),this.overlayElement.classList.add(Ch5Spinner.primaryCssClass+"__overlay"),this.wrapperElement=document.createElement("div"),this.wrapperElement.classList.add(Ch5Spinner.primaryCssClass+"__wrapper"),!0===this.element.resize&&(this.wrapperElement.style.width="auto"),this.scrollableArea=document.createElement("div"),this.scrollableArea.classList.add(Ch5Spinner.primaryCssClass+"__scrollarea--animate"),this.highlightElement=document.createElement("div"),this.highlightElement.style.height=this._element.itemHeight,this.highlightElement.style.top=this.element.getHighlightOffset(),this.highlightElement.classList.add(Ch5Spinner.primaryCssClass+"__highlight"),!1===this._templateDefined?this.addDefaultTemplate():(this.cleanTheTemplate(),this.element.label="");for(let t=0;t<e;t++)this.invokeChildElement(t);if(null!==this.childrenObject){if(!0===n){const e=this.childrenObject;for(let t=e.length-1;t>=e.length-Math.ceil(s/2);t--)this.pushElementToClonedItemsList("prepended",t,!0);for(let e=0;e<Math.ceil(s/2);e++)this.pushElementToClonedItemsList("appended",e);const n=-this._clonedItems.prepended.length*t+i;this._clonedItems.prepended[0].style.marginTop=n,this._clonedItems.prepended.forEach((e,t)=>{this.scrollableArea.appendChild(e)})}if(this.childrenObject.forEach(e=>{this.scrollableArea.appendChild(e)}),!0===n&&this._clonedItems.appended.forEach(e=>{this.scrollableArea.appendChild(e)}),void 0!==this.childrenObject&&null!==this.childrenObject)for(let e=this.childrenObject.length-1;e>=0;e--)this.childrenObject[e].style.height=this._element.itemHeight}if(this.wrapperElement.style.height=t*s+i,this.wrapperElement.appendChild(this.highlightElement),this.wrapperElement.appendChild(this.scrollableArea),this._element.querySelectorAll("."+Ch5Spinner.primaryCssClass+"__overlay").length||this._element.querySelectorAll("."+Ch5Spinner.primaryCssClass+"__wrapper").length){const e=Array.from(this._element.querySelectorAll("."+Ch5Spinner.primaryCssClass+"__overlay")),t=Array.from(this._element.querySelectorAll("."+Ch5Spinner.primaryCssClass+"__wrapper"));e.forEach(e=>e.parentNode.removeChild(e)),t.forEach(e=>e.parentNode.removeChild(e))}if(this._element.appendChild(this.wrapperElement),this._element.appendChild(this.overlayElement),null!==this.childrenObject&&void 0!==this.childrenObject){for(let e=this.childrenObject.length-1;e>=0;e--){const t=this.childrenObject[e].querySelector("."+Ch5Spinner.primaryCssClass+"__label");if(null!==t&&t.hasAttribute("data-ch5-textcontent-placeholder")){const e=t.getAttribute("data-ch5-textcontent-placeholder");t.removeAttribute("data-ch5-textcontent-placeholder"),t.setAttribute("data-ch5-textcontent",e)}}(parseInt(this._element.itemHeight,10)<=0||isNaN(parseInt(this._element.itemHeight,10)))&&this.handleDefaultItemHeight(this.childrenObject[0])}}toggleOverlay(e=!1,t=!1){this.overlayElement.style.zIndex=!0===t?"999999":"",this.overlayElement.style.display=!0!==e?"none":"block"}setActiveItem(t){try{const e=this.getSelectedItem(t);null!==e&&(this.removeActiveItemClass(),e.classList.add(Ch5Spinner.primaryCssClass+"--active"),this.element.selectedItem=e)}catch(t){console.error(e.ERROR.structure)}}getSelectedItem(t){try{if(null!==this.childrenObject){const e=this.childrenObject[t];if(null!=e)return e}}catch(t){console.error(e.ERROR.structure)}return null}handleDefaultItemHeight(e){let t=null,i=1,s=null,n=0,r=0;i+=this.element.signalValueSyncTimeout/60,this.element.signalValueSyncTimeout>i?(this.toggleOverlay(!0,!0),e&&(t=e.querySelector("ch5-image"),s=e.querySelector("label"),n%8==0&&(r=t&&(t.offsetHeight||t.getBoundingClientRect().height)||s&&(s.offsetHeight||s.getBoundingClientRect().height)||e.offsetHeight||e.getBoundingClientRect().height),n++,r>0&&(this.element.itemHeight=r+""))):this.toggleOverlay(!1)}resolveId(e,t){if(0===t.length)return;const i=document.createElement("template");return Array.from(t).forEach(e=>i.content.appendChild(e)),""!==this.element.indexId&&(Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(i,e,this.element.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(i,e,this.element.indexId)),i.content}iconPositioning(){try{if(null!==this.templateElement&&void 0!==this.templateElement.content){const e=this.templateElement.content.querySelector("."+Ch5Spinner.primaryCssClass+"__icon"),t=this.templateElement.content.querySelector("."+Ch5Spinner.primaryCssClass+"__label"),i=this.element.iconPosition;null!==e&&null!==t&&("last"===i?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.insertBefore(e,t.previousSibling))}}catch(t){console.error(e.ERROR.structure,t)}}pushElementToClonedItemsList(e="append",t,i=!1){if(null!==this.childrenObject&&void 0!==this.childrenObject[t]){const s=this.childrenObject[t].cloneNode(!0);if(s.classList.add("cloned"),s.style.height=this.element.itemHeight,void 0===this._clonedItems[e.toString()])return void(this._clonedItems[e.toString()]=[s]);i?this._clonedItems[e].unshift(s):this._clonedItems[e].push(s)}}invokeChildElement(e){const t=this.element.querySelector("template");let i=document.importNode(t.content,!0);if(i.children.length>0){const t=this.resolveId(e,i.childNodes);void 0!==t&&(i=t);const s=i.children[0];s.setAttribute("data-initial-index",String(e)),s.setAttribute("role","option"),Ch5AugmentVarSignalsNames.differentiateTmplElemsAttrs(s,this.element.getAttribute("contractname")||"",parseInt(this.element.getAttribute("booleanjoinoffset")||"0",10)||0,parseInt(this.element.getAttribute("numericJoinOffset")||"0",10)||0,parseInt(this.element.getAttribute("stringJoinOffset")||"0",10)||0),this.addChild(i.children[0])}}checkTemplateDefined(){null!==this._element.querySelector("template")&&(this._templateDefined=!0)}addDefaultTemplate(){const e=document.createElement("template"),t=document.createElement("ch5-image"),i=document.createElement("label"),s=document.createElement("div"),n=document.createDocumentFragment();t.classList.add(Ch5Spinner.primaryCssClass+"__icon"),""!==this.element.receiveStateUrl&&(t.setAttribute("receiveStateUrl",this.element.receiveStateUrl),t.setAttribute("refreshrate","0"),s.appendChild(t)),i.classList.add(Ch5Spinner.primaryCssClass+"__label"),""!==this.element.receiveStateLabel?i.setAttribute("data-ch5-textcontent-placeholder",this.element.receiveStateLabel):i.innerHTML=this.element.label,s.appendChild(i),n.appendChild(s),e.content.appendChild(n),this._element.appendChild(e),this.templateElement=e}cleanTheTemplate(){const e=this.element.querySelector("template");if(null!=e){let t=e.content.children;0===t.length&&e.childNodes.length>0&&(t=e.children);for(let e=t.length-1;e>=0;e--){1!==t[e].nodeType&&t[e].remove()}}}removeActiveItemClass(){try{const e=this.childrenObject;for(let t=e.length-1;t>=0;t--){const i=e[t],s=Ch5Spinner.primaryCssClass+"--active";i.classList.contains(s)&&i.classList.remove(s)}}catch(t){console.error(e.ERROR.structure)}}},Ch5SpinnerMutationObserver=class e{static _observer={};constructor(t){e._observer.constructor!==MutationObserver&&(e._observer=new MutationObserver(this.mutationsCallback)),this.registerElement(t)}registerElement(t){e._observer.observe(t,{childList:!0,subtree:!0,attributes:!0})}mutationsCallback(e){}},Ch5MouseVelocity=class e{start={x:0,y:0,time:new Date};end={x:0,y:0,time:new Date};step;constructor(e){this.step=e}static calculateVelocity(e,t,i,s){return Math.abs(e-t)/s/i}get x1(){return this.start.x}get y1(){return this.start.y}get x2(){return this.end.x}get y2(){return this.end.y}get timeStart(){return this.start.time.getTime()}get timeEnd(){return this.end.time.getTime()}get timeDiff(){return this.timeEnd-this.timeStart}getYSteps(){return Math.floor(e.calculateVelocity(this.y1,this.y2,this.step,this.timeDiff))}},Ch5SpinnerScroll=class{element={};mouseDown=!1;initialMousePos=0;currentYOffset=0;direction="";dragTimeout=0;readyToFocus=!0;_currentElement=0;_mouseDownListener={};_mouseUpListener={};_mouseMoveListener={};_touchstartListener={};_toucheendUpListener={};_touchmoveListener={};_mouseLeaveListener={};_touchendLeaveListener={};mouseVelocity={};_runTimeout=0;constructor(e){this.element=e,this.attachEventListeners();const t=this.element.selectedValue;this.selectTheItem(t)}destruct(){this.detachEventListeners()}set currentElement(e){this._currentElement=e}get currentElement(){const e=this.element.templateHelper.childrenObject;return this._currentElement<=0&&!this.element.endless?0:null!==e&&!this.element.endless&&this._currentElement>=e.length-1?e.length-1:null!==e&&this.element.endless&&e.length<this._currentElement?this._currentElement%e.length:this._currentElement}getCleanCurrentElement(){try{const e=this.element.templateHelper.childrenObject;return null!==e&&this.currentElement>=0&&this.currentElement<=e.length-1?parseFloat(e[this.currentElement].getAttribute("data-initial-index")+""):0}catch(e){return console.log(e),0}}getCleanCurrentElementIndex(){return this.getCleanCurrentElement()}selectTheItem(e){if(!1===isNaN(e)){const t=this.element.getItemHeightValue(),i=this.element.getHighlightOffsetValue();this.direction="",this.currentElement=e,this.currentYOffset=i-this.getCleanCurrentElementIndex()*t,this.moveTheList()}}attachEventListeners(){try{this.element.templateHelper instanceof Ch5SpinnerTemplate&&this.element.templateHelper.wrapperElement instanceof HTMLElement&&(this._mouseDownListener=this._onMouseDown.bind(this),this._mouseUpListener=this._onMouseUp.bind(this),this._mouseMoveListener=this._onMouseMove.bind(this),this._touchstartListener=this._onMouseDown.bind(this),this._toucheendUpListener=this._onMouseUp.bind(this),this._touchmoveListener=this._onMouseMove.bind(this),this._mouseLeaveListener=this._onMouseLeave.bind(this),this._touchendLeaveListener=this._onMouseLeave.bind(this),this.element.templateHelper.wrapperElement.addEventListener("mousedown",this._mouseDownListener,{passive:!0}),this.element.addEventListener("mouseup",this._mouseUpListener),this.element.addEventListener("mousemove",this._mouseMoveListener),this.element.templateHelper.wrapperElement.addEventListener("touchstart",this._touchstartListener,{passive:!0}),this.element.addEventListener("touchend",this._toucheendUpListener),this.element.addEventListener("touchmove",this._touchmoveListener,{passive:!0}),this.element.addEventListener("mouseleave",this._mouseLeaveListener),this.element.addEventListener("touchend",this._touchendLeaveListener))}catch(e){console.log("Adding listeners have problems",e)}}detachEventListeners(){try{this.element.templateHelper instanceof Ch5SpinnerTemplate&&this.element.templateHelper.wrapperElement instanceof HTMLElement&&(this.element.templateHelper.wrapperElement.removeEventListener("mousedown",this._mouseDownListener),this.element.removeEventListener("mouseup",this._mouseUpListener),this.element.removeEventListener("mousemove",this._mouseMoveListener),this.element.templateHelper.wrapperElement.removeEventListener("touchstart",this._touchstartListener),this.element.removeEventListener("touchend",this._toucheendUpListener),this.element.removeEventListener("touchmove",this._touchmoveListener),this.element.removeEventListener("mouseleave",this._mouseLeaveListener),this.element.removeEventListener("touchend",this._touchendLeaveListener))}catch(e){console.log("Removing listeners have problems",e)}}moveTheList(e=1){0===e&&(e=1),"up"===this.direction?(this.currentYOffset+=this.element.getItemHeightValue()*e,this.currentElement--,this.currentElement-=e-1):"down"===this.direction&&(this.currentYOffset-=this.element.getItemHeightValue()*e,this.currentElement++,this.currentElement+=e-1);const t=this.currentYOffset+this.element.getItemHeightMeasurementUnit();this.element.templateHelper.scrollableArea instanceof HTMLElement&&(this.element.templateHelper.scrollableArea.style.transition="all .1s ease",this.element.templateHelper.scrollableArea.style.transform="translate3d(0,"+t+",0)"),this.toggleActiveItem()}detectDirection(e){return this.initialMousePos<e?this.direction="up":this.direction="down",this.direction}_onMouseDown(e){e.stopPropagation(),this.initialMousePos=this.getMousePosition(e).y;const t=this.element.visibleItemScroll,i=this.element.size;this.mouseVelocity.constructor!==Ch5MouseVelocity&&(this.mouseVelocity=new Ch5MouseVelocity(t/i)),this.mouseVelocity.start={x:this.getMousePosition(e).y,y:this.getMousePosition(e).y,time:new Date},!0===this.readyToFocus&&(this.element.eventsHelper.dispatchFocus(),this.readyToFocus=!1),this.dragTimeout=window.setTimeout(()=>{this.mouseDown=!0,this.handleCursor("drag"),this.element.templateHelper.toggleOverlay(!0)},50)}sendEventOnOverflow(){const e=this.element.sendEventOnOverflow;if(""!==e&&null!=e){const t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&(t.publish(!0),t.publish(!1))}}sendEventOnUnderflow(){const e=this.element.sendEventOnUnderflow;if(""!==e&&null!=e){const t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&(t.publish(!0),t.publish(!1))}}_onMouseUp(e){this.mouseDown=!1,this.handleCursor(),this.element.templateHelper.toggleOverlay(!1),window.clearTimeout(this.dragTimeout),this.element.dirtyTimeHandler(),this.mouseVelocity.end={x:e.pageX,y:e.pageY,time:new Date},this.element.eventsHelper.dispatchBlur(),this.readyToFocus=!0,this.getCleanCurrentElementIndex()!==this.element.cleanItem&&(!1===this.element.dirtyFlag&&(this.element.eventsHelper.dispatchDirty(this.getCleanCurrentElement()+""),this.element.dirtyFlag=!0),this.element.eventsHelper.dispatchChange(this.getCleanCurrentElement()+"")),"direct"===this.element.feedbackMode&&(this.element.cleanItem=this.element.selectedValueIndex)}_onMouseMove(e){const t=this.getMousePosition(e).y;let i=0,s=0,n=this.element;for(;n&&!isNaN(n.offsetLeft)&&!isNaN(n.offsetTop);)i+=n.offsetLeft-n.scrollLeft+n.clientLeft,s+=n.offsetTop-n.scrollTop+n.clientTop,n=n.offsetParent;let r=null,a=null;const l=i,o=i+this.element.clientWidth,h=s,c=s+this.element.clientHeight;if("touchmove"===e.type){const t=e.touches[0]||e.changedTouches[0];r=t.clientX,a=t.clientY}else r=e.clientX,a=e.clientY;if(r<l||r>o||a<h||a>c)!0===this.mouseDown&&"touchmove"===e.type&&(this.mouseDown=!1,this.moveTheList(),this.element.eventsHelper.dispatchTouchEnd());else if(!0===this.mouseDown&&Math.abs(this.initialMousePos-t)>=.3*this.element.selectedItem.getBoundingClientRect().height){this.detectDirection(t);const i=this.element.size,s=this.element.getHighlightOffsetValue(),n=this.element.getItemHeightValue(),r=this.element.templateHelper.childrenObject,a=this.element.endless;let l=1,o=Number(this.element.visibleItemScroll)<=Number(i)?this.element.visibleItemScroll:i;o<Number(this.element.visibleItemScroll)&&this.element.endless&&(o=this.element.visibleItemScroll);const h=(Math.ceil(o/2)-1)*n,c=-(r.length*n-(h+n));this.mouseVelocity.end={x:this.getMousePosition(e).x,y:this.getMousePosition(e).y,time:new Date},!0===a&&this._isBoundary(this.currentYOffset,h,c)&&null!==r&&("down"===this.direction?(this.currentElement=-1,this._forceMovingTheSpinner(s+n),window.clearTimeout(this._runTimeout),this._runTimeout=0,this.sendEventOnOverflow()):"up"===this.direction&&(this.currentElement=r.length,this._forceMovingTheSpinner(c-n),this.sendEventOnUnderflow())),0===this._runTimeout&&(this._runTimeout=window.setTimeout(()=>{this.mouseVelocity.getYSteps()>1&&(l=this._handleVelocity(this.mouseVelocity.getYSteps(),h,c)),this._isBoundary(this.currentYOffset,h,c)&&!a||this.moveTheList(l),window.clearTimeout(this._runTimeout),this._runTimeout=0},50)),this.initialMousePos=t}}_handleVelocity(e,t,i){let s;return s="up"===this.direction?this.currentYOffset+this.element.getItemHeightValue()*e:this.currentYOffset-this.element.getItemHeightValue()*e,this._isBoundary(s,t,i)&&e>0?this._handleVelocity(--e,t,i):e}_forceMovingTheSpinner(e){this.currentYOffset=e,this.element.templateHelper.scrollableArea.setAttribute("style","transition: all 0s ease; transform: translate3d(0px,"+this.currentYOffset+this.element.getItemHeightMeasurementUnit()+",0px)")}_isBoundary(e,t,i){return!("up"===this.direction&&e<t||"down"===this.direction&&e>i)}_onMouseLeave(e){!0===this.mouseDown&&(this.mouseDown=!1,this.moveTheList(),this.element.eventsHelper.dispatchMouseUp())}getMousePosition(e){const t={x:0,y:0};if("undefined"!=typeof TouchEvent&&null!==TouchEvent&&e.constructor===TouchEvent){const i=e.touches[0];t.x=i.clientX,t.y=i.clientY}else t.x=e.clientX,t.y=e.clientY;return t}handleCursor(e="click"){"click"===e?this.element.templateHelper.wrapperElement.style.cursor="pointer":"drag"===e&&(this.element.templateHelper.wrapperElement.style.cursor="grabbing")}toggleActiveItem(){this.element.templateHelper.setActiveItem(this.currentElement)}};import isNull2 from"lodash/isNull";var Ch5SpinnerEvents=class{_element={};constructor(e){this.element=e}set element(e){null!=e&&(this._element=e)}get element(){return this._element}dispatchFocus(){const e=this.element.sendEventOnFocus;if(Ch5Common.isNotNil(e)){const e=Ch5SignalFactory.getInstance().getBooleanSignal(this.element.sendEventOnFocus);null!==e&&e.publish(!0)}this.dispatch("focus")}dispatchBlur(){const e=this.element.sendEventOnFocus;if(Ch5Common.isNotNil(e)){const t=Ch5SignalFactory.getInstance().getBooleanSignal(e);isNull2(t)||t.publish(!1)}this.dispatch("blur")}dispatchChange(e){const t=this.element.sendEventOnChange;if("direct"===this.element.feedbackMode&&""!==t&&null!=t){const t=Ch5SignalFactory.getInstance().getNumberSignal(this.element.sendEventOnChange);null!==t&&t.publish(parseFloat(e))}this.dispatch("change",e)}dispatchDirty(e){const t=this.dispatch("dirty",e,!1);this.element.ondirty instanceof HtmlCallback?this.element.ondirty.run(t):this.element.ondirty instanceof Function&&this.element.ondirty.call(this.element,t)}dispatchClean(){const e=this.dispatch("clean");this.element.onclean instanceof HtmlCallback?this.element.onclean.run(e):this.element.onclean instanceof Function&&this.element.onclean.call(this.element,e)}dispatch(e,t="",i=!0){const s=this.createEvent(e,t,i);return this.element.dispatchEvent(s),s}createEvent(e,t,i=!0){return new CustomEvent(e,{detail:{data:t},bubbles:!0,cancelable:i})}dispatchMouseUp(){this.dispatch("mouseup")}dispatchTouchEnd(){this.dispatch("touchend")}},Ch5Spinner=class e extends Ch5Common{static ELEMENT_NAME="ch5-spinner";static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatevalue:{direction:"state",stringJoin:1,contractName:!0},receivestatesize:{direction:"state",numericJoin:1,contractName:!0},receivestatelabel:{direction:"state",stringJoin:1,contractName:!0},receivestateurl:{direction:"state",stringJoin:1,contractName:!0},sendeventonchange:{direction:"event",booleanJoin:1,contractName:!0},sendeventonfocus:{direction:"event",booleanJoin:1,contractName:!0},sendeventonoverflow:{direction:"event",booleanJoin:1,contractName:!0},sendEventonunderflow:{direction:"event",booleanJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return["size","iconposition","selectedvalue","itemheight","visibleitemscroll","resize","endless","indexid","label","feedbackmode","signalvaluesynctimeout","sendeventonchange","sendeventonfocus","sendeventonoverflow","sendEventOnUnderflow","receivestatevalue","receivestatesize","receivestatelabel","receivestateurl","show"].concat(t.concat(i))}constructor(){super(),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this._mutationObserver=new Ch5SpinnerMutationObserver(this)}set ondirty(e){isNil17(e)&&(e={}),e instanceof HtmlCallback&&this.ondirty instanceof Function||(this._ondirty=e)}get ondirty(){return this._ondirty}set onclean(e){isNil17(e)&&(e={}),e instanceof HtmlCallback&&this.onclean instanceof Function||(this._onclean=e)}get onclean(){return this._onclean}set templateHelper(e){this.info("<ch5-spinner />.set templateHelper"),this._templateHelper=e}get templateHelper(){return this.info("<ch5-spinner />.get templateHelper"),this._templateHelper}get scrollHelper(){return this._scrollHelper}set scrollHelper(e){this._scrollHelper=e}get eventsHelper(){return this._eventsHelper}set eventsHelper(e){this._eventsHelper=e}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e}get cleanItem(){return this._cleanItem}set cleanItem(e){this._cleanItem=e}get receiveStateValueSub(){return this._receiveStateValueSub}set receiveStateValueSub(e){this._receiveStateValueSub=e}get receiveStateSizeSub(){return this._receiveStateSizeSub}set receiveStateSizeSub(e){this._receiveStateSizeSub=e}get wasInstantiated(){return this._wasInstantiated}set wasInstantiated(e){this._wasInstantiated=e}set size(e){const t=this.size!==e&&isNil17(e)?1:this.adjustMaxSizeValue(e);this.size!==t&&this.setAttribute("size",t+""),this._size=t}get size(){return this._size}set iconPosition(t){this.iconPosition!==t&&isNil17(t)&&(t="first");const i=e.ICONPOSITIONS.filter(e=>t.trim()===e);t=i.length>0?i[0]:e.ICONPOSITIONS[0],"rtl"===document.dir&&(t=t===e.ICONPOSITIONS[0]?e.ICONPOSITIONS[1]:e.ICONPOSITIONS[0]),t!==this._iconPosition&&(this.setAttribute("iconposition",t),this.repaint()),this._iconPosition=t}get iconPosition(){return this._iconPosition}set selectedValue(e){this.selectedValue!==e&&isNil17(e)&&(e=0),this.size<e?e=this.size-1:e<0&&(e=0),e!==this.selectedValue&&(this.setAttribute("selectedValue",e+""),this.scrollHelper instanceof Ch5SpinnerScroll&&this._scrollHelper.selectTheItem(e)),this._selectedValue=e}get selectedValue(){return this._selectedValue}get selectedValueIndex(){return this.selectedValue}set itemHeight(e){this.itemHeight!==e&&isNil17(e)&&(e=""),-1===e.indexOf("px")&&-1===e.indexOf("vh")&&(e+="px"),""!==e&&this.itemHeight!==e&&this.setAttribute("itemheight",e),this._itemHeight=e}get itemHeight(){return this._itemHeight}set visibleItemScroll(t){this.visibleItemScroll!==t&&isNil17(t)&&(t=e.VISIBLEITEMSCROLL),t>this.size&&(t=this.size),(isNaN(t)||t<=0)&&(t=3),t!==this.visibleItemScroll&&this.setAttribute("visibleItemScroll",t.toString()+""),this._visibleItemScroll=t}get visibleItemScroll(){return this._visibleItemScroll}set resize(e){this.resize!==e&&isNil17(e)&&(e=!1),e!==this.resize&&this.setAttribute("resize",e+""),this._resize=e}get resize(){return this._resize}set endless(e){this.endless!==e&&isNil17(e)&&(e=!1),e!==this._endless&&(this.setAttribute("endless",e+""),this.repaint()),this._endless=e}get endless(){return this._endless}set indexId(e){this.indexId!==e&&isNil17(e)&&(e=""),e!==this.indexId&&(this.setAttribute("indexId",e),this.repaint()),this._indexId=e}get indexId(){return this._indexId}set receiveStateValue(e){this.receiveStateValue!==e&&isNil17(e)&&(e=""),e!==this.receiveStateValue&&(this.setAttribute("receiveStateValue",e),this.registerReceiveSignalValue()),this._receiveStateValue=e}get receiveStateValue(){return this._attributeValueAsString("receivestatevalue")}set receiveStateSize(e){this.receiveStateSize!==e&&isNil17(e)&&(e=""),e!==this.receiveStateSize&&(this.setAttribute("receiveStateSize",e),this.repaint()),this._receiveStateSize=e}get receiveStateSize(){return this._attributeValueAsString("receivestatesize")}set receiveStateLabel(e){this.receiveStateLabel!==e&&isNil17(e)&&(e=""),e!==this.receiveStateLabel&&(this.setAttribute("receiveStateLabel",e),this.repaint()),this._receiveStateLabel=e}get receiveStateLabel(){return this._attributeValueAsString("receivestatelabel")}set receiveStateUrl(e){this.receiveStateValue!==e&&isNil17(e)&&(e=""),e!==this.receiveStateUrl&&(this.setAttribute("receiveStateUrl",e),this.repaint()),this._receiveStateUrl=e}get receiveStateUrl(){return this._attributeValueAsString("receivestateurl")}set sendEventOnFocus(e){this.sendEventOnFocus!==e&&isNil17(e)&&(e=""),e!==this.sendEventOnFocus&&this.setAttribute("sendEventOnFocus",e),this._sendEventOnFocus=e}get sendEventOnFocus(){return this._sendEventOnFocus}set sendEventOnChange(e){this.sendEventOnChange!==e&&isNil17(e)&&(e=""),e!==this.sendEventOnChange&&this.setAttribute("sendEventOnChange",e),this._sendEventOnChange=e}get sendEventOnChange(){return this._sendEventOnChange}set sendEventOnOverflow(e){this.sendEventOnOverflow!==e&&isNil17(e)&&(e=""),e!==this.sendEventOnOverflow&&this.setAttribute("sendEventOnOverflow",e),this._sendEventOnOverflow=e}get sendEventOnOverflow(){return this._sendEventOnOverflow}set sendEventOnUnderflow(e){this.sendEventOnUnderflow!==e&&isNil17(e)&&(e=""),e!==this.sendEventOnUnderflow&&this.setAttribute("sendEventOnUnderflow",e),this._sendEventOnUnderflow=e}get sendEventOnUnderflow(){return this._sendEventOnUnderflow}set feedbackMode(t){this.feedbackMode!==t&&isNil17(t)&&(t="direct"),e.FEEDBACKMODES.indexOf(t)<0&&(t=e.FEEDBACKMODES[0]),t!==this._feedbackMode&&this.setAttribute("feedbackMode",t),this._feedbackMode=t}get feedbackMode(){return this._feedbackMode}set signalValueSyncTimeout(e){this.signalValueSyncTimeout!==e&&isNil17(e)&&(e=1500),e!==this.signalValueSyncTimeout&&this.setAttribute("signalValueSyncTimeout",e+""),this._signalValueSyncTimeout=e}get signalValueSyncTimeout(){return this._signalValueSyncTimeout}set label(e){const t=e;""!==(e=this.label!==e&&isNil17(e)?"":this._getTranslatedValue("label",e))&&this.label!==e&&t!==e&&this.setAttribute("label",e),this._label=e}get label(){return this._label}set autoSetItemHeight(e){this._ch5Properties.set("autoSetItemHeight",e,()=>{})}get autoSetItemHeight(){return this._ch5Properties.get("autoSetItemHeight")}static primaryCssClass="ch5-spinner";static VISIBLEITEMSCROLL=3;static SYNCTIMEOUT=1500;static ITEM_HEIGHT_WHEN_EMPTY="33";static ICONPOSITIONS=["first","last"];static FEEDBACKMODES=["direct","submit"];static COMPONENT_DATA={ICON_POSITIONS:{default:e.ICONPOSITIONS[0],values:e.ICONPOSITIONS,key:"icon_position",classListPrefix:"--"},FEEDBACK_MODES:{default:e.FEEDBACKMODES[0],values:e.FEEDBACKMODES,key:"feedback_modes",classListPrefix:"--"}};static COMPONENT_PROPERTIES=[{default:!1,name:"autoSetItemHeight",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];static MAX_SIZE=30;_ch5Properties;_size=1;_iconPosition="";_selectedValue=0;_itemHeight="";_visibleItemScroll=0;_resize=!1;_endless=!1;_feedbackMode="";_signalValueSyncTimeout=0;_indexId="";_label="";_receiveStateValue="";_receiveStateSize="";_receiveStateUrl="";_sendEventOnFocus="";_sendEventOnChange="";_sendEventOnOverflow="";_sendEventOnUnderflow="";_templateHelper={};_scrollHelper={};_eventsHelper={};_selectedItem={};_cleanItem=0;_receiveStateValueSub="";_receiveStateLabelSub="";_receiveStateSizeSub="";_receiveStateLabel="";_onclean={};_ondirty={};_wasInstantiated=!1;dirtyFlag=!1;_mutationObserver={};static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}connectedCallback(){this.info("<ch5-spinner />.connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Spinner),this.contentCleanUp(),Promise.all([customElements.whenDefined("ch5-spinner")]).then(()=>{this._wasInstantiated||(this.cacheComponentChildrens(),this._wasInstantiated=!0,this.initUtilities(),this.initCommonMutationObserver(this))})}initSignals(){this.info("<ch5-spinner />.initSignals()"),this.hasAttribute("receiveStateValue")&&this.registerReceiveSignalValue(),this.hasAttribute("receiveStateSize")&&this.registerReceiveSignalSize(),this.hasAttribute("receiveStateLabel")&&this.registerReceiveSignalLabel()}dirtyTimeHandler(){this.info("<ch5-spinner />.dirtyTimeHandler()"),window.setTimeout(this.dirtyHandler.bind(this),this.signalValueSyncTimeout)}disconnectedCallback(){this.info("<ch5-spinner />.disconnectedCallback()"),this._wasInstantiated=!1,void 0!==this._scrollHelper.destruct&&this._scrollHelper.destruct(),void 0!==this.templateHelper.destruct&&this.templateHelper.destruct(),this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver()}unsubscribeFromSignals(){this.info("<ch5-spinner />.unsubscribeFromSignals()"),super.unsubscribeFromSignals(),!1===this._keepListeningOnSignalsAfterRemoval&&(this.clearNumberSignalSubscription(this._receiveStateSize,this._receiveStateSizeSub),this._receiveStateUrl="",this.clearNumberSignalSubscription(this._receiveStateValue,this._receiveStateValueSub),this._receiveStateValue="",this.clearStringSignalSubscription(this._receiveStateLabel,this._receiveStateLabelSub),this._receiveStateLabel="")}attributeChangedCallback(t,i,s){if(i===s)return;this.info('<ch5-spinner />.attributeChangedCallback("'+t+'","'+i+'","'+s+'")'),super.attributeChangedCallback(t,i,s);const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else if(this._wasInstantiated&&i!==s){switch(t){case"size":!1===this.hasAttribute("receiveStateSize")&&(this.size=parseFloat(s),this.repaint());break;case"iconposition":this.iconPosition=s;break;case"selectedvalue":this.selectedValue=parseFloat(s),this._cleanItem=parseFloat(s),this._scrollHelper.constructor===Ch5SpinnerScroll&&this._scrollHelper.selectTheItem(parseFloat(s));break;case"itemheight":this.itemHeight=s,this.repaint();break;case"visibleitemscroll":this.visibleItemScroll=parseFloat(s),this.repaint();break;case"indexid":this.indexId=s;break;case"feedbackmode":this.feedbackMode=s;break;case"signalvaluesynctimeout":this.signalValueSyncTimeout=parseFloat(s);break;case"sendeventonchange":this.sendEventOnChange=s;break;case"sendeventonfocus":this.sendEventOnFocus=s;break;case"sendeventonoverflow":this.sendEventOnOverflow=s;break;case"sendEventOnUnderflow":this.sendEventOnUnderflow=s;break;case"receivestatevalue":this.receiveStateValue=s;break;case"receivestatesize":this.receiveStateSize=s;break;case"receivestatelabel":this.receiveStateLabel=s;break;case"receivestateurl":this.receiveStateUrl=s;break;case"show":!this.itemHeight&&s&&this.templateHelper.handleDefaultItemHeight(this.templateHelper.childrenObject[0])}this.addAriaAttributes()}}addAriaAttributes(){this.templateHelper.constructor===Ch5SpinnerTemplate&&this.templateHelper.wrapperElement.constructor===HTMLDivElement&&this.templateHelper.wrapperElement.setAttribute("role","listbox")}registerReceiveSignalValue(){this.info("<ch5-spinner />.registerReceiveSignalValue()"),this.clearStringSignalSubscription(this.receiveStateValue,this._receiveStateValueSub);const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateValue),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&(this._receiveStateValueSub=t.subscribe(e=>{(null!==e||void 0!==e)&&e>=0&&(this.selectedValue=e,this._cleanItem=e,this._scrollHelper.selectTheItem(e))}))}registerReceiveSignalLabel(){this.info("<ch5-spinner />.registerReceiveSignalLabel()"),this.clearStringSignalSubscription(this.receiveStateLabel,this._receiveStateLabelSub);const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateLabel),t=Ch5SignalFactory.getInstance().getStringSignal(e);null!==t&&(this._receiveStateLabelSub=t.subscribe(e=>{null===e&&void 0===e||this.setAttribute("label",e)}))}registerReceiveSignalSize(){this.info("<ch5-spinner />.registerReceiveSignalSize()"),this.clearStringSignalSubscription(this.receiveStateSize,this._receiveStateSizeSub);const e=Ch5Signal.getSubscriptionSignalName(this.receiveStateSize),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&(this._receiveStateSizeSub=t.subscribe(e=>{e=this.adjustMaxSizeValue(e),isNil17(e)||0===e||this.size===e||(this.size=e,this.repaint())}))}repaint(){this.info("<ch5-spinner />.repaint()");try{if(this.templateHelper.constructor===Ch5SpinnerTemplate&&null!==this.parentNode&&this.hasChildNodes()){for(let e=this.childNodes.length-1;e>=0;e--)"TEMPLATE"!==this.childNodes[e].tagName&&this.removeChild(this.childNodes[e]);if(!this.hasChildNodes()||null!==this.childNodes[0]&&"TEMPLATE"===this.childNodes[0].tagName){const e=document.createElement("div");this.parentNode.insertBefore(e,this.nextSibling),this.remove(),e.parentNode.insertBefore(this,e.nextSibling),e.remove()}}}catch(e){console.error("Something wrong with component regeneration",e)}}submit(){if(this.info("<ch5-spinner />.submit()"),"submit"===this.feedbackMode&&(this.dirtyTimeHandler(),this._scrollHelper.getCleanCurrentElementIndex()!==this._cleanItem)){const e=this.sendEventOnChange;if(""!==e&&null!=e){const e=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventOnChange);null!==e&&e.publish(this._scrollHelper.getCleanCurrentElement())}}}reset(){this.info("<ch5-spinner />.reset()"),this._scrollHelper.selectTheItem(this.selectedValue),this._cleanItem=this._scrollHelper.getCleanCurrentElementIndex(),this.dirtyFlag=!1,this._eventsHelper.dispatchClean()}getValue(){return this.info("<ch5-spinner />.getValue()"),this._scrollHelper.getCleanCurrentElement()}setValue(e){this.info("<ch5-spinner />.setValue()"),this._scrollHelper.selectTheItem(e)}getDirty(){return this.info("<ch5-spinner />.getDirty()"),this._cleanItem!==this._scrollHelper.getCleanCurrentElementIndex()}adjustMaxSizeValue(t){return t>e.MAX_SIZE?e.MAX_SIZE:t}getItemHeightValue(){const e=parseFloat(this.itemHeight);return!0!==isNaN(e)?e:0}getItemHeightMeasurementUnit(){return this.itemHeight.indexOf("px")>-1?"px":this.itemHeight.indexOf("vh")>-1?"vh":"px"}getHighlightOffsetValue(){const e=this.visibleItemScroll,t=this.getItemHeightValue();return(Math.ceil(e/2)-1)*t}getHighlightOffset(){return this.getHighlightOffsetValue()+this.getItemHeightMeasurementUnit()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}if(this.hasAttribute("itemHeight")&&(this.itemHeight=null!==this.getAttribute("itemHeight")?this.getAttribute("itemHeight"):""),!1!==this.hasAttribute("itemHeight")&&null!==this.itemHeight||(this.autoSetItemHeight=!0,isNil17(this.templateHelper.element)&&(this.itemHeight=e.ITEM_HEIGHT_WHEN_EMPTY),this.setAttribute("autosetitemheight","")),this.hasAttribute("size")&&(this.size=null!==this.getAttribute("size")?parseFloat(this.getAttribute("size")):this.size),this.hasAttribute("iconPosition")?this.iconPosition=null!==this.getAttribute("iconPosition")?this.getAttribute("iconPosition"):e.ICONPOSITIONS[0]:this.iconPosition=e.ICONPOSITIONS[0],this.hasAttribute("selectedValue")&&(this.selectedValue=null!==this.getAttribute("selectedvalue")?parseFloat(this.getAttribute("selectedvalue")):this.selectedValue),this.hasAttribute("visibleItemScroll")?this.visibleItemScroll=null!==this.getAttribute("visibleItemScroll")?parseFloat(this.getAttribute("visibleItemScroll")):this.visibleItemScroll:this.visibleItemScroll=e.VISIBLEITEMSCROLL,this.hasAttribute("resize")&&(this.resize=!!this.hasAttribute("resize")),this.hasAttribute("endless")){const e="false"!==this.getAttribute("endless");this.endless=e}this.hasAttribute("indexId")&&(this.indexId=null!==this.getAttribute("indexId")?this.getAttribute("indexId"):""),this.hasAttribute("label")&&(this.label=null!==this.getAttribute("label")?this.getAttribute("label"):""),this.hasAttribute("feedbackMode")?this.feedbackMode=null!==this.getAttribute("feedbackMode")?this.getAttribute("feedbackMode"):"direct":this.feedbackMode=e.FEEDBACKMODES[0],this.hasAttribute("signalValueSyncTimeout")?this.signalValueSyncTimeout=null!==this.getAttribute("signalValueSyncTimeout")?parseFloat(this.getAttribute("signalValueSyncTimeout")+""):1500:this.signalValueSyncTimeout=e.SYNCTIMEOUT,this.hasAttribute("sendEventOnChange")&&(this.sendEventOnChange=null!==this.getAttribute("sendEventOnChange")?this.getAttribute("sendEventOnChange"):""),this.hasAttribute("sendEventOnFocus")&&(this.sendEventOnFocus=null!==this.getAttribute("sendEventOnFocus")?this.getAttribute("sendEventOnFocus"):""),this.hasAttribute("sendEventOnOverflow")&&(this.sendEventOnOverflow=null!==this.getAttribute("sendEventOnOverflow")?this.getAttribute("sendEventOnOverflow"):""),this.hasAttribute("sendEventOnUnderflow")&&(this.sendEventOnUnderflow=null!==this.getAttribute("sendEventOnUnderflow")?this.getAttribute("sendEventOnUnderflow"):""),this.hasAttribute("receiveStateValue")&&(this.receiveStateValue=null!==this.getAttribute("receiveStateValue")?this.getAttribute("receiveStateValue"):""),this.hasAttribute("receiveStateSize")&&(this.receiveStateSize=null!==this.getAttribute("receiveStateSize")?this.getAttribute("receiveStateSize"):""),this.hasAttribute("receiveStateLabel")&&(this.receiveStateLabel=null!==this.getAttribute("receiveStateLabel")?this.getAttribute("receiveStateLabel"):""),this.hasAttribute("receiveStateUrl")&&(this.receiveStateUrl=null!==this.getAttribute("receiveStateUrl")?this.getAttribute("receiveStateUrl"):""),this.hasAttribute("onclean")&&(this.onclean=new HtmlCallback(this,this.getAttribute("onclean"))),this.hasAttribute("ondirty")&&(this.ondirty=new HtmlCallback(this,this.getAttribute("ondirty")))}initUtilities(){this.info("<ch5-spinner />.initUtilities()"),this.classList.add(e.primaryCssClass),this.initAttributes(),this._eventsHelper=new Ch5SpinnerEvents(this),this._templateHelper=new Ch5SpinnerTemplate(this),this.resolveTemplateChildren(this._templateHelper.templateElement),this._templateHelper.generateTemplate(this.size),this._scrollHelper=new Ch5SpinnerScroll(this),this.addAriaAttributes(),this.initSignals()}dirtyHandler(){this.info("<ch5-spinner />.dirtyHandler()"),this.dirtyFlag&&(this._scrollHelper.selectTheItem(this._cleanItem),this._eventsHelper.dispatchClean(),this.dirtyFlag=!1)}translateCallback(e){this.info("<ch5-spinner />.translateCallback()"),"label"===e&&null!==this.templateHelper.childrenObject&&this.templateHelper.childrenObject.length>0&&this.templateHelper.childrenObject.forEach((e,t)=>{const i=e.cloneNode(!0);i.innerHTML=this._getTranslatedValue("label",e.innerHTML);const s=this.templateHelper.resolveId(t,[i]);e.innerHTML=void 0!==s?s.children[0].innerHTML:i.innerHTML})}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5Spinner.ELEMENT_NAME,Ch5Spinner),Ch5Spinner.registerSignalAttributeTypes(),Ch5Spinner.registerSignalAttributeDefaults(Ch5Spinner.ELEMENT_NAME);import{isEmpty as isEmpty6,isNil as isNil18}from"lodash";import{Subject as Subject5}from"rxjs";var ch5subpageReferenceListSubject=new Subject5,refreshCh5subpageReferenceList=e=>{ch5subpageReferenceListSubject.next(e)};import _35 from"lodash";var Ch5SubpageReferenceList=class e extends Ch5Common{static SCROLLBAR_CLASSLIST_PREFIX="--scrollbar-";static CENTER_ITEMS_CLASSLIST_PREFIX="--center-items-";static SUBPAGE_CONTAINER_BUFFER=4;static STRETCH=["both"];static ORIENTATION=["horizontal","vertical"];static LOAD_ITEMS=["visible-only","load-new","all"];static COMPONENT_DATA={ORIENTATION:{default:e.ORIENTATION[0],values:e.ORIENTATION,key:"orientation",attribute:"orientation",classListPrefix:"--orientation-"},LOAD_ITEMS:{default:e.LOAD_ITEMS[0],values:e.LOAD_ITEMS,key:"loadItems",attribute:"loadItems",classListPrefix:"--load-items-"},STRETCH:{default:e.STRETCH[0],values:e.STRETCH,key:"stretch",attribute:"stretch",classListPrefix:"--stretch-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,booleanjoinincrement:{direction:"state",booleanJoin:1,contractName:!0},numericjoinincrement:{direction:"state",numericJoin:1,contractName:!0},stringjoinincrement:{direction:"state",stringJoin:1,contractName:!0},subpagereceivestatescrollto:{direction:"state",numericJoin:1,contractName:!0},receivestatenumberofitems:{direction:"state",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:e.ORIENTATION[0],enumeratedValues:e.ORIENTATION,name:"orientation",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ORIENTATION[0],isObservableProperty:!0},{default:"",name:"contractName",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"useContractForEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForItemEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForItemShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomStyle",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomClass",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForNumItems",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"endless",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"centerItems",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:1,name:"rows",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:1,numberProperties:{min:1,max:600,conditionalMin:1,conditionalMax:600,conditionalMinValue:1,conditionalMaxValue:600},isObservableProperty:!0},{default:1,name:"columns",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:1,numberProperties:{min:1,max:600,conditionalMin:1,conditionalMax:600,conditionalMinValue:1,conditionalMaxValue:600},isObservableProperty:!0},{default:0,name:"scrollToPosition",removeAttributeOnNull:!0,nameForSignal:"subpageReceiveStateScrollTo",type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:599,conditionalMin:0,conditionalMax:599,conditionalMinValue:0,conditionalMaxValue:599},isObservableProperty:!0},{default:!1,name:"scrollbar",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"0",isSignal:!0,name:"booleanJoinIncrement",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"0",isSignal:!0,name:"numericJoinIncrement",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"0",isSignal:!0,name:"stringJoinIncrement",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"subpageReceiveStateEnable",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"subpageReceiveStateShow",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"widgetId",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"subpageReceiveStateScrollTo",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:null,enumeratedValues:e.STRETCH,name:"stretch",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:10,name:"numberOfItems",removeAttributeOnNull:!0,nameForSignal:"receiveStateNumberOfItems",type:"number",valueOnAttributeEmpty:10,numberProperties:{min:1,max:600,conditionalMin:1,conditionalMax:600,conditionalMinValue:1,conditionalMaxValue:600},isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateNumberOfItems",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"indexId",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.LOAD_ITEMS[0],enumeratedValues:e.LOAD_ITEMS,name:"loadItems",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.LOAD_ITEMS[0],isObservableProperty:!0}];static ELEMENT_NAME="ch5-subpage-reference-list";primaryCssClass="ch5-subpage-reference-list";_ch5Properties;_elContainer={};_scrollbarContainer={};_scrollbar={};_templateElement={};isDown=!1;startX=0;startY=0;scrollListLeft=0;scrollListTop=0;scrollbarDimension=0;subpageWidth=0;subpageHeight=0;containerHeight=0;containerWidth=0;reInit=!0;_refreshSubId=null;previousSignalValues={contractName:"",receiveStateCustomClass:"",receiveStateCustomStyle:"",receiveStateEnable:"",receiveStateShow:"",subpageReceiveStateScrollTo:"",receiveStateNumberOfItems:""};rowClassValue=1;columnClassValue=1;showSignalHolder=[];loadSubpageForShow=!1;allSubpageVisible=!1;debounceSubpageShow=this.debounce(()=>{this.subpageShow()},150);debounceSubpageDisplay=this.debounce((e=!1)=>{"visible-only"===this.loadItems?this.subpageDisplay(e):"load-new"===this.loadItems?this.subpageDisplayForLoadItemsNew(e):this.subpageDisplayForLoadItemsAll(e),this.setCustomAttributesInChildComponents(this)},100);setCustomAttributesInChildComponents(e){const t=[],i=e.getElementsByTagName("*");for(const e of i){e.tagName.startsWith("CH5-")&&(e.setAttribute("swipeGestureEnabled","true"),t.push(e))}return t}debounceInitScrollBar=this.debounce(()=>{this.initScrollbar()},400);scrollAfterSomeTime=this.debounce((e,t)=>{"left"===e?this._elContainer.scrollLeft=t:this._elContainer.scrollTop=t},400);set orientation(e){this._ch5Properties.set("orientation",e,()=>{this.handleOrientation()})}get orientation(){return this._ch5Properties.get("orientation")}set contractName(e){this._ch5Properties.set("contractName",e,()=>{this.handleContractName()})}get contractName(){return this._ch5Properties.get("contractName")}set useContractForEnable(e){this._ch5Properties.set("useContractForEnable",e,()=>{this.debounceSubpageDisplay()})}get useContractForEnable(){return this._ch5Properties.get("useContractForEnable")}set useContractForShow(e){this._ch5Properties.set("useContractForShow",e,()=>{this.debounceSubpageDisplay()})}get useContractForShow(){return this._ch5Properties.get("useContractForShow")}set useContractForItemEnable(e){this._ch5Properties.set("useContractForItemEnable",e,()=>{this.debounceSubpageDisplay()})}get useContractForItemEnable(){return this._ch5Properties.get("useContractForItemEnable")}set useContractForItemShow(e){this._ch5Properties.set("useContractForItemShow",e,()=>{this.debounceSubpageDisplay()})}get useContractForItemShow(){return this._ch5Properties.get("useContractForItemShow")}set useContractForCustomStyle(e){this._ch5Properties.set("useContractForCustomStyle",e,()=>{this.debounceSubpageDisplay()})}get useContractForCustomStyle(){return this._ch5Properties.get("useContractForCustomStyle")}set useContractForCustomClass(e){this._ch5Properties.set("useContractForCustomClass",e,()=>{this.debounceSubpageDisplay()})}get useContractForCustomClass(){return this._ch5Properties.get("useContractForCustomClass")}set useContractForNumItems(e){this._ch5Properties.set("useContractForNumItems",e,()=>{this.debounceSubpageDisplay()})}get useContractForNumItems(){return this._ch5Properties.get("useContractForNumItems")}set endless(e){this._ch5Properties.set("endless",e,()=>{this.handleEndless()})}get endless(){return this._ch5Properties.get("endless")}set centerItems(e){this._ch5Properties.set("centerItems",e,()=>{this.handleCenterItems()})}get centerItems(){return this._ch5Properties.get("centerItems")}set loadItems(e){this._ch5Properties.set("loadItems",e,()=>{this.debounceSubpageDisplay()})}get loadItems(){return this._ch5Properties.get("loadItems")}set rows(e){this._ch5Properties.set("rows",e,()=>{this.handleRowsAndColumn()})}get rows(){return this._ch5Properties.get("rows")}set columns(e){this._ch5Properties.set("columns",e,()=>{this.handleRowsAndColumn()})}get columns(){return this._ch5Properties.get("columns")}set scrollToPosition(e){this._ch5Properties.set("scrollToPosition",e,()=>{const e=this.scrollToPosition<this.numberOfItems&&this.scrollToPosition>=0,t="horizontal"===this.orientation&&1===this.rows||"vertical"===this.orientation&&1===this.columns;e&&t&&this.debounceSubpageDisplay(!0)})}get scrollToPosition(){return this._ch5Properties.get("scrollToPosition")}set scrollbar(e){this._ch5Properties.set("scrollbar",e,()=>{this.handleScrollbar()})}get scrollbar(){return this._ch5Properties.get("scrollbar")}set booleanJoinIncrement(e){this._ch5Properties.set("booleanJoinIncrement",e,()=>{this.debounceSubpageDisplay()})}get booleanJoinIncrement(){return this._ch5Properties.get("booleanJoinIncrement")}set numericJoinIncrement(e){this._ch5Properties.set("numericJoinIncrement",e,()=>{this.debounceSubpageDisplay()})}get numericJoinIncrement(){return this._ch5Properties.get("numericJoinIncrement")}set stringJoinIncrement(e){this._ch5Properties.set("stringJoinIncrement",e,()=>{this.debounceSubpageDisplay()})}get stringJoinIncrement(){return this._ch5Properties.get("stringJoinIncrement")}set subpageReceiveStateEnable(e){this._ch5Properties.set("subpageReceiveStateEnable",e,()=>{this.debounceSubpageDisplay()})}get subpageReceiveStateEnable(){return this._ch5Properties.get("subpageReceiveStateEnable")}set subpageReceiveStateShow(e){this._ch5Properties.set("subpageReceiveStateShow",e,()=>{this.debounceSubpageDisplay()})}get subpageReceiveStateShow(){return this._ch5Properties.get("subpageReceiveStateShow")}set widgetId(e){this._ch5Properties.set("widgetId",e,()=>{this.handleWidgetID()})}get widgetId(){return this._ch5Properties.get("widgetId")}set subpageReceiveStateScrollTo(e){this._ch5Properties.set("subpageReceiveStateScrollTo",e,null,e=>{this._ch5Properties.setForSignalResponse("scrollToPosition",e,()=>{const e=this.scrollToPosition<this.numberOfItems&&this.scrollToPosition>=0,t="horizontal"===this.orientation&&1===this.rows||"vertical"===this.orientation&&1===this.columns;e&&t&&(this.reInit=!0,this.debounceSubpageDisplay(!0))})})}get subpageReceiveStateScrollTo(){return this._ch5Properties.get("subpageReceiveStateScrollTo")}set stretch(e){this._ch5Properties.set("stretch",e,()=>{this.handleStretch()})}get stretch(){return this._ch5Properties.get("stretch")}set numberOfItems(e){this._ch5Properties.set("numberOfItems",e,()=>{this.handleRowsAndColumn()})}get numberOfItems(){return this._ch5Properties.get("numberOfItems")}set receiveStateNumberOfItems(e){this._ch5Properties.set("receiveStateNumberOfItems",e,null,e=>{this._ch5Properties.setForSignalResponse("numberOfItems",e,()=>{!1===this.useContractForNumItems&&(this.previousSignalValues.receiveStateNumberOfItems=this.receiveStateNumberOfItems),this.handleRowsAndColumn()})})}get receiveStateNumberOfItems(){return this._ch5Properties.get("receiveStateNumberOfItems")}set indexId(e){this._ch5Properties.set("indexId",e)}get indexId(){return this._ch5Properties.get("indexId")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.ignoreAttributes=["receivestatehidepulse","receivestateshowpulse","sendeventonshow"],this.logger.start("constructor()",e.ELEMENT_NAME),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-subpage-reference-list attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else"receivestatecustomclass"===(t=t.toLowerCase())?!1===this.useContractForCustomClass&&(super.attributeChangedCallback(t,i,s),this.previousSignalValues.receiveStateCustomClass=this.receiveStateCustomClass):"receivestatecustomstyle"===t?!1===this.useContractForCustomStyle&&(super.attributeChangedCallback(t,i,s),this.previousSignalValues.receiveStateCustomStyle=this.receiveStateCustomStyle):"receivestateshow"===t?!1===this.useContractForShow&&(super.attributeChangedCallback(t,i,s),this.previousSignalValues.receiveStateShow=this.receiveStateShow):"receivestateenable"===t&&!1===this.useContractForEnable&&(super.attributeChangedCallback(t,i,s),this.previousSignalValues.receiveStateEnable=this.receiveStateEnable),super.attributeChangedCallback(t,i,s),this.debounceSubpageDisplay()}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5SubpageReferenceList),this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-subpage-reference-list"),this.appendChild(this._elContainer)),this.checkInternalHTML(),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.debounceSubpageDisplay(),resizeObserver(this._elContainer,this.resizeHandler),customElements.whenDefined(this.nodeName.toLowerCase()).then(()=>{this.componentLoadedEvent(this.nodeName.toLowerCase(),this.id)}),subscribeInViewPortChange(this,()=>{this.elementIsInViewPort&&this.reInit&&(this.reInit=!1,this.debounceSubpageDisplay(),this.debounceInitScrollBar())}),this.listenForCh5SubpageReferenceListRefreshRequests(),this.logger.stop()}listenForCh5SubpageReferenceListRefreshRequests(){this.info("Ch5SubpageReferenceList.listenForCh5SubpageReferenceListRefreshRequests()"),this._refreshSubId=ch5subpageReferenceListSubject.subscribe(e=>{this.info(`Ch5SubpageReferenceList.listenForCh5SubpageReferenceListRefreshRequests() new request for ${e}`),this.getAttribute("widgetId")===e&&this.initializations()})}initializations(){this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-subpage-reference-list"),this.appendChild(this._elContainer)),this.checkInternalHTML(),this.attachEventListeners(),this.initAttributes(),this.handleWidgetID(),this.initCommonMutationObserver(this),this.debounceSubpageDisplay(),this.info("Ch5SubpageReferenceList --- Initialization Finished")}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),unSubscribeInViewPortChange(this),this.reInitialize(),null!==this._refreshSubId&&(this._refreshSubId.unsubscribe(),this._refreshSubId=null),this.showSignalHolder.forEach(e=>this.clearOldSubscription(e.signalValue,e.signalState)),this.showSignalHolder=[],this.logger.stop()}reInitialize(){this.containerWidth=0,this.containerHeight=0,this.reInit=!0}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._scrollbarContainer=document.createElement("div"),this._scrollbar=document.createElement("div"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this.initialize()}attachEventListeners(){super.attachEventListeners(),this._elContainer.addEventListener("mousedown",this.handleMouseDown),this._elContainer.addEventListener("mouseleave",this.handleMouseUpAndLeave),this._elContainer.addEventListener("mouseup",this.handleMouseUpAndLeave),this._elContainer.addEventListener("mousemove",this.handleMouseMove),this._elContainer.addEventListener("scroll",this.handleScrollEvent)}removeEventListeners(){super.removeEventListeners(),this._elContainer.removeEventListener("mouseleave",this.handleMouseUpAndLeave),this._elContainer.removeEventListener("mouseup",this.handleMouseUpAndLeave),this._elContainer.removeEventListener("mousedown",this.handleMouseDown),this._elContainer.removeEventListener("mousemove",this.handleMouseMove),this._elContainer.removeEventListener("scroll",this.handleScrollEvent)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}handleMouseDown=e=>{this.isDown=!0,this._elContainer.classList.add("active"),this.startX=e.pageX-this._elContainer.offsetLeft,this.startY=e.pageY-this._elContainer.offsetTop,this.scrollListLeft=this._elContainer.scrollLeft,this.scrollListTop=this._elContainer.scrollTop};handleMouseUpAndLeave=this.debounce(()=>{this.isDown=!1,this._elContainer.classList.remove("active")},10);handleMouseMove=this.debounce(e=>{if(!this.isDown)return;e.preventDefault();const t=e.pageX-this._elContainer.offsetLeft,i=e.pageY-this._elContainer.offsetTop,s=3*(t-this.startX),n=3*(i-this.startY);this._elContainer.scrollLeft=this.scrollListLeft-s,this._elContainer.scrollTop=this.scrollListTop-n},10);handleScrollEvent=()=>{if(this.initScrollbar(),this.endless)return"all"===this.loadItems?(this.subpageWidth=this._elContainer.children[0].getBoundingClientRect().width,this.subpageHeight=this._elContainer.children[0].getBoundingClientRect().height,this.endlessHelper()):"load-new"===this.loadItems?this.endlessHelperForNew():this.endlessHelper();"visible-only"===this.loadItems?this.scrollHelper():"load-new"===this.loadItems&&this.scrollHelperForNew(),this.setCustomAttributesInChildComponents(this)};scrollHelperForNew(){var e,t,i;if("rtl"===this.dir&&"horizontal"===this.orientation){const{offsetWidth:t,scrollLeft:i,scrollWidth:s}=this._elContainer;if(s-t<this.subpageWidth)return;let n=this.getLastChild();if(Math.abs(i)+t>s-this.subpageWidth&&n!==this.numberOfItems-1){for(let t=0;t<this.rows;t++)if(this.createSubpage(++n),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let t=n;for(;t<this.numberOfItems&&!1===(null==(e=this.showSignalHolder[t])?void 0:e.value);)this.createSubpage(++t)}this.initScrollbar()}}else if("horizontal"===this.orientation){const{offsetWidth:e,scrollLeft:i,scrollWidth:s}=this._elContainer;if(s-e<this.subpageWidth)return;let n=this.getLastChild();if(i+e>s-this.subpageWidth&&n!==this.numberOfItems-1){for(let e=0;e<this.rows;e++)if(n+1<this.numberOfItems&&(this.createSubpage(++n),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible)){let e=n;for(;e<this.numberOfItems&&!1===(null==(t=this.showSignalHolder[e])?void 0:t.value);)this.createSubpage(++e)}this.initScrollbar()}}else{const{offsetHeight:e,scrollTop:t,scrollHeight:s}=this._elContainer;if(s-e<this.subpageHeight)return;let n=this.getLastChild();if(t+e>s-this.subpageHeight&&n!==this.numberOfItems-1){for(let e=0;e<this.columns;e++)if(n+1<this.numberOfItems&&(this.createSubpage(++n),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible)){let e=n;for(;e<this.numberOfItems&&!1===(null==(i=this.showSignalHolder[e])?void 0:i.value);)this.createSubpage(++e)}this.initScrollbar()}}}scrollHelper(){var e,t,i,s,n,r,a,l,o,h,c,u,d,m,g;if("rtl"===this.dir&&"horizontal"===this.orientation){const{offsetWidth:r,scrollLeft:a,scrollWidth:l}=this._elContainer;if(l-r<this.subpageWidth)return;let o=this.getFirstChild(),h=this.getLastChild();if(Math.abs(a)+r>l-this.subpageWidth&&h!==this.numberOfItems-1){for(let i=0;i<this.rows;i++){if(this.createSubpage(++h),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let t=h;for(;t<this.numberOfItems&&!1===(null==(e=this.showSignalHolder[t])?void 0:e.value);)this.createSubpage(++t)}null==(t=this._elContainer.firstElementChild)||t.remove()}this._elContainer.scrollLeft+=this.subpageWidth}else if(Math.abs(a)<this.subpageWidth&&0!==o){let e=(h+1)%this.rows;for(let t=0;t<this.rows;t++){if(this.createSubpage(--o,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=o;for(;e>0&&!1===(null==(i=this.showSignalHolder[e])?void 0:i.value);)this.createSubpage(--e,!1)}(h+1)%this.rows!==0?e-- >0&&(null==(s=this._elContainer.lastElementChild)||s.remove()):null==(n=this._elContainer.lastElementChild)||n.remove()}this._elContainer.scrollLeft-=this.subpageWidth}}else if("horizontal"===this.orientation){const{offsetWidth:e,scrollLeft:t,scrollWidth:i}=this._elContainer;if(i-e<this.subpageWidth)return;let s=this.getFirstChild(),n=this.getLastChild();if(t<5&&0!==s){let e=(n+1)%this.rows;for(let t=0;t<this.rows;t++){if(this.createSubpage(--s,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=s;for(;e>0&&!1===(null==(r=this.showSignalHolder[e])?void 0:r.value);)this.createSubpage(--e,!1)}(n+1)%this.rows!==0?e-- >0&&(null==(a=this._elContainer.lastElementChild)||a.remove()):null==(l=this._elContainer.lastElementChild)||l.remove()}this._elContainer.scrollLeft+=5}else if(t+e>i-5&&n!==this.numberOfItems-1){for(let e=0;e<this.rows;e++){if(n+1<this.numberOfItems&&(this.createSubpage(++n),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible)){let e=n;for(;e<this.numberOfItems&&!1===(null==(o=this.showSignalHolder[e])?void 0:o.value);)this.createSubpage(++e)}null==(h=this._elContainer.firstElementChild)||h.remove()}this._elContainer.scrollLeft-=5}}else{const{offsetHeight:e,scrollTop:t,scrollHeight:i}=this._elContainer;let s=this.getFirstChild(),n=this.getLastChild();if(t<5&&0!==s){let e=(n+1)%this.columns;for(let t=0;t<this.columns;t++){if(this.createSubpage(--s,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=s;for(;e>0&&!1===(null==(c=this.showSignalHolder[e])?void 0:c.value);)this.createSubpage(--e,!1)}(n+1)%this.columns!==0?e-- >0&&(null==(u=this._elContainer.lastElementChild)||u.remove()):null==(d=this._elContainer.lastElementChild)||d.remove()}this._elContainer.scrollTop+=5}else if(t+e>i-5&&n!==this.numberOfItems-1){for(let e=0;e<this.columns;e++){if(n+1<this.numberOfItems&&(this.createSubpage(++n),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible)){let e=n;for(;e<this.numberOfItems&&!1===(null==(m=this.showSignalHolder[e])?void 0:m.value);)this.createSubpage(++e)}null==(g=this._elContainer.firstElementChild)||g.remove()}this._elContainer.scrollTop-=5}}}endlessHelper(){var e,t,i,s,n,r,a,l,o,h,c,u;const{offsetHeight:d,offsetWidth:m,scrollLeft:g,scrollTop:b,scrollWidth:p,scrollHeight:_}=this._elContainer;if(!1!==("horizontal"===this.orientation?m+this.subpageWidth<p:d+this.subpageHeight<_))if("horizontal"===this.orientation&&"rtl"===this.dir){if(Math.abs(g)+m>p-this.subpageWidth/4){const i=this.getLastChild(),s=(this.numberOfItems+i+1)%this.numberOfItems;if(this.createSubpage(s),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let t=s;for(;t<this.numberOfItems&&!1===(null==(e=this.showSignalHolder[t])?void 0:e.value);)this.createSubpage(++t)}null==(t=this._elContainer.firstElementChild)||t.remove(),this._elContainer.scrollLeft+=this.subpageWidth/2}else if(Math.abs(g)<this.subpageWidth/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createSubpage(t,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e>0&&!1===(null==(i=this.showSignalHolder[e])?void 0:i.value);)this.createSubpage(--e,!1)}null==(s=this._elContainer.lastElementChild)||s.remove(),this._elContainer.scrollLeft-=this.subpageWidth/2}}else if("horizontal"===this.orientation){if(g<this.subpageWidth/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createSubpage(t,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e>0&&!1===(null==(n=this.showSignalHolder[e])?void 0:n.value);)this.createSubpage(--e,!1)}null==(r=this._elContainer.lastElementChild)||r.remove(),this._elContainer.scrollLeft+=this.subpageWidth/2}else if(g+m>p-this.subpageWidth/4){const e=this.getLastChild(),t=(this.numberOfItems+e+1)%this.numberOfItems;if(this.createSubpage(t),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e<this.numberOfItems&&!1===(null==(a=this.showSignalHolder[e])?void 0:a.value);)this.createSubpage(++e)}null==(l=this._elContainer.firstElementChild)||l.remove(),this._elContainer.scrollLeft-=this.subpageWidth/2}}else if(b<this.subpageHeight/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createSubpage(t,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e>0&&!1===(null==(o=this.showSignalHolder[e])?void 0:o.value);)this.createSubpage(--e,!1)}null==(h=this._elContainer.lastElementChild)||h.remove(),this._elContainer.scrollTop+=this.subpageHeight/2}else if(b+d>_-this.subpageHeight/4){const e=this.getLastChild(),t=(this.numberOfItems+e+1)%this.numberOfItems;if(this.createSubpage(t),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e<this.numberOfItems&&!1===(null==(c=this.showSignalHolder[e])?void 0:c.value);)this.createSubpage(++e)}null==(u=this._elContainer.firstElementChild)||u.remove(),this._elContainer.scrollTop-=this.subpageHeight/2,this.scrollToPosition===this.numberOfItems-1&&0===t&&(this._elContainer.scrollTop+=this.subpageHeight)}}endlessHelperForNew(){var e,t,i,s,n,r,a,l,o,h,c,u;const{offsetHeight:d,offsetWidth:m,scrollLeft:g,scrollTop:b,scrollWidth:p,scrollHeight:_}=this._elContainer;if(!1!==("horizontal"===this.orientation?m+this.subpageWidth<p:d+this.subpageHeight<_))if("horizontal"===this.orientation&&"rtl"===this.dir){if(Math.abs(g)+m>p-this.subpageWidth/4){const i=this.getLastChild(),s=(this.numberOfItems+i+1)%this.numberOfItems;if(this.createSubpage(s),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let t=s;for(;t<this.numberOfItems&&!1===(null==(e=this.showSignalHolder[t])?void 0:e.value);)this.createSubpage(++t)}for(;this._elContainer.children.length>this.numberOfItems;)null==(t=this._elContainer.firstElementChild)||t.remove();this._elContainer.scrollLeft+=this.subpageWidth/2}else if(Math.abs(g)<this.subpageWidth/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createSubpage(t,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e>0&&!1===(null==(i=this.showSignalHolder[e])?void 0:i.value);)this.createSubpage(--e,!1)}for(;this._elContainer.children.length>this.numberOfItems;)null==(s=this._elContainer.lastElementChild)||s.remove();this._elContainer.scrollLeft-=this.subpageWidth/2}}else if("horizontal"===this.orientation){if(g<this.subpageWidth/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createSubpage(t,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e>0&&!1===(null==(n=this.showSignalHolder[e])?void 0:n.value);)this.createSubpage(--e,!1)}for(;this._elContainer.children.length>this.numberOfItems;)null==(r=this._elContainer.lastElementChild)||r.remove();this._elContainer.scrollLeft+=this.subpageWidth/2}else if(g+m>p-this.subpageWidth/4){const e=this.getLastChild(),t=(this.numberOfItems+e+1)%this.numberOfItems;if(this.createSubpage(t),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e<this.numberOfItems&&!1===(null==(a=this.showSignalHolder[e])?void 0:a.value);)this.createSubpage(++e)}for(;this._elContainer.children.length>this.numberOfItems;)null==(l=this._elContainer.firstElementChild)||l.remove();this._elContainer.scrollLeft-=this.subpageWidth/2}}else if(b<this.subpageHeight/4){const e=this.getFirstChild(),t=(this.numberOfItems+e-1)%this.numberOfItems;if(this.createSubpage(t,!1),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e>0&&!1===(null==(o=this.showSignalHolder[e])?void 0:o.value);)this.createSubpage(--e,!1)}for(;this._elContainer.children.length>this.numberOfItems;)null==(h=this._elContainer.lastElementChild)||h.remove();this._elContainer.scrollTop+=this.subpageHeight/2}else if(b+d>_-this.subpageHeight/4){const e=this.getLastChild(),t=(this.numberOfItems+e+1)%this.numberOfItems;if(this.createSubpage(t),!0===this.loadSubpageForShow&&!1===this.allSubpageVisible){let e=t;for(;e<this.numberOfItems&&!1===(null==(c=this.showSignalHolder[e])?void 0:c.value);)this.createSubpage(++e)}for(;this._elContainer.children.length>this.numberOfItems;)null==(u=this._elContainer.firstElementChild)||u.remove();this._elContainer.scrollTop-=this.subpageHeight/2,this.scrollToPosition===this.numberOfItems-1&&0===t&&(this._elContainer.scrollTop+=this.subpageHeight)}}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleOrientation(){Array.from(e.COMPONENT_DATA.ORIENTATION.values).forEach(t=>{this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.COMPONENT_DATA.ORIENTATION.classListPrefix+t)}),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this.handleRowsAndColumn()}handleEndless(){this.endless&&(this.endless="horizontal"===this.orientation?1===this.rows:1===this.columns),this.endless&&!0===this.scrollbar&&(this.scrollbar=!1)}handleCenterItems(){[!0,!1].forEach(t=>{this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+t.toString())}),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+this.centerItems),!0===this.centerItems&&this.debounceSubpageDisplay()}handleRowsAndColumn(){this.endless&&(this.endless="horizontal"===this.orientation?1===this.rows:1===this.columns),"both"===this.stretch&&(this.stretch="horizontal"===this.orientation?1===this.rows?"both":null:1===this.columns?"both":null),"horizontal"===this.orientation?(this._elContainer.style.removeProperty("grid-template-columns"),this._elContainer.style.removeProperty("grid-template-rows"),this.rowClassValue=this.rows<this.numberOfItems?this.rows:this.numberOfItems,this._elContainer.style.setProperty("grid-template-rows","repeat("+this.rowClassValue+", 1fr)")):(this._elContainer.style.removeProperty("grid-template-columns"),this._elContainer.style.removeProperty("grid-template-rows"),this.columnClassValue=this.columns<this.numberOfItems?this.columns:this.numberOfItems,this._elContainer.style.setProperty("grid-template-columns","repeat("+this.columnClassValue+", 1fr)")),this.debounceSubpageDisplay()}handleScrollbar(){!0===this.endless&&!0===this.scrollbar&&(this.scrollbar=!1),[!0,!1].forEach(t=>{this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+t.toString())}),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+this.scrollbar),this.initScrollbar()}handleScrollToPosition(t){var i,s;if(!(t>=this.numberOfItems||t<0||"horizontal"===this.orientation&&1!==this.rows||"vertical"===this.orientation&&1!==this.columns)){if(this.subpageWidth=(null==(i=this._elContainer.firstElementChild)?void 0:i.getBoundingClientRect().width)||this.subpageWidth,this.subpageHeight=(null==(s=this._elContainer.firstElementChild)?void 0:s.getBoundingClientRect().width)||this.subpageHeight,Array.from(this._elContainer.children).forEach(e=>e.remove()),0!==this.contractName.length&&!0===this.useContractForItemShow||0!==this.subpageReceiveStateShow.length&&!0===this.subpageReceiveStateShow.trim().includes(`{{${this.indexId}}}`)){this.loadSubpageForShow=!0,0===this.showSignalHolder.length&&this.signalHolder();const e=this.showSignalHolder.filter(e=>!0===(null==e?void 0:e.value)).length;this.allSubpageVisible=e===this.numberOfItems}else this.loadSubpageForShow=!1;if("rtl"===this.dir&&"horizontal"===this.orientation){const i=this._elContainer.getBoundingClientRect().width||this.containerWidth,s=Math.ceil(i/this.subpageWidth)+e.SUBPAGE_CONTAINER_BUFFER;if(t>=this.numberOfItems-(s-e.SUBPAGE_CONTAINER_BUFFER)){for(let e=this.numberOfItems-s;e<this.numberOfItems;e++)this.createSubpage(e);this._elContainer.scrollLeft=t===this.numberOfItems-1?5*this.subpageWidth*-1:this.subpageWidth*e.SUBPAGE_CONTAINER_BUFFER*-1,!1===this.allSubpageVisible&&!0===this.loadSubpageForShow&&this.scrollToRightEdgeRange()}else if(t>=e.SUBPAGE_CONTAINER_BUFFER){for(let i=t-e.SUBPAGE_CONTAINER_BUFFER;i<t+s&&i<this.numberOfItems;i++)this.createSubpage(i);this._elContainer.scrollLeft=this.subpageWidth*e.SUBPAGE_CONTAINER_BUFFER*-1,!1===this.allSubpageVisible&&!0===this.loadSubpageForShow&&this.scrollToMiddleRange()}else{for(let e=0;e<s&&e<this.numberOfItems;e++)this.createSubpage(e);this._elContainer.scrollLeft=this.subpageWidth*t*-1,!1===this.allSubpageVisible&&!0===this.loadSubpageForShow&&this.scrollToLeftEdgeRange()}}else if("horizontal"===this.orientation){const i=this._elContainer.getBoundingClientRect().width||this.containerWidth,s=Math.ceil(i/this.subpageWidth)+e.SUBPAGE_CONTAINER_BUFFER;if(t>=this.numberOfItems-(s-e.SUBPAGE_CONTAINER_BUFFER)){for(let e=this.numberOfItems-s;e<this.numberOfItems;e++)this.createSubpage(e);this.scrollAfterSomeTime("left",t===this.numberOfItems-1?5*this.subpageWidth:this.subpageWidth*e.SUBPAGE_CONTAINER_BUFFER)}else if(t>=e.SUBPAGE_CONTAINER_BUFFER){for(let i=t-e.SUBPAGE_CONTAINER_BUFFER;i<t+s&&i<this.numberOfItems;i++)this.createSubpage(i);this.scrollAfterSomeTime("left",this.subpageWidth*e.SUBPAGE_CONTAINER_BUFFER)}else{for(let e=0;e<s&&e<this.numberOfItems;e++)this.createSubpage(e);this.scrollAfterSomeTime("left",this.subpageWidth*t)}}else{const i=this._elContainer.getBoundingClientRect().height||this.containerHeight,s=Math.ceil(i/this.subpageHeight)+e.SUBPAGE_CONTAINER_BUFFER;if(0===i)for(let e=0;e<this.numberOfItems;e++)this.createSubpage(e);else if(t>=this.numberOfItems-(s-e.SUBPAGE_CONTAINER_BUFFER)){for(let e=this.numberOfItems-s;e<this.numberOfItems;e++)this.createSubpage(e);this._elContainer.scrollTop=t===this.numberOfItems-1?5*this.subpageHeight:this.subpageHeight*e.SUBPAGE_CONTAINER_BUFFER,!1===this.allSubpageVisible&&!0===this.loadSubpageForShow&&this.scrollToRightEdgeRange()}else if(t>=e.SUBPAGE_CONTAINER_BUFFER){for(let i=t-e.SUBPAGE_CONTAINER_BUFFER;i<t+s&&i<this.numberOfItems;i++)this.createSubpage(i);this._elContainer.scrollTop=this.subpageHeight*e.SUBPAGE_CONTAINER_BUFFER,!1===this.allSubpageVisible&&!0===this.loadSubpageForShow&&this.scrollToMiddleRange()}else{for(let e=0;e<s&&e<this.numberOfItems;e++)this.createSubpage(e);this._elContainer.scrollTop=this.subpageHeight*t,!1===this.allSubpageVisible&&!0===this.loadSubpageForShow&&this.scrollToLeftEdgeRange()}}this.debounceInitScrollBar()}}handleScrollToPositionForNew(t){var i,s,n,r,a;if(!(t>=this.numberOfItems||t<0||"horizontal"===this.orientation&&1!==this.rows||"vertical"===this.orientation&&1!==this.columns)){if(0!==this.subpageWidth&&0!==this.subpageHeight||(0===this._elContainer.children.length?(this.createSubpage(0),this.subpageWidth=(null==(i=this._elContainer.firstElementChild)?void 0:i.getBoundingClientRect().width)||this.subpageWidth,this.subpageHeight=(null==(s=this._elContainer.firstElementChild)?void 0:s.getBoundingClientRect().height)||this.subpageHeight,null==(n=this._elContainer.firstElementChild)||n.remove()):(this.subpageWidth=(null==(r=this._elContainer.firstElementChild)?void 0:r.getBoundingClientRect().width)||this.subpageWidth,this.subpageHeight=(null==(a=this._elContainer.firstElementChild)?void 0:a.getBoundingClientRect().height)||this.subpageHeight)),0!==this.contractName.length&&!0===this.useContractForItemShow||0!==this.subpageReceiveStateShow.length&&!0===this.subpageReceiveStateShow.trim().includes(`{{${this.indexId}}}`)){this.loadSubpageForShow=!0,0===this.showSignalHolder.length&&this.signalHolder();const e=this.showSignalHolder.filter(e=>!0===(null==e?void 0:e.value)).length;this.allSubpageVisible=e===this.numberOfItems}else this.loadSubpageForShow=!1;if("rtl"===this.dir&&"horizontal"===this.orientation){const i=this._elContainer.getBoundingClientRect().width||this.containerWidth,s=Math.ceil(i/this.subpageWidth)+e.SUBPAGE_CONTAINER_BUFFER;if(0===this._elContainer.children.length)for(let e=0;e<this.numberOfItems&&e<t+s-1;e++)this.createSubpage(e);else if(this.getLastChild()<t+s)for(let e=this.getLastChild()+1;e<this.numberOfItems&&e<t+s;e++)this.createSubpage(e);this._elContainer.scrollLeft=0!==t?t*this.subpageWidth*-1:0}else if("horizontal"===this.orientation){const i=this._elContainer.getBoundingClientRect().width||this.containerWidth,s=Math.ceil(i/this.subpageWidth)+e.SUBPAGE_CONTAINER_BUFFER;if(0===this._elContainer.children.length)for(let e=0;e<this.numberOfItems&&e<t+s-1;e++)this.createSubpage(e);else if(this.getLastChild()<t+s)for(let e=this.getLastChild()+1;e<this.numberOfItems&&e<t+s;e++)this.createSubpage(e);this._elContainer.scrollLeft=0!==t?t*this.subpageWidth:0}else{const i=this._elContainer.getBoundingClientRect().height||this.containerHeight,s=Math.ceil(i/this.subpageHeight)+e.SUBPAGE_CONTAINER_BUFFER;if(i<=10||i<=this.subpageHeight+10)for(let e=0;e<this.numberOfItems;e++)this.createSubpage(e);else if(0===this._elContainer.children.length)for(let e=0;e<this.numberOfItems&&e<t+s-1;e++)this.createSubpage(e);else if(this.getLastChild()<t+s)for(let e=this.getLastChild()+1;e<this.numberOfItems&&e<t+s;e++)this.createSubpage(e);this._elContainer.scrollTop=0!==t?t*this.subpageHeight:0}if(!1===this.allSubpageVisible&&!0===this.loadSubpageForShow){let e=0;for(let t=this.getFirstChild();t<=this.getLastChild();t++)!1===this.showSignalHolder[t].value&&(e+=1);let t=0;for(;0!==e&&t<e&&this.getLastChild()!==this.numberOfItems-1;)!0===this.showSignalHolder[this.getLastChild()+1].value&&(t+=1),this.createSubpage(this.getLastChild()+1)}this.initScrollbar()}}handleScrollToPositionForAll(e){var t,i;e>=this.numberOfItems||e<0||"horizontal"===this.orientation&&1!==this.rows||"vertical"===this.orientation&&1!==this.columns||(this.subpageWidth=(null==(t=this._elContainer.firstElementChild)?void 0:t.getBoundingClientRect().width)||this.subpageWidth,this.subpageHeight=(null==(i=this._elContainer.firstElementChild)?void 0:i.getBoundingClientRect().height)||this.subpageHeight,"rtl"===this.dir&&"horizontal"===this.orientation?this._elContainer.scrollLeft=e*this.subpageWidth*-1:"horizontal"===this.orientation?this._elContainer.scrollLeft=e*this.subpageWidth:this._elContainer.scrollTop=e*this.subpageHeight,this.initScrollbar())}handleWidgetID(){if(isEmpty6(this.widgetId))throw new Error("[ch5-subpage-reference-list] Error: No widgetId was provided");const e=document.getElementById(this.widgetId);if(isNil18(e))throw new Error(`[ch5-subpage-reference-list] Error: No template with the id: "${this.widgetId}" found`);this._templateElement=e,this.debounceSubpageDisplay()}handleStretch(){"both"===this.stretch&&(this.stretch="horizontal"===this.orientation?1===this.rows?"both":null:1===this.columns?"both":null),null===this.stretch?this._elContainer.classList.remove(this.primaryCssClass+"--stretch-both"):this.debounceSubpageDisplay()}subpageDisplay(t=!1){if(this.contractDefaultHelper(),!0===t)return this.handleScrollToPosition(this.scrollToPosition);this._elContainer.classList.remove(this.primaryCssClass+"--stretch-both"),Array.from(this._elContainer.children).forEach(e=>e.remove()),this.createSubpage(0),this.subpageWidth=this._elContainer.children[0].getBoundingClientRect().width,this.subpageHeight=this._elContainer.children[0].getBoundingClientRect().height;let i=0;if("horizontal"===this.orientation){const t=this._elContainer.getBoundingClientRect().width||this.containerWidth;i=Math.floor(t/this.subpageWidth)*this.rows+this.rows*e.SUBPAGE_CONTAINER_BUFFER}else{const t=this._elContainer.getBoundingClientRect().height||this.containerHeight;i=t>this.subpageHeight?Math.floor(t/this.subpageHeight)*this.columns+this.columns*e.SUBPAGE_CONTAINER_BUFFER:this.numberOfItems}i=i>this.numberOfItems?this.numberOfItems:i;for(let e=1;e<i;e++)this.createSubpage(e);this.endless&&("horizontal"===this.orientation?this._elContainer.scrollLeft=5:this._elContainer.scrollTop=5),this.initScrollbar(),"both"===this.stretch&&this._elContainer.classList.add(this.primaryCssClass+"--stretch-both"),this.checkCenterItems(),this.signalHolder(),0!==this.scrollToPosition&&this.handleScrollToPosition(this.scrollToPosition)}subpageDisplayForLoadItemsNew(t=!1){if(this.contractDefaultHelper(),!0===t)return this.handleScrollToPositionForNew(this.scrollToPosition);this._elContainer.classList.remove(this.primaryCssClass+"--stretch-both"),Array.from(this._elContainer.children).forEach(e=>e.remove()),this.createSubpage(0),this.subpageWidth=this._elContainer.children[0].getBoundingClientRect().width,this.subpageHeight=this._elContainer.children[0].getBoundingClientRect().height;let i=0;if("horizontal"===this.orientation){const t=this._elContainer.getBoundingClientRect().width||this.containerWidth;i=Math.floor(t/this.subpageWidth)*this.rows+this.rows*e.SUBPAGE_CONTAINER_BUFFER}else{const t=this._elContainer.getBoundingClientRect().height||this.containerHeight;i=t>this.subpageHeight+10?Math.floor(t/this.subpageHeight)*this.columns+this.columns*e.SUBPAGE_CONTAINER_BUFFER:this.numberOfItems}i=i>this.numberOfItems?this.numberOfItems:i;for(let e=1;e<i;e++)this.createSubpage(e);this.endless&&("horizontal"===this.orientation?this._elContainer.scrollLeft=5:this._elContainer.scrollTop=5),this.initScrollbar(),"both"===this.stretch&&this._elContainer.classList.add(this.primaryCssClass+"--stretch-both"),this.checkCenterItems(),this.signalHolder(),0!==this.scrollToPosition&&this.handleScrollToPositionForNew(this.scrollToPosition)}subpageDisplayForLoadItemsAll(e=!1){this.contractDefaultHelper(),Array.from(this._elContainer.children).forEach(e=>e.remove());for(let e=0;e<this.numberOfItems;e++)this.createSubpage(e);this.endless&&("horizontal"===this.orientation?this._elContainer.scrollLeft=5:this._elContainer.scrollTop=5),this.initScrollbar(),"both"===this.stretch&&this._elContainer.classList.add(this.primaryCssClass+"--stretch-both"),this.checkCenterItems(),!0===e&&0===this.scrollToPosition&&("horizontal"===this.orientation?this._elContainer.scrollLeft=0:this._elContainer.scrollTop=0),0!==this.scrollToPosition&&this.handleScrollToPositionForAll(this.scrollToPosition)}replaceAll(e,t,i){return e&&""!==String(e).trim()?String(e).split(t).join(i):e}createSubpage(e,t=!0){var i,s,n,r,a,l,o,h,c,u;if(e<0||e>=this.numberOfItems)return;if(isNil18(this._templateElement))throw new Error("[ch5-subpage-reference-list] Error: Incorrect tag used");const d=document.createElement("template");d.innerHTML=this._templateElement.innerHTML;const m=document.createElement("div");if(m.setAttribute("id",this.getCrId()+"-"+e),""!==this.contractName&&!0===this.useContractForItemShow)m.setAttribute("data-ch5-noshow-type","display"),m.setAttribute("data-ch5-show",this.contractName+`.List_Item${e+1}_Visible`);else if(!1===(null==(i=this.getAttribute("subpageReceiveStateShow"))?void 0:i.trim().includes(`{{${this.indexId}}}`))){const e=null==(s=this.getAttribute("subpageReceiveStateShow"))?void 0:s.trim();e&&(m.setAttribute("data-ch5-noshow-type","display"),m.setAttribute("data-ch5-show",e.trim()))}else if(this.hasAttribute("subpageReceiveStateShow")&&(null==(n=this.getAttribute("subpageReceiveStateShow"))?void 0:n.trim())){const t=this.replaceAll((null==(r=this.getAttribute("subpageReceiveStateShow"))?void 0:r.trim())+"",`{{${this.indexId}}}`,""),i=/^[0-9]+$/.test(t);m.setAttribute("data-ch5-noshow-type","display"),i?m.setAttribute("data-ch5-show",Number(t)+e+""):m.setAttribute("data-ch5-show",this.replaceAll((null==(a=this.getAttribute("subpageReceiveStateShow"))?void 0:a.trim())+"",`{{${this.indexId}}}`,e+""))}if(""!==this.contractName&&!0===this.useContractForItemEnable)m.setAttribute("data-ch5-enable",this.contractName+`.List_Item${e+1}_Enable`);else if(!1===(null==(l=this.getAttribute("subpageReceiveStateEnable"))?void 0:l.trim().includes(`{{${this.indexId}}}`))){const e=null==(o=this.getAttribute("subpageReceiveStateEnable"))?void 0:o.trim();e&&m.setAttribute("data-ch5-enable",e.trim())}else if(this.hasAttribute("subpageReceiveStateEnable")&&(null==(h=this.getAttribute("subpageReceiveStateEnable"))?void 0:h.trim())){const t=this.replaceAll((null==(c=this.getAttribute("subpageReceiveStateEnable"))?void 0:c.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(t)?m.setAttribute("data-ch5-enable",Number(t)+e+""):m.setAttribute("data-ch5-enable",this.replaceAll((null==(u=this.getAttribute("subpageReceiveStateEnable"))?void 0:u.trim())+"",`{{${this.indexId}}}`,e+""))}m.classList.add(this.nodeName.toLowerCase()+"--subpage-container"),null!==this.indexId&&(Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(d,e,this.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(d,e,this.indexId)),m.appendChild(d.content),""!==this.contractName?Ch5AugmentVarSignalsNames.differentiateTmplElemsAttrs(m,this.contractName+".Items["+e+"].",0,0,0):Ch5AugmentVarSignalsNames.differentiateTmplElemsAttrs(m,"",parseInt(this.booleanJoinIncrement,10)*e||0,parseInt(this.numericJoinIncrement,10)*e||0,parseInt(this.stringJoinIncrement,10)*e||0),t?this._elContainer.appendChild(m):this._elContainer.prepend(m)}handleContractName(){0===this.contractName.trim().length&&(this.previousSignalValues.contractName="",this.receiveStateShow=this.previousSignalValues.receiveStateShow,this.receiveStateEnable=this.previousSignalValues.receiveStateEnable,this.receiveStateCustomStyle=this.previousSignalValues.receiveStateCustomStyle,this.receiveStateCustomClass=this.previousSignalValues.receiveStateCustomClass,this.receiveStateNumberOfItems=this.previousSignalValues.receiveStateNumberOfItems,this.subpageReceiveStateScrollTo=this.previousSignalValues.subpageReceiveStateScrollTo),this.debounceSubpageDisplay()}initialize(){""===this.previousSignalValues.contractName&&(this.previousSignalValues.contractName=this.contractName,this.previousSignalValues.receiveStateShow=this.receiveStateShow,this.previousSignalValues.receiveStateEnable=this.receiveStateEnable,this.previousSignalValues.receiveStateCustomStyle=this.receiveStateCustomStyle,this.previousSignalValues.receiveStateCustomClass=this.receiveStateCustomClass,this.previousSignalValues.receiveStateNumberOfItems=this.receiveStateNumberOfItems,this.previousSignalValues.subpageReceiveStateScrollTo=this.subpageReceiveStateScrollTo)}contractDefaultHelper(){""!==this.contractName&&(!0===this.useContractForCustomStyle?this.receiveStateCustomStyle=this.contractName+".CustomStyle":this.receiveStateCustomStyle=this.previousSignalValues.receiveStateCustomStyle,!0===this.useContractForCustomClass?this.receiveStateCustomClass=this.contractName+".CustomClass":this.receiveStateCustomClass=this.previousSignalValues.receiveStateCustomClass,!0===this.useContractForEnable?this.receiveStateEnable=this.contractName+".List_Enable":this.receiveStateEnable=this.previousSignalValues.receiveStateEnable,!0===this.useContractForShow?this.receiveStateShow=this.contractName+".List_Visible":this.receiveStateShow=this.previousSignalValues.receiveStateShow,!0===this.useContractForNumItems?this.receiveStateNumberOfItems=this.contractName+".Set_Number_Of_Items":this.receiveStateNumberOfItems=this.previousSignalValues.receiveStateNumberOfItems,this.subpageReceiveStateScrollTo=this.contractName+".ListScrollToItem")}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this.stretch&&this._elContainer.classList.add(e.COMPONENT_DATA.STRETCH.classListPrefix+this.stretch),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this._elContainer.style.setProperty("grid-template-rows","repeat("+this.rows+", 1fr)"),this._elContainer.classList.add(e.ELEMENT_NAME+e.SCROLLBAR_CLASSLIST_PREFIX+this.scrollbar),this._elContainer.classList.add(e.ELEMENT_NAME+e.CENTER_ITEMS_CLASSLIST_PREFIX+this.centerItems),this.logger.stop()}initScrollbar(){var t,i,s,n;if(this.subpageWidth=(null==(t=this._elContainer.firstElementChild)?void 0:t.getBoundingClientRect().width)||this.subpageWidth,this.subpageHeight=(null==(i=this._elContainer.firstElementChild)?void 0:i.getBoundingClientRect().width)||this.subpageHeight,"horizontal"===this.orientation&&"rtl"===this.dir){const{scrollWidth:e,offsetWidth:t,scrollLeft:i}=this._elContainer;this.scrollbarDimension=Math.floor(t/e*100);const s=Math.ceil(Math.abs(i)/e*100);this._scrollbar.style.removeProperty("height"),this._scrollbar.style.removeProperty("top"),this._scrollbar.style.width=this.scrollbarDimension+"%",this._scrollbar.style.left=100-this.scrollbarDimension-s+"%"}else if("horizontal"===this.orientation){const{scrollWidth:e,offsetWidth:t,scrollLeft:i}=this._elContainer;this.scrollbarDimension=Math.floor(t/e*100);const s=Math.ceil(i/e*100);this._scrollbar.style.removeProperty("height"),this._scrollbar.style.removeProperty("top"),this._scrollbar.style.width=this.scrollbarDimension+"%",this._scrollbar.style.left=s+"%"}else{const{scrollHeight:e,offsetHeight:t,scrollTop:i}=this._elContainer;this.scrollbarDimension=Math.floor(t/e*100);const s=Math.ceil(i/e*100);this._scrollbar.style.removeProperty("width"),this._scrollbar.style.removeProperty("left"),this._scrollbar.style.height=this.scrollbarDimension+"%",this._scrollbar.style.top=s+"%"}this.subpageWidth=(null==(s=this._elContainer.firstElementChild)?void 0:s.getBoundingClientRect().width)||this.subpageWidth,this.subpageHeight=(null==(n=this._elContainer.firstElementChild)?void 0:n.getBoundingClientRect().height)||this.subpageHeight,this.scrollbar&&(100===this.scrollbarDimension?(this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+"true"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+"false")):(this.checkCenterItems(),this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+"false"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.SCROLLBAR_CLASSLIST_PREFIX+"true")))}checkInternalHTML(){this._elContainer.parentElement!==this&&(this._elContainer.classList.add(this.nodeName.toLowerCase()),this.appendChild(this._elContainer)),this._scrollbar.parentElement!==this._scrollbarContainer&&(this._scrollbar.classList.add("scrollbar"),this._scrollbarContainer.appendChild(this._scrollbar)),this._scrollbarContainer.parentElement!==this&&(this._scrollbarContainer.classList.add("scrollbar-container"),this.appendChild(this._scrollbarContainer))}resizeHandler=e=>{const{width:t,height:i}=this._elContainer.getBoundingClientRect();0===this.containerWidth&&0!==t?(this.containerWidth=t,this.debounceSubpageDisplay()):0===this.containerHeight&&0!==i&&(this.containerHeight=i,this.debounceSubpageDisplay()),this.debounceInitScrollBar()};signalHolder(){var e,t;if(0!==this.contractName.length&&!0===this.useContractForItemShow){this.showSignalHolder.forEach(e=>this.clearOldSubscription(e.signalValue,e.signalState)),this.showSignalHolder=[],this.loadSubpageForShow=!0;for(let e=1;e<=this.numberOfItems;e++){const t=`${this.contractName}.List_Item${e}_Visible`,i=this.setSignalByBoolean(t);this.showSignalHolder.push({signalState:"",signalValue:t,value:!1}),_35.isNil(i)||(this.showSignalHolder[e-1].signalState=i.subscribe(t=>(this.showSignalHolder[e-1].value=t,this.debounceSubpageShow(),!0)))}}else if(0!==this.subpageReceiveStateShow.length&&!0===this.subpageReceiveStateShow.trim().includes(`{{${this.indexId}}}`)){this.showSignalHolder.forEach(e=>this.clearOldSubscription(e.signalValue,e.signalState)),this.showSignalHolder=[],this.loadSubpageForShow=!0;const i=this.replaceAll((null==(e=this.getAttribute("subpageReceiveStateShow"))?void 0:e.trim())+"",`{{${this.indexId}}}`,""),s=/^[0-9]+$/.test(i);for(let e=0;e<this.numberOfItems;e++){const n=s?Number(i)+e+"":this.replaceAll((null==(t=this.getAttribute("subpageReceiveStateShow"))?void 0:t.trim())+"",`{{${this.indexId}}}`,e+"");this.showSignalHolder.push({signalState:"",signalValue:n,value:!1});const r=this.setSignalByBoolean(n);_35.isNil(r)||(this.showSignalHolder[e].signalState=r.subscribe(t=>(this.showSignalHolder[e].value=t,this.debounceSubpageShow(),!0)))}}}clearOldSubscription(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);null!==s&&s.unsubscribe(t)}setSignalByBoolean(e){const t=Ch5Signal.getSubscriptionSignalName(e),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);return null===i?null:i}subpageShow(){const e=this.showSignalHolder.filter(e=>!0===(null==e?void 0:e.value)).length;if(this.allSubpageVisible=e===this.numberOfItems,!0!==this.allSubpageVisible&&(this.scrollToMiddleRange(),!0===this.centerItems)){const{scrollWidth:e,offsetWidth:t,scrollHeight:i,offsetHeight:s}=this._elContainer;this.scrollbarDimension="horizontal"===this.orientation?Math.floor(t/e*100):Math.floor(s/i*100),this.checkCenterItems()}}getFirstChild(){var e,t;return Number(null==(t=null==(e=this._elContainer.firstElementChild)?void 0:e.getAttribute("id"))?void 0:t.replace(this.getCrId()+"-",""))}getLastChild(){var e,t;return Number(null==(t=null==(e=this._elContainer.lastElementChild)?void 0:e.getAttribute("id"))?void 0:t.replace(this.getCrId()+"-",""))}scrollToRightEdgeRange(){let e=0;for(let t=this.getFirstChild();t<=this.getLastChild();t++)!1===this.showSignalHolder[t].value&&(e+=1);let t=0;for(;0!==e&&t<e&&0!==this.getFirstChild();)!0===this.showSignalHolder[this.getFirstChild()-1].value&&(t+=1),this.createSubpage(this.getFirstChild()-1,!1)}scrollToMiddleRange(){let e=0;for(let t=this.getFirstChild();t<=this.getLastChild();t++)!1===this.showSignalHolder[t].value&&(e+=1);let t=0;for(;0!==e&&t<e&&0!==this.getFirstChild();)!0===this.showSignalHolder[this.getFirstChild()-1].value&&(t+=1),this.createSubpage(this.getFirstChild()-1,!1);for(;0!==e&&t<e&&this.getLastChild()!==this.numberOfItems-1;)!0===this.showSignalHolder[this.getLastChild()+1].value&&(t+=1),this.createSubpage(this.getLastChild()+1)}scrollToLeftEdgeRange(){let e=0;for(let t=this.getFirstChild();t<=this.getLastChild();t++)!1===this.showSignalHolder[t].value&&(e+=1);let t=0;for(;0!==e&&t<e&&this.getLastChild()!==this.numberOfItems-1;)!0===this.showSignalHolder[this.getLastChild()+1].value&&(t+=1),this.createSubpage(this.getLastChild()+1)}checkCenterItems(){!0===this.centerItems&&(this.scrollbarDimension<100?(this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+"true"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+"false")):(this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+"false"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.CENTER_ITEMS_CLASSLIST_PREFIX+"true")))}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};Ch5SubpageReferenceList.registerCustomElement(),Ch5SubpageReferenceList.registerSignalAttributeTypes();var Ch5TabButton=class e extends Ch5Common{static ELEMENT_NAME="ch5-tab-button";static BUTTON_TYPES=["default","danger","text","warning","info","success","primary","secondary"];static BUTTON_HALIGN_LABEL_POSITIONS=["center","left","right"];static BUTTON_VALIGN_LABEL_POSITIONS=["middle","top","bottom"];static BUTTON_SHAPES=["rounded-rectangle","rectangle","tab"];static BUTTON_ICON_POSITIONS=["first","last","top","bottom"];static ORIENTATION=["horizontal","vertical"];static BUTTON_ICON_URL_FILL_TYPE=["stretch","stretch-aspect","center","tile","initial"];static COMPONENT_DATA={ORIENTATION:{default:e.ORIENTATION[0],values:e.ORIENTATION,key:"orientation",attribute:"orientation",classListPrefix:"--orientation-"},BUTTON_TYPE:{default:e.BUTTON_TYPES[0],values:e.BUTTON_TYPES,key:"buttonType",attribute:"buttonType",classListPrefix:"--button-type-"},BUTTON_HALIGN_LABEL:{default:e.BUTTON_HALIGN_LABEL_POSITIONS[0],values:e.BUTTON_HALIGN_LABEL_POSITIONS,key:"buttonHAlignLabel",attribute:"buttonHAlignLabel",classListPrefix:"--button-halign-label-"},BUTTON_VALIGN_LABEL:{default:e.BUTTON_VALIGN_LABEL_POSITIONS[0],values:e.BUTTON_VALIGN_LABEL_POSITIONS,key:"buttonVAlignLabel",attribute:"buttonVAlignLabel",classListPrefix:"--button-valign-label-"},BUTTON_ICON_POSITION:{default:e.BUTTON_ICON_POSITIONS[0],values:e.BUTTON_ICON_POSITIONS,key:"buttonIconPosition",attribute:"buttonIconPosition",classListPrefix:"--button-icon-position-"},BUTTON_SHAPE:{default:e.BUTTON_SHAPES[0],values:e.BUTTON_SHAPES,key:"buttonShape",attribute:"buttonShape",classListPrefix:"--button-shape-"},BUTTON_ICON_URL_FILL_TYPE:{default:e.BUTTON_ICON_URL_FILL_TYPE[0],values:e.BUTTON_ICON_URL_FILL_TYPE,key:"buttonIconUrlFillType",attribute:"buttonIconUrlFillType",classListPrefix:"--button-icon-url-fill-type-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateselectedbutton:{direction:"state",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:"",name:"indexId",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:3,name:"numberOfItems",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:3,numberProperties:{min:2,max:15,conditionalMin:2,conditionalMax:15,conditionalMinValue:2,conditionalMaxValue:15},isObservableProperty:!0},{default:e.ORIENTATION[0],enumeratedValues:e.ORIENTATION,name:"orientation",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ORIENTATION[0],isObservableProperty:!0},{default:null,enumeratedValues:e.BUTTON_ICON_URL_FILL_TYPE,name:"buttonIconUrlFillType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:e.BUTTON_TYPES[0],enumeratedValues:e.BUTTON_TYPES,name:"buttonType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_TYPES[0],isObservableProperty:!0},{default:e.BUTTON_HALIGN_LABEL_POSITIONS[0],enumeratedValues:e.BUTTON_HALIGN_LABEL_POSITIONS,name:"buttonHAlignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_HALIGN_LABEL_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_VALIGN_LABEL_POSITIONS[0],enumeratedValues:e.BUTTON_VALIGN_LABEL_POSITIONS,name:"buttonVAlignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_VALIGN_LABEL_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_ICON_POSITIONS[0],enumeratedValues:e.BUTTON_ICON_POSITIONS,name:"buttonIconPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_ICON_POSITIONS[0],isObservableProperty:!0},{default:e.BUTTON_SHAPES[0],enumeratedValues:e.BUTTON_SHAPES,name:"buttonShape",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.BUTTON_SHAPES[0],isObservableProperty:!0},{default:!1,name:"buttonSelected",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"buttonPressed",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",name:"buttonIconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonIconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonLabelInnerHtml",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateSelected",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateLabel",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateScriptLabelHtml",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateIconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateIconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonSendEventOnClick",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateShow",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"buttonReceiveStateEnable",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSelectedButton",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"contractName",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"useContractForEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomStyle",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForCustomClass",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForEachButtonSelection",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];primaryCssClass="ch5-tab-button";_ch5Properties;_elContainer={};selectedButton=0;signalNameOnContract={contractName:"",receiveStateCustomClass:"",receiveStateCustomStyle:"",receiveStateEnable:"",receiveStateShow:"",receiveStateSelectedButton:""};debounceButtonDisplay=this.debounce(()=>{this.tabButtonDisplay()},50);set buttonType(e){this._ch5Properties.set("buttonType",e,()=>{this.debounceButtonDisplay()})}get buttonType(){return this._ch5Properties.get("buttonType")}set buttonIconUrlFillType(e){this._ch5Properties.set("buttonIconUrlFillType",e,()=>{this.debounceButtonDisplay()})}get buttonIconUrlFillType(){return this._ch5Properties.get("buttonIconUrlFillType")}set buttonHAlignLabel(e){this._ch5Properties.set("buttonHAlignLabel",e,()=>{this.debounceButtonDisplay()})}get buttonHAlignLabel(){return this._ch5Properties.get("buttonHAlignLabel")}set buttonVAlignLabel(e){this._ch5Properties.set("buttonVAlignLabel",e,()=>{this.debounceButtonDisplay()})}get buttonVAlignLabel(){return this._ch5Properties.get("buttonVAlignLabel")}set buttonIconPosition(e){this._ch5Properties.set("buttonIconPosition",e,()=>{this.debounceButtonDisplay()})}get buttonIconPosition(){return this._ch5Properties.get("buttonIconPosition")}set buttonShape(e){this._ch5Properties.set("buttonShape",e,()=>{this.debounceButtonDisplay()})}get buttonShape(){return this._ch5Properties.get("buttonShape")}set buttonSelected(e){this._ch5Properties.set("buttonSelected",e,()=>{this.debounceButtonDisplay()})}get buttonSelected(){return this._ch5Properties.get("buttonSelected")}set buttonPressed(e){this._ch5Properties.set("buttonPressed",e,()=>{this.debounceButtonDisplay()})}get buttonPressed(){return this._ch5Properties.get("buttonPressed")}set buttonIconClass(e){this._ch5Properties.set("buttonIconClass",e,()=>{this.debounceButtonDisplay()})}get buttonIconClass(){return this._ch5Properties.get("buttonIconClass")}set buttonIconUrl(e){this._ch5Properties.set("buttonIconUrl",e,()=>{this.debounceButtonDisplay()})}get buttonIconUrl(){return this._ch5Properties.get("buttonIconUrl")}set buttonLabelInnerHtml(e){this._ch5Properties.set("buttonLabelInnerHtml",e,()=>{this.debounceButtonDisplay()})}get buttonLabelInnerHtml(){return this._ch5Properties.get("buttonLabelInnerHtml")}set buttonReceiveStateSelected(e){this._ch5Properties.set("buttonReceiveStateSelected",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateSelected(){return this._ch5Properties.get("buttonReceiveStateSelected")}set buttonReceiveStateLabel(e){this._ch5Properties.set("buttonReceiveStateLabel",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateLabel(){return this._ch5Properties.get("buttonReceiveStateLabel")}set buttonReceiveStateScriptLabelHtml(e){this._ch5Properties.set("buttonReceiveStateScriptLabelHtml",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateScriptLabelHtml(){return this._ch5Properties.get("buttonReceiveStateScriptLabelHtml")}set buttonReceiveStateIconClass(e){this._ch5Properties.set("buttonReceiveStateIconClass",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateIconClass(){return this._ch5Properties.get("buttonReceiveStateIconClass")}set buttonReceiveStateIconUrl(e){this._ch5Properties.set("buttonReceiveStateIconUrl",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateIconUrl(){return this._ch5Properties.get("buttonReceiveStateIconUrl")}set buttonSendEventOnClick(e){this._ch5Properties.set("buttonSendEventOnClick",e,()=>{this.debounceButtonDisplay()})}get buttonSendEventOnClick(){return this._ch5Properties.get("buttonSendEventOnClick")}set buttonReceiveStateShow(e){this._ch5Properties.set("buttonReceiveStateShow",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateShow(){return this._ch5Properties.get("buttonReceiveStateShow")}set buttonReceiveStateEnable(e){this._ch5Properties.set("buttonReceiveStateEnable",e,()=>{this.debounceButtonDisplay()})}get buttonReceiveStateEnable(){return this._ch5Properties.get("buttonReceiveStateEnable")}set numberOfItems(e){this._ch5Properties.set("numberOfItems",e,()=>{this.debounceButtonDisplay()})}get numberOfItems(){return this._ch5Properties.get("numberOfItems")}set orientation(e){this._ch5Properties.set("orientation",e,()=>{this.handleOrientation()})}get orientation(){return this._ch5Properties.get("orientation")}set indexId(e){this._ch5Properties.set("indexId",e)}get indexId(){return this._ch5Properties.get("indexId")}set receiveStateSelectedButton(e){this._ch5Properties.set("receiveStateSelectedButton",e,null,e=>{const t=""===this.contractName,i=""!==this.contractName&&!0===this.useContractForEachButtonSelection&&this.receiveStateSelectedButton===this.contractName+".TabSelected";(t||i)&&(this.selectedButton=e,this.handleReceiveStateSelectedButton())})}get receiveStateSelectedButton(){return this._ch5Properties.get("receiveStateSelectedButton")}set contractName(e){this._ch5Properties.set("contractName",e,()=>{this.handleContractName()})}get contractName(){return this._ch5Properties.get("contractName")}set useContractForEnable(e){this._ch5Properties.set("useContractForEnable",e,()=>{this.debounceButtonDisplay()})}get useContractForEnable(){return this._ch5Properties.get("useContractForEnable")}set useContractForShow(e){this._ch5Properties.set("useContractForShow",e,()=>{this.debounceButtonDisplay()})}get useContractForShow(){return this._ch5Properties.get("useContractForShow")}set useContractForCustomStyle(e){this._ch5Properties.set("useContractForCustomStyle",e,()=>{this.debounceButtonDisplay()})}get useContractForCustomStyle(){return this._ch5Properties.get("useContractForCustomStyle")}set useContractForCustomClass(e){this._ch5Properties.set("useContractForCustomClass",e,()=>{this.debounceButtonDisplay()})}get useContractForCustomClass(){return this._ch5Properties.get("useContractForCustomClass")}set useContractForEachButtonSelection(e){this._ch5Properties.set("useContractForEachButtonSelection",e,()=>{this.debounceButtonDisplay()})}get useContractForEachButtonSelection(){return this._ch5Properties.get("useContractForEachButtonSelection")}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}constructor(){super(),this.ignoreAttributes=["receivestateshowpulse","receivestatehidepulse","sendeventonshow"],this.logger.start("constructor()"),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.initCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.nodeName),i!==s){this.logger.log('attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5TabButton),this.checkInternalHTML(),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.debounceButtonDisplay(),customElements.whenDefined(this.nodeName.toLowerCase()).then(()=>{this.componentLoadedEvent(this.nodeName.toLowerCase(),this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners()}removeEventListeners(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}initCssClass(){this.logger.start("UpdateCssClass"),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation),this.logger.stop()}checkInternalHTML(){this._elContainer.parentElement!==this&&(this._elContainer.classList.add(this.nodeName.toLowerCase()),this.appendChild(this._elContainer))}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleOrientation(){Array.from(e.COMPONENT_DATA.ORIENTATION.values).forEach(t=>{this._elContainer.classList.remove(this.nodeName.toLowerCase()+e.COMPONENT_DATA.ORIENTATION.classListPrefix+t)}),this._elContainer.classList.add(this.nodeName.toLowerCase()+e.COMPONENT_DATA.ORIENTATION.classListPrefix+this.orientation)}tabButtonDisplay(){var e,t,i,s,n,r;Array.from(this._elContainer.children).forEach(e=>e.remove()),this.contractDefaultHelper();for(let e=0;e<this.numberOfItems;e++)this.createButton(e);Array.from(this._elContainer.children).forEach(e=>{var t,i;return null==(i=null==(t=e.firstElementChild)?void 0:t.firstElementChild)?void 0:i.classList.add(this.primaryCssClass+"--center-tab-style")}),null==(i=null==(t=null==(e=this._elContainer.firstElementChild)?void 0:e.firstElementChild)?void 0:t.firstElementChild)||i.classList.replace(""+(this.primaryCssClass+"--center-tab-style"),""+(this.primaryCssClass+"--start-tab-style")),null==(r=null==(n=null==(s=this._elContainer.lastElementChild)?void 0:s.firstElementChild)?void 0:n.firstElementChild)||r.classList.replace(""+(this.primaryCssClass+"--center-tab-style"),""+(this.primaryCssClass+"--end-tab-style"))}contractDefaultHelper(){""!==this.contractName&&(!0===this.useContractForEnable&&(this.receiveStateEnable=this.contractName+".Enable"),!0===this.useContractForShow&&(this.receiveStateShow=this.contractName+".Visible"),!0===this.useContractForCustomStyle&&(this.receiveStateCustomStyle=this.contractName+".CustomStyle"),!0===this.useContractForCustomClass&&(this.receiveStateCustomClass=this.contractName+".CustomClass"),!0===this.useContractForEachButtonSelection&&(this.receiveStateSelectedButton=this.contractName+".TabSelected"))}createButton(t,i=!0){var s,n,r,a,l;if(t<0||t>=this.numberOfItems)return;const o={index:t+1,clickHoldTime:0,contractName:this.contractName,parentComponent:"ch5-tab-button"},h=new Ch5Button(o);h.setAttribute("swipeGestureEnabled","true");const c=document.createElement("div");if(c.setAttribute("id",this.getCrId()+"-"+t),!1===(null==(s=this.getAttribute("buttonReceiveStateShow"))?void 0:s.trim().includes(`{{${this.indexId}}}`))){const e=null==(n=this.getAttribute("buttonReceiveStateShow"))?void 0:n.trim();e&&(c.setAttribute("data-ch5-noshow-type","display"),c.setAttribute("data-ch5-show",e.trim()))}else if(this.hasAttribute("buttonReceiveStateShow")&&(null==(r=this.getAttribute("buttonReceiveStateShow"))?void 0:r.trim())){const e=this.replaceAll((null==(a=this.getAttribute("buttonReceiveStateShow"))?void 0:a.trim())+"",`{{${this.indexId}}}`,""),i=/^[0-9]+$/.test(e);c.setAttribute("data-ch5-noshow-type","display"),i?c.setAttribute("data-ch5-show",Number(e)+t+""):c.setAttribute("data-ch5-show",this.replaceAll((null==(l=this.getAttribute("buttonReceiveStateShow"))?void 0:l.trim())+"",`{{${this.indexId}}}`,t+""))}c.classList.add(this.nodeName.toLowerCase()+"--button-container"),c.appendChild(h),i?this._elContainer.appendChild(c):this._elContainer.prepend(c),this.buttonLabelHelper(h,t),this.buttonHelper(h,t),h.addContainerClass(this.nodeName.toLowerCase()+e.COMPONENT_DATA.BUTTON_TYPE.classListPrefix+this.buttonType),h.addContainerClass(this.nodeName.toLowerCase()+e.COMPONENT_DATA.BUTTON_SHAPE.classListPrefix+this.buttonShape),h.addContainerClass(this.nodeName.toLowerCase()+e.COMPONENT_DATA.BUTTON_ICON_POSITION.classListPrefix+this.buttonIconPosition)}buttonLabelHelper(t,i){const s=this.getElementsByTagName(this.nodeName.toLowerCase()+"-label");s&&s.length>0&&Array.from(s).forEach(s=>{if(s.parentElement instanceof e){const e=s.getElementsByTagName("template");if(e&&e.length>0){const s=new Ch5ButtonLabel,n=document.createElement("template");n.innerHTML=e[0].innerHTML,Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(n,i,this.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(n,i,this.indexId),s.appendChild(n),t.appendChild(s)}}})}buttonHelper(t,i){const s=this.getElementsByTagName(this.nodeName.toLowerCase()+"-individual-button"),n=s.length;t.setAttribute("stretch","both"),t.setAttribute("shape",e.BUTTON_SHAPES[0]),e.COMPONENT_PROPERTIES.forEach(e=>{var r,a,l,o,h,c,u,d,m,g,b,p,_,S,C,v,E,f,A,T,O,y,P,N,I,L,w,M,R,B,H,k,V,D;if(i<n){if("buttoniconclass"===e.name.toLowerCase()){if(s[i]&&s[i].hasAttribute("iconclass")){const e=null==(r=s[i].getAttribute("iconclass"))?void 0:r.trim();e&&t.setAttribute("iconclass",e)}else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name)){const s=null==(a=this.getAttribute(e.name))?void 0:a.trim().replace(`{{${this.indexId}}}`,i+"");s&&t.setAttribute(e.name.toLowerCase().replace("button",""),s.trim())}}else if("buttoniconurl"===e.name.toLowerCase()){if(s[i]&&s[i].hasAttribute("iconurl")){const e=null==(l=s[i].getAttribute("iconurl"))?void 0:l.trim();e&&t.setAttribute("iconurl",e)}else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name)){const s=null==(o=this.getAttribute(e.name))?void 0:o.trim().replace(`{{${this.indexId}}}`,i+"");s&&t.setAttribute(e.name.toLowerCase().replace("button",""),s.trim())}}else if("buttonreceivestateselected"===e.name.toLowerCase()){if(""!==this.contractName)!1===this.useContractForEachButtonSelection&&t.setAttribute("receiveStateSelected",this.contractName+`.Tab${i+1}_Selected`),i===this.selectedButton&&!0===this.useContractForEachButtonSelection&&t.setAttribute("selected","true");else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name))if(!1===(null==(h=this.getAttribute(e.name))?void 0:h.trim().includes(`{{${this.indexId}}}`))){const i=null==(c=this.getAttribute(e.name))?void 0:c.trim();i&&t.setAttribute(e.name.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(u=this.getAttribute(e.name))?void 0:u.trim().length)){const s=this.replaceAll((null==(d=this.getAttribute(e.name))?void 0:d.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?t.setAttribute(e.name.toLowerCase().replace("button",""),Number(s)+i+""):t.setAttribute(e.name.toLowerCase().replace("button",""),this.replaceAll((null==(m=this.getAttribute(e.name))?void 0:m.trim())+"",`{{${this.indexId}}}`,i+""))}}else if("buttonsendeventonclick"===e.name.toLowerCase()){if(""!==this.contractName);else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name))if(!1===(null==(g=this.getAttribute(e.name))?void 0:g.trim().includes(`{{${this.indexId}}}`))){const i=null==(b=this.getAttribute(e.name))?void 0:b.trim();i&&t.setAttribute(e.name.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(p=this.getAttribute(e.name))?void 0:p.trim().length)){const s=this.replaceAll((null==(_=this.getAttribute(e.name))?void 0:_.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?t.setAttribute(e.name.toLowerCase().replace("button",""),Number(s)+i+""):t.setAttribute(e.name.toLowerCase().replace("button",""),this.replaceAll((null==(S=this.getAttribute(e.name))?void 0:S.trim())+"",`{{${this.indexId}}}`,i+""))}}else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name))if(!1===(null==(C=this.getAttribute(e.name))?void 0:C.trim().includes(`{{${this.indexId}}}`))){const i=null==(v=this.getAttribute(e.name))?void 0:v.trim();i&&t.setAttribute(e.name.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(E=this.getAttribute(e.name))?void 0:E.trim().length)){const s=this.replaceAll((null==(f=this.getAttribute(e.name))?void 0:f.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?t.setAttribute(e.name.toLowerCase().replace("button",""),Number(s)+i+""):t.setAttribute(e.name.toLowerCase().replace("button",""),this.replaceAll((null==(A=this.getAttribute(e.name))?void 0:A.trim())+"",`{{${this.indexId}}}`,i+""))}}else if("buttonreceivestateselected"===e.name.toLowerCase()){if(""!==this.contractName)t.setAttribute("receiveStateSelected",this.contractName+`.Tab${i+1}_Selected`);else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name))if(!1===(null==(T=this.getAttribute(e.name))?void 0:T.trim().includes(`{{${this.indexId}}}`))){const i=null==(O=this.getAttribute(e.name))?void 0:O.trim();i&&t.setAttribute(e.name.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(y=this.getAttribute(e.name))?void 0:y.trim().length)){const s=this.replaceAll((null==(P=this.getAttribute(e.name))?void 0:P.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?t.setAttribute(e.name.toLowerCase().replace("button",""),Number(s)+i+""):t.setAttribute(e.name.toLowerCase().replace("button",""),this.replaceAll((null==(N=this.getAttribute(e.name))?void 0:N.trim())+"",`{{${this.indexId}}}`,i+""))}}else if("buttonsendeventonclick"===e.name.toLowerCase()){if(""!==this.contractName);else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name))if(!1===(null==(I=this.getAttribute(e.name))?void 0:I.trim().includes(`{{${this.indexId}}}`))){const i=null==(L=this.getAttribute(e.name))?void 0:L.trim();i&&t.setAttribute(e.name.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(w=this.getAttribute(e.name))?void 0:w.trim().length)){const s=this.replaceAll((null==(M=this.getAttribute(e.name))?void 0:M.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?t.setAttribute(e.name.toLowerCase().replace("button",""),Number(s)+i+""):t.setAttribute(e.name.toLowerCase().replace("button",""),this.replaceAll((null==(R=this.getAttribute(e.name))?void 0:R.trim())+"",`{{${this.indexId}}}`,i+""))}}else if(e.name.toLowerCase().startsWith("button")&&this.hasAttribute(e.name))if(!1===(null==(B=this.getAttribute(e.name))?void 0:B.trim().includes(`{{${this.indexId}}}`))){const i=null==(H=this.getAttribute(e.name))?void 0:H.trim();i&&t.setAttribute(e.name.toLowerCase().replace("button",""),i.trim())}else if(0!==(null==(k=this.getAttribute(e.name))?void 0:k.trim().length)){const s=this.replaceAll((null==(V=this.getAttribute(e.name))?void 0:V.trim())+"",`{{${this.indexId}}}`,"");/^[0-9]+$/.test(s)?t.setAttribute(e.name.toLowerCase().replace("button",""),Number(s)+i+""):t.setAttribute(e.name.toLowerCase().replace("button",""),this.replaceAll((null==(D=this.getAttribute(e.name))?void 0:D.trim())+"",`{{${this.indexId}}}`,i+""))}}),(""!==this.receiveStateSelectedButton.trim()&&""===this.contractName||""!==this.contractName&&!0===this.useContractForEachButtonSelection&&this.receiveStateSelectedButton===this.contractName+".TabSelected")&&(t.removeAttribute("receiveStateSelected"),t.removeAttribute("selected"),this.selectedButton===i&&t.setAttribute("selected","true"));["onRelease","labelInnerHTML"].forEach(e=>{var r;if(i<n&&s[i]&&s[i].hasAttribute(e)){const n=null==(r=s[i].getAttribute(e))?void 0:r.trim();n&&t.setAttribute(e,n.trim())}})}replaceAll(e,t,i){return e&&""!==String(e).trim()?String(e).split(t).join(i):e}handleContractName(){0===this.contractName.length?(this.signalNameOnContract.contractName="",this.receiveStateShow=this.signalNameOnContract.receiveStateShow,this.receiveStateEnable=this.signalNameOnContract.receiveStateEnable,this.receiveStateCustomStyle=this.signalNameOnContract.receiveStateCustomStyle,this.receiveStateCustomClass=this.signalNameOnContract.receiveStateCustomClass,this.receiveStateSelectedButton=this.signalNameOnContract.receiveStateSelectedButton):""===this.signalNameOnContract.contractName&&(this.signalNameOnContract.contractName=this.contractName,this.signalNameOnContract.receiveStateShow=this.receiveStateShow,this.signalNameOnContract.receiveStateEnable=this.receiveStateEnable,this.signalNameOnContract.receiveStateCustomStyle=this.receiveStateCustomStyle,this.signalNameOnContract.receiveStateCustomClass=this.receiveStateCustomClass,this.signalNameOnContract.receiveStateSelectedButton=this.receiveStateSelectedButton),this.debounceButtonDisplay()}handleReceiveStateSelectedButton(){Array.from(this._elContainer.children).forEach(e=>{var t;const i=e.children[0];i.removeAttribute("selected"),Number(null==(t=e.getAttribute("id"))?void 0:t.replace(this.getCrId()+"-",""))===this.selectedButton&&i.setAttribute("selected","true")})}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};Ch5TabButton.registerCustomElement(),Ch5TabButton.registerSignalAttributeTypes();var Ch5TabButtonLabel=class e extends Ch5ButtonListLabelBase{static ELEMENT_NAME="ch5-tab-button-label";static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}connectedCallback(){if(!(this.parentElement instanceof Ch5TabButton))throw new Error(`Invalid parent element for ${e.ELEMENT_NAME}.`);super.connectedCallback()}};Ch5TabButtonLabel.registerCustomElement();import _36 from"lodash";var Ch5TabButtonIndividualButton=class e extends Ch5Log{static COMPONENT_PROPERTIES=[{default:"",name:"labelInnerHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"onRelease",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-tab-button-individual-button";primaryCssClass="ch5-tab-button-individual-button";_ch5Properties;_parentCh5TabButton=null;set parentComponent(e){this._parentCh5TabButton=e}get parentComponent(){return this._parentCh5TabButton}set labelInnerHTML(e){this._ch5Properties.set("labelInnerHTML",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get labelInnerHTML(){return this._ch5Properties.get("labelInnerHTML")}set iconUrl(e){this._ch5Properties.set("iconUrl",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconUrl(){return this._ch5Properties.get("iconUrl")}set iconClass(e){this._ch5Properties.set("iconClass",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get iconClass(){return this._ch5Properties.get("iconClass")}set onRelease(e){this._ch5Properties.set("onRelease",e,()=>{this.parentComponent&&this.parentComponent.debounceButtonDisplay()})}get onRelease(){return this._ch5Properties.get("onRelease")}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()"),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}static get observedAttributes(){const t=Ch5Log.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback"),i!==s){this.logger.log(this.nodeName+' attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){var e;this.logger.start("connectedCallback()");const t=this.getParentButton();if(_36.isNil(t)||"CH5-TAB-BUTTON"!==(null==(e=this.parentElement)?void 0:e.nodeName.toString().toUpperCase()))throw new Error("Invalid parent element for ch5-tab-button-individual-button.");this.setAttribute("role",Ch5RoleAttributeMapping.ch5TabButtonIndividualButton),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.parentComponent=t,this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}getParentButton(){const e=t=>_36.isNil(t)||"CH5-TAB-BUTTON"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}};Ch5TabButtonIndividualButton.registerCustomElement();import{isEmpty as isEmpty7,isNil as isNil19}from"lodash";var Ch5TemplateStructure=class e{static _numInstances={};_element={};_templateElement={};_wrapperDiv={};_instanceId=null;_elementIds=null;static nextInstanceNum(t){const i=e._numInstances[t],s=void 0===i?1:i+1;return e._numInstances[t]=s,s}constructor(e){this.element=e,this.templateElement=document.querySelector("template")}set element(e){isNil19(e)||(this._element=e)}get element(){return this._element}set templateElement(e){isNil19(e)||(this._templateElement=e)}get templateElement(){return this._templateElement}get instanceId(){return this._instanceId}get elementIds(){return this._elementIds}initializeWrapperDiv(){this._wrapperDiv=document.createElement("DIV"),this._wrapperDiv.classList.add("ch5-template-content-wrapper")}getTemplateContent(e){let t;if(this.initializeWrapperDiv(),isNil19(this.templateElement.firstElementChild)){if(isNil19(this.templateElement.content.firstElementChild))throw new Error(`[ch5-template] Error: The provided template with the id: "${e}" has no content`);if(!this.templateElement.content.children[0].classList.contains("ch5-template-content-wrapper")){for(;this.templateElement.content.children.length>0;)this._wrapperDiv.appendChild(this.templateElement.content.children[0]);this.templateElement.content.appendChild(this._wrapperDiv)}t=this.templateElement.content.firstElementChild.cloneNode(!0)}else{if(!this.templateElement.children[0].classList.contains("ch5-template-content-wrapper")){for(;this.templateElement.children.length>0;)this._wrapperDiv.appendChild(this.templateElement.children[0]);this.templateElement.appendChild(this._wrapperDiv)}t=this.templateElement.firstElementChild.cloneNode(!0)}return t}generateTemplate(t,i){if(this.element.info(`Ch5TemplateStructure.generateTemplate(templateId: ${t}, context: ${i})`),isEmpty7(t))throw new Error("[ch5-template] Error: No templateId was provided");const s=document.getElementById(t);let n=null;if(isNil19(s))throw new Error(`[ch5-template] Error: No template with the id: "${t}" found`);this.templateElement=s,this.element.info("Ch5TemplateStructure --- the following template will be used:",this.templateElement);let r=[];isEmpty7(i)?this.element.info("Context attribute is empty, nothing will be renamed"):(r=i.split(";"),this.element.info(`Parsed context attribute: ${r}`));const a=this.getTemplateContent(t);if(!isNil19(a))try{if(this.element.info("Ch5TemplateStructure.generateTemplate() --- Copying attributes"),!isNil19(a)){let e=a.innerHTML;this.element.info("Original template inner HTML before rename: ",e);for(let t=0;t<r.length;t++){const i=r[t].split(":");if(this.element.info(`Processing original:replacement pair: ${i}`),2!==i.length||isEmpty7(i[0])||isEmpty7(i[1])){console.warn(`[ch5-template] Warning: Invalid context pair structure, expected: "original:replacement", but received "${i}", moving to the next context pair`);continue}i[0]=i[0].trim(),this.element.info(`Ch5TemplateStructure --- Count: [${t+1}/${i.length}] \n Replace original string: ${i[0]} \n with provided replacement string: ${i[1]}`);const s=new RegExp(i[0],"g");e=e.replace(s,i[1])}a.innerHTML=e,Ch5AugmentVarSignalsNames.differentiateTmplElemsAttrs(a,this.element.contractName,parseInt(this.element.booleanJoinOffset,10)||0,parseInt(this.element.numericJoinOffset,10)||0,parseInt(this.element.stringJoinOffset,10)||0),this.element.isDebug()&&this.element.info("After substitution and increment/prefix:",a.innerHTML)}!isNil19(this.element.children)&&this.element.children.length>0&&(this.element.info("Ch5TemplateStructure --- Removing children of: ",this.element),Array.from(this.element.children).forEach(e=>e.remove())),isNil19(this.element)||(n=this.element.appendChild(a))}catch(e){throw new Error(`[ch5-template] Error: Failed to generate content: ${e}`)}finally{if(null!==n&&n.children){const i=e.nextInstanceNum(t);this._instanceId=`${t}:${i}`,n.id=this._instanceId,this._elementIds=[];for(let e=0;e<n.children.length;e++)n.children[e].id||(n.children[e].id=`${this._instanceId}:${e}`),this._elementIds.push(n.children[e].id);this.element.info(`Ch5TemplateStructure --- [FINAL] Adding content to ChTemplate: ${this._instanceId}`,n),this.element=n}}}};import{Subject as Subject6}from"rxjs";var ch5TemplateSubject=new Subject6,refreshCh5Template=e=>{ch5TemplateSubject.next(e)},Ch5Template=class e extends Ch5Common{static TRANSITIONINTYPE=["bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp","fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","flipInX","flipInY","lightSpeedIn","rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight","rollIn","zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp","slideInDown","slideInLeft","slideInRight","slideInUp"];static TRANSITIONOUTTYPE=["bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp","fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig","flipOutX","flipOutY","lightSpeedOut","rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight","rollOut","zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp","slideOutDown","slideOutLeft","slideOutRight","slideOutUp"];static CH5_TEMPLATE_STYLE_CLASS="ch5-template";static ELEMENT_NAME="ch5-template";_ch5Properties;static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static COMPONENT_PROPERTIES=[{default:null,enumeratedValues:e.TRANSITIONINTYPE,name:"transitionIn",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:null,enumeratedValues:e.TRANSITIONOUTTYPE,name:"transitionOut",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:"1s",name:"transitionDuration",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"0s",name:"transitionDelay",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];_templateId="";firstLoad=!1;_context="";_contractName="";_booleanJoinOffset="";_numericJoinOffset="";_stringJoinOffset="";_templateHelper={};_refreshSubId=null;static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=["templateid","context","contractname","booleanjoinoffset","numericjoinoffset","stringjoinoffset"];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return i.concat(t)}set templateId(e){this._templateId!==e&&(this._templateId=e,this.setAttribute("templateid",e.toString()))}get templateId(){return this._templateId}set context(e){this._context!==e&&(this._context=e,this.setAttribute("context",e.toString()))}get context(){return this._context}set contractName(e){this._contractName!==e&&(this._contractName=e,this.setAttribute("contractname",e))}get contractName(){return this._contractName}set booleanJoinOffset(e){this._booleanJoinOffset!==e&&(this._booleanJoinOffset=e,this.setAttribute("booleanjoinoffset",e))}get booleanJoinOffset(){return this._booleanJoinOffset}set numericJoinOffset(e){this._numericJoinOffset!==e&&(this._numericJoinOffset=e,this.setAttribute("numericjoinoffset",e))}get numericJoinOffset(){return this._numericJoinOffset}set stringJoinOffset(e){this._stringJoinOffset!==e&&(this._stringJoinOffset=e,this.setAttribute("stringjoinoffset",e))}get stringJoinOffset(){return this._stringJoinOffset}set transitionIn(e){this._ch5Properties.set("transitionIn",e)}get transitionIn(){return this._ch5Properties.get("transitionIn")}set transitionOut(e){this._ch5Properties.set("transitionOut",e)}get transitionOut(){return this._ch5Properties.get("transitionOut")}set transitionDuration(e){this._ch5Properties.set("transitionDuration",e)}get transitionDuration(){return this._ch5Properties.get("transitionDuration")}set transitionDelay(e){this._ch5Properties.set("transitionDelay",e)}get transitionDelay(){return this._ch5Properties.get("transitionDelay")}constructor(){super(),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES)}connectedCallback(){this.info("Ch5Template.connectedCallback()"),this.firstLoad=!0,Promise.all([customElements.whenDefined("ch5-template")]).then(()=>{this.initializations(),this.info("Ch5Template --- Callback loaded"),this._templateHelper&&this._templateHelper.instanceId&&(publishEvent("object",`ch5-template:${this._templateId}`,{loaded:!0,id:this._templateHelper.instanceId,elementIds:this._templateHelper.elementIds}),this.addEventListener("animationend",this.animationend),this.classList.remove("inline-element","visible-element"))}),this.listenForCh5TemplateRefreshRequests()}listenForCh5TemplateRefreshRequests(){this.info("Ch5Template.listenForCh5TemplateRefreshRequests()"),this._refreshSubId=ch5TemplateSubject.subscribe(e=>{this.info(`Ch5Template.listenForCh5TemplateRefreshRequests() new request for ${e}`),this.shouldRefresh(e)&&this.initializations(!0)})}shouldRefresh(e){return this.info(`Ch5Template.shouldRefresh() got called for id ${e}`),this.getAttribute("templateId")===e}initAttributes(){super.initAttributes(),this.info("Ch5Template.initAttributes()");const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this.hasAttribute("templateid")&&(this.templateId=this.getAttribute("templateid")),this.hasAttribute("context")&&(this.context=this.getAttribute("context"))}initializations(t){this.info(`Ch5Template.initializations(${!0===t})`),!0!==t&&this._templateHelper&&this._templateHelper.instanceId||(this.classList.add(e.CH5_TEMPLATE_STYLE_CLASS),this.initAttributes(),this._templateHelper=new Ch5TemplateStructure(this),this._templateHelper.generateTemplate(this.templateId,this.context),this.updateAnimateClass(),this.info("Ch5Template --- Initialization Finished"))}attributeChangedCallback(t,i,s){if(i===s)return;const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}switch(this.info(`Ch5Template.attributeChangedCallback("${t}", "${i}", "${s}")`),t){case"templateId":this.templateId=this.getAttribute("templateId");break;case"context":this.context=this.getAttribute("context");break;case"contractname":this.contractName=this.getAttribute("contractname");break;case"booleanjoinoffset":this.booleanJoinOffset=this.getAttribute("booleanjoinoffset");break;case"numericjoinoffset":this.numericJoinOffset=this.getAttribute("numericjoinoffset");break;case"stringjoinoffset":this.stringJoinOffset=this.getAttribute("stringjoinoffset");break;default:super.attributeChangedCallback(t,i,s)}}disconnectedCallback(){this.info("Ch5Template.disconnectedCallback()"),this._templateHelper&&this._templateHelper.instanceId&&publishEvent("object",`ch5-template:${this.templateId}`,{loaded:!1,id:this._templateHelper.instanceId}),this.removeEventListener("animationend",this.animationend),null!==this._refreshSubId&&(this._refreshSubId.unsubscribe(),this._refreshSubId=null)}beforeHandlingShow(){this.firstLoad=!1,this.children&&this.children[0]&&"remove"!==this.noshowType&&(this.hasAttribute("transitionout")&&(this.classList.remove("inline-element","visible-element"),removeTransition(this.children[0],this.transitionOut,"OUT")),this.hasAttribute("transitionin")&&(this.setDurationAndDelay(),setTransition(this.children[0],this.transitionIn,"IN")))}beforeHandlingHide(){this.children&&this.children[0]&&!1===this.firstLoad&&"remove"!==this.noshowType&&(this.hasAttribute("transitionin")&&(this.classList.remove("inline-element","visible-element"),removeTransition(this.children[0],this.transitionIn,"IN")),this.hasAttribute("transitionout")&&(this.setDurationAndDelay(),"display"===this.noshowType?this.classList.add("inline-element"):"visibility"===this.noshowType&&this.classList.add("visible-element"),setTransition(this.children[0],this.transitionOut,"OUT")))}animationend(){this.classList.remove("inline-element")}updateAnimateClass(){this.show&&this.hasAttribute("transitionin")&&this.children&&this.children[0]&&"remove"!==this.noshowType&&(this.setDurationAndDelay(),setTransition(this.children[0],this.transitionIn,"IN"))}setDurationAndDelay(){this.style.setProperty("--animate-duration",this.transitionDuration?this.transitionDuration:"1s"),this.style.setProperty("--animate-delay",this.transitionDelay?this.transitionDelay:"0s")}};Ch5Template.registerCustomElement(),Ch5Template.registerSignalAttributeTypes(),Ch5Template.registerSignalAttributeDefaults(Ch5Template.ELEMENT_NAME);var Ch5Text=class e extends Ch5Common{static HORIZONTAL_ALIGNMENT=["center","left","right"];static VERTICAL_ALIGNMENT=["middle","top","bottom"];static COMPONENT_DATA={HORIZONTAL_ALIGNMENT:{default:e.HORIZONTAL_ALIGNMENT[0],values:e.HORIZONTAL_ALIGNMENT,key:"horizontalAlignment",attribute:"horizontalAlignment",classListPrefix:"--horizontal-alignment-"},VERTICAL_ALIGNMENT:{default:e.VERTICAL_ALIGNMENT[0],values:e.VERTICAL_ALIGNMENT,key:"verticalAlignment",attribute:"verticalAlignment",classListPrefix:"--vertical-alignment-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatelabel:{direction:"state",stringJoin:1,contractName:!0},receivestatescriptlabelhtml:{direction:"state",stringJoin:1,contractName:!0},contractname:{contractName:!0},booleanjoinoffset:{booleanJoin:1},numericjoinoffset:{numericJoin:1},stringjoinoffset:{stringJoin:1}};static COMPONENT_PROPERTIES=[{default:e.HORIZONTAL_ALIGNMENT[0],enumeratedValues:e.HORIZONTAL_ALIGNMENT,name:"horizontalAlignment",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.HORIZONTAL_ALIGNMENT[0],isObservableProperty:!0},{default:e.VERTICAL_ALIGNMENT[0],enumeratedValues:e.VERTICAL_ALIGNMENT,name:"verticalAlignment",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.VERTICAL_ALIGNMENT[0],isObservableProperty:!0},{default:!1,name:"multilineSupport",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"truncateText",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",name:"label",nameForSignal:"receiveStateLabel",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateLabel",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateScriptLabelHtml",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelInnerHtml",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-text";primaryCssClass="ch5-text";_ch5Properties;_elContainer={};_elSpan={};templateElement={};scriptLabelHtml="";set horizontalAlignment(e){this._ch5Properties.set("horizontalAlignment",e,()=>{this.handleHorizontalAlignment()})}get horizontalAlignment(){return this._ch5Properties.get("horizontalAlignment")}set verticalAlignment(e){this._ch5Properties.set("verticalAlignment",e,()=>{this.handleVerticalAlignment()})}get verticalAlignment(){return this._ch5Properties.get("verticalAlignment")}set multilineSupport(e){this._ch5Properties.set("multilineSupport",e,()=>{this.debounceHandleMultilineSupport()})}debounceHandleMultilineSupport=this.debounce(()=>{this.handleMultilineSupport()},150);get multilineSupport(){return this._ch5Properties.get("multilineSupport")}set truncateText(e){this._ch5Properties.set("truncateText",e,()=>{this.handleTruncateText()})}get truncateText(){return this._ch5Properties.get("truncateText")}set label(e){this._ch5Properties.set("label",e,()=>{this.label=this._getTranslatedValue("label",this.label),this.handleLabel()})}get label(){return this._ch5Properties.get("label")}set receiveStateLabel(e){this._ch5Properties.set("receiveStateLabel",e,null,e=>{this._ch5Properties.setForSignalResponse("label",e,()=>{this.handleLabel()})})}get receiveStateLabel(){return this._ch5Properties.get("receiveStateLabel")}set labelInnerHtml(e){this._ch5Properties.set("labelInnerHtml",e,()=>{this.handleLabel()})}get labelInnerHtml(){return this._ch5Properties.get("labelInnerHtml")}set receiveStateScriptLabelHtml(e){this._ch5Properties.set("receiveStateScriptLabelHtml",e,null,e=>{this.scriptLabelHtml=e,this.handleLabel()})}get receiveStateScriptLabelHtml(){return this._ch5Properties.get("receiveStateScriptLabelHtml")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=["appendclasswheninviewport","receivestateshowpulse","receivestatehidepulse","sendeventonshow"],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-text attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),subscribeInViewPortChange(this,()=>{this.elementIsInViewPort&&this.debounceHandleMultilineSupport()}),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Text),this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-text"),this.appendChild(this._elContainer)),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),customElements.whenDefined("ch5-text").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id),this.handleLabel(),Ch5AugmentVarSignalsNames.differentiateTmplElemsAttrs(this,this.getAttribute("contractname")||"",parseInt(this.getAttribute("booleanjoinoffset")||"0",10)||0,parseInt(this.getAttribute("numericjoinoffset")||"0",10)||0,parseInt(this.getAttribute("stringjoinoffset")||"0",10)||0)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._elSpan=document.createElement("span"),this._elSpan.classList.add(this.primaryCssClass+"--span"),this._elContainer.appendChild(this._elSpan),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),resizeObserver(this._elContainer,this.onWindowResizeHandler.bind(this))}removeEventListeners(){super.removeEventListeners()}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleHorizontalAlignment(){Array.from(e.COMPONENT_DATA.HORIZONTAL_ALIGNMENT.values).forEach(t=>{this._elSpan.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.HORIZONTAL_ALIGNMENT.classListPrefix+t)}),this._elSpan.classList.add(this.primaryCssClass+e.COMPONENT_DATA.HORIZONTAL_ALIGNMENT.classListPrefix+this.horizontalAlignment)}handleVerticalAlignment(){Array.from(e.COMPONENT_DATA.VERTICAL_ALIGNMENT.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.VERTICAL_ALIGNMENT.classListPrefix+t)}),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.VERTICAL_ALIGNMENT.classListPrefix+this.verticalAlignment)}handleMultilineSupport(){["true","false"].forEach(e=>{this._elSpan.classList.remove(this.primaryCssClass+"--multiline-support-"+e)}),this._elSpan.classList.add(this.primaryCssClass+"--multiline-support-"+this.multilineSupport.toString()),this.multilineSupport&&this.fitEllipsisForMultiline()}handleTruncateText(){["true","false"].forEach(e=>{this._elSpan.classList.remove(this.primaryCssClass+"--truncate-text-"+e)}),this._elSpan.classList.add(this.primaryCssClass+"--truncate-text-"+this.truncateText.toString()),this.multilineSupport?this.fitEllipsisForMultiline():(this._elSpan.style.removeProperty("word-wrap"),this._elSpan.style.removeProperty("display"),this._elSpan.style.removeProperty("max-height"))}handleLabel(){if(this.templateElement instanceof HTMLTemplateElement||(this.templateElement=this.getElementsByTagName("template")[0]),Array.from(this._elSpan.children).forEach(e=>e.remove()),this._elSpan.innerText="",null!==this.receiveStateScriptLabelHtml&&""!==this.receiveStateScriptLabelHtml.trim())this._elSpan.innerHTML=this.decodeInnerHTMLForAttribute(this.scriptLabelHtml);else if(null!==this.receiveStateLabel&&""!==this.receiveStateLabel.trim())this._elSpan.innerText=this.label;else if(Ch5Common.isNotNil(this.labelInnerHtml))this._elSpan.innerHTML=this.decodeInnerHTMLForAttribute(this.labelInnerHtml);else if(this.templateElement instanceof HTMLTemplateElement){const e=document.createElement("template");e.innerHTML=this.templateElement.innerHTML,this._elSpan.appendChild(e.content)}else this._elSpan.innerText=this.label}decodeInnerHTMLForAttribute(e){return e.replace("&","&").replace("<","<").replace(">",">").replace(""",'/"').replace("'","/'")}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this._elSpan.classList.add(this.primaryCssClass+e.COMPONENT_DATA.HORIZONTAL_ALIGNMENT.classListPrefix+this.horizontalAlignment),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.VERTICAL_ALIGNMENT.classListPrefix+this.verticalAlignment),this._elSpan.classList.add(this.primaryCssClass+"--multiline-support-"+this.multilineSupport.toString()),this._elSpan.classList.add(this.primaryCssClass+"--truncate-text-"+this.truncateText.toString()),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}fitEllipsisForMultiline(){let e=0;const t=this.getLineHeightSuper(this._elSpan),i=this.getContainerHeight(this._elContainer)-20;e=i<t?1:Math.floor(i/t),this.truncateText?this._elSpan.setAttribute("style","-webkit-line-clamp:"+e):this._elSpan.setAttribute("style","max-height: "+e*t+"px;")}getLineHeight(e){return window.getComputedStyle(e).lineHeight}getLineHeightSuper(e){const t=e.innerHTML;e.innerHTML=" ";const i=e.offsetHeight;return e.innerHTML=t,i}getContainerHeight(e){return e.clientHeight}onWindowResizeHandler(){this.debounceHandleMultilineSupport()}};Ch5Text.registerCustomElement(),Ch5Text.registerSignalAttributeTypes(),Ch5Text.registerSignalAttributeDefaults(Ch5Text.ELEMENT_NAME);var Ch5TextInputMask=class{_didMounted=!1;_wasWrapped=!1;_wrapperId=0;_maskValue="";_lastValueLength=0;_alwaysShow=!1;_show=!1;_placeholder="";_input={};_maskElement={};set didMounted(e){this._didMounted=e}get didMounted(){return this._didMounted}set wasWrapped(e){this._wasWrapped=e}get wasWrapped(){return this._wasWrapped}set wrapperId(e){this._wrapperId=e}get wrapperId(){return this._wrapperId}set input(e){this._input=e}get input(){return this._input}set maskElement(e){this._maskElement=e}get maskElement(){return this._maskElement}set maskValue(e){this._maskValue=e}get maskValue(){return this._maskValue}set lastValueLength(e){this._lastValueLength=e}get lastValueLength(){return this._lastValueLength}set alwaysShow(e){this._alwaysShow=e}get alwaysShow(){return this._alwaysShow}set show(e){this._show=e,0===this.input.value.length&&(this.maskElement.style.zIndex=!0===this.show?"99":"-1")}get show(){return this._show}set placeholder(e){this._placeholder=e}get placeholder(){return this._placeholder}prefix="ch5-textinput-mask";BLOCK_SEPARATOR="--";constructor(e,t,i=!1){this.wrapperId=Math.random()*(new Date).getTime(),this.input=e,this.maskValue=t,this.alwaysShow=i,this._cleanTheInput()}init(){this.wasWrapped||this.didMounted||this._wrap(),!1===this.alwaysShow?this.show=!1:this.show=!0,this._attachEventListeners()}stop(){this._detachEventListeners()}dispatchMaskErrorEvent(e="invalidCharacter"){"invalidCharacter"!==e&&(e="invalidLength");const t=this._createInputMaskErrorEvent(e);this.input.dispatchEvent(t),this.maskElement.dispatchEvent(t),this.input.setCustomValidity(e)}dispatchMaskUpdateEvent(){const e=this._createMaskUpdateEvent(this.input.value);this.maskElement.dispatchEvent(e),this.input.dispatchEvent(e)}dispatchMaskCompleteEvent(){const e=this._createInputMaskCompleteEvent();this.maskElement.dispatchEvent(e),this.input.dispatchEvent(e),this.input.setCustomValidity("")}_makeMaskElementLookAsInputPlaceholder(){this.maskElement.style.lineHeight=window.getComputedStyle(this.input).lineHeight}addStaticCharactersToInputValue(e){const t=""!==this.maskValue.substr(e,1)?this.maskValue.substr(e,1):null;this._isUserTyping()&&null!==t&&null!==t.match(/[-_#().,\\/=@$&\s+]/g)&&(this.dispatchMaskUpdateEvent(),this.input.value=this.input.value+t,this.lastValueLength++,this.addStaticCharactersToInputValue(++e))}_updateCharactersInMask(){const e=this.lastValueLength-1,t=void 0!==this.maskElement.childNodes[e]?this.maskElement.childNodes[e]:null;let i={};if((void 0!==t||null!==t)&&e<this.maskValue.length){let t;t=!0===this._isUserTyping()&&this.input.value.length>0?this.input.value.substr(e,1):this.maskValue.substr(e,1),i=this.maskElement.childNodes[e],void 0!==i&&(i.innerHTML=t)}}togglePlaceholder(){!1===this.alwaysShow&&(!1===this.show?this.input.setAttribute("placeholder",this.placeholder):this.input.removeAttribute("placeholder"))}_attachEventListeners(){this.input.addEventListener("keydown",this._onInputKeyDown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("keyup",this._onInputKeyUp),this.input.addEventListener("focus",this._onInputFocus),this.input.addEventListener("blur",this._onInputBlur),this.maskElement.addEventListener("update",this._onMaskUpdate)}_detachEventListeners(){this.input.removeEventListener("keydown",this._onInputKeyDown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("keyup",this._onInputKeyUp),this.input.removeEventListener("focus",this._onInputFocus),this.input.removeEventListener("blur",this._onInputBlur),this.maskElement.removeEventListener("update",this._onMaskUpdate)}_mount(e){this._createTheMaskElement(),Array.from(e.children).forEach(e=>{e.classList.contains(this.prefix)&&e.remove()}),e.appendChild(this.maskElement),this.didMounted=!0}_wrap(){var e;let t;(null==(e=this.input.parentElement)?void 0:e.classList.contains("ch5-textinput--mask-wrapper-element"))?(t=this.input.parentElement,t.id="ch5-textinput"+this.BLOCK_SEPARATOR+this.wrapperId):(t=this._input.parentNode.appendChild(this._createTheWrapper()),t.appendChild(this.input)),this._mount(t),this._makeMaskElementLookAsInputPlaceholder(),this.wasWrapped=!0}_createTheWrapper(){const e=document.createElement("span");return e.classList.add("ch5-textinput--mask-wrapper-element"),e.id="ch5-textinput"+this.BLOCK_SEPARATOR+this.wrapperId,e}_createTheMaskElement(){const e=this._wrapEachCharacter();this.maskElement=document.createElement("span"),this.maskElement.setAttribute("data-mask",this.maskValue),this.maskElement.classList.add(this.prefix),this.maskElement.innerHTML=e}_cleanTheInput(){!0===this.alwaysShow&&this.input.hasAttribute("placeholder")&&this.input.removeAttribute("placeholder"),this.input.hasAttribute("pattern")&&this.input.removeAttribute("pattern")}_wrapEachCharacter(){const e=this.maskValue.split("");return e.forEach((t,i)=>{e[i]='<span class="'+this.prefix+this.BLOCK_SEPARATOR+'letter">'+t+"</span>"}),e.join("")}_createMaskUpdateEvent(e){return new CustomEvent("update",{detail:{message:e,time:(new Date).getTime()},bubbles:!0,cancelable:!0})}_createInputMaskErrorEvent(e){return new CustomEvent("maskerror",{detail:{errorType:e,time:(new Date).getTime()},bubbles:!0,cancelable:!1})}_createInputMaskCompleteEvent(){return new CustomEvent("maskcomplete",{detail:{message:"completed",time:(new Date).getTime()},bubbles:!0,cancelable:!0})}_maskCharacterOnTyping(e){e>this.maskValue.length&&(e=this.maskValue.length);const t=this.maskElement.childNodes,i=void 0!==t[e]?t[e]:null;null!==i&&(i.style.visibility="hidden",this._maskCharacterOnTyping(--e))}_unmaskCharacterOnTyping(e){e>this.maskValue.length&&(e=this.maskValue.length);const t=this.maskElement.childNodes,i=void 0!==t[e]?t[e]:null;null!==i&&e>=this.input.value.length&&(i.style.visibility="visible"),e>=0&&this._unmaskCharacterOnTyping(--e)}_isUserTyping(){return!(this.input.value.length<this.lastValueLength)}_isKeyAllowed(e){if(""!==this.maskValue.substr(this.input.value.length-1,1)){const t=this.maskValue.substr(this.input.value.length-1,1);let i=e;if(null!==t.match(/[^a-zA-Z0-9*]/g))return!1;if(!1===isNaN(parseFloat(e))&&"*"!==t&&(i=parseFloat(e)),null!==String(i).match(/[^a-zA-Z0-9]/g)||typeof i!==this._getDataType(t))return this.input.value.length>0&&this.dispatchMaskErrorEvent(),!1}return!0}_isValueLengthValid(){return this.lastValueLength<this.maskValue.length?(this.lastValueLength>0?this.dispatchMaskErrorEvent("invalidLength"):this.input.setCustomValidity(""),!0):(this.lastValueLength>0&&this.dispatchMaskCompleteEvent(),!1)}_getDataType(e){let t;switch(e){case"A":case"a":default:t="string";break;case"9":t="number"}return t}_getCapsType(e){if(null!==e&&"*"!==e){if(e===e.toUpperCase())return"uppercase";if(e===e.toLowerCase())return"lowercase"}return"normal"}_transformLetterCapsType(e){e>this.maskValue.length-1&&(e=this.maskValue.length-1);const t=""!==this.maskValue.substr(e,1)?this.maskValue.substr(e,1):null,i=this.input.value.split("")[e],s=this.maskElement.childNodes[e];if(null!==t&&void 0!==i){const n=this._getCapsType(t),r=this._getCapsType(i),a=this.input.value.substr(0,e),l=this.input.value.substr(e,1),o=this.input.value.substr(e+1);"uppercase"===n&&"uppercase"!==r?(this.input.value=a+l.toUpperCase()+o,s.innerHTML=l.toUpperCase()):"lowercase"===n&&"lowercase"!==r&&(this.input.value=a+l.toLowerCase()+o,s.innerHTML=l.toLowerCase()),this._transformLetterCapsType(--e)}}_onInputKeyDown=e=>{this._isUserTyping()&&this.addStaticCharactersToInputValue(this.input.value.length),this.lastValueLength=this.input.value.length,null!==this.input.selectionStart&&this.input.selectionStart<this.lastValueLength&&e.preventDefault()};_onInput=e=>{let t=e.data;if(null!==t&&t.length>1){const e=t.split("");t=e[e.length-1]}!this._isUserTyping()||this._isKeyAllowed(t)&&this._isValueLengthValid()?(this.dispatchMaskUpdateEvent(),this._updateCharactersInMask()):this.input.value=this.input.value.substr(0,this.lastValueLength),this._isUserTyping()&&(this.lastValueLength=this.input.value.length)};_onInputKeyUp=e=>{this._isKeyAllowed(e.key),this._isValueLengthValid(),this._transformLetterCapsType(this.input.value.length)};_onInputFocus=()=>{!1===this.alwaysShow&&(this.show=!0,this.togglePlaceholder())};_onInputBlur=()=>{!1===this.alwaysShow&&(this.show=!1,this.togglePlaceholder()),0===this.input.value.length&&(this.lastValueLength=0),this._transformLetterCapsType(this.input.value.length),this._isValueLengthValid()};_onMaskUpdate=()=>{this._isUserTyping()?this._maskCharacterOnTyping(this.lastValueLength):this._unmaskCharacterOnTyping(this.lastValueLength)}},Ch5TextInput=class e extends Ch5CommonInput{static ICON_POSITION=["first","last"];static INPUT_TYPE=["text","number","email","password"];static SIZE=["regular","x-small","small","large","x-large"];static STRETCH=["fixed","width","content"];static TEXT_TRANSFORM=["none","capitalize","uppercase","lowercase"];static COMPONENT_DATA={ICON_POSITION:{default:e.ICON_POSITION[0],values:e.ICON_POSITION,key:"iconPosition",attribute:"iconPosition",classListPrefix:"--icon-position-"},INPUT_TYPE:{default:e.INPUT_TYPE[0],values:e.INPUT_TYPE,key:"type",attribute:"type",classListPrefix:"--input-type-"},SIZE:{default:e.SIZE[0],values:e.SIZE,key:"size",attribute:"size",classListPrefix:"--size-"},STRETCH:{default:e.STRETCH[0],values:e.STRETCH,key:"stretch",attribute:"stretch",classListPrefix:"-container--stretch-"},TEXT_TRANSFORM:{default:e.TEXT_TRANSFORM[0],values:e.TEXT_TRANSFORM,key:"text-transform",attribute:"text-transform",classListPrefix:"--text-transform-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatefocus:{direction:"state",booleanJoin:1,contractName:!0},receivestatevalue:{direction:"state",stringJoin:1,contractName:!0},sendeventonchange:{direction:"event",stringJoin:1,contractName:!0},sendeventonfocus:{direction:"event",stringJoin:1,contractName:!0},sendeventonblur:{direction:"event",stringJoin:1,contractName:!0},sendeventonenterkey:{direction:"event",booleanJoin:1,contractName:!0},sendeventonesckey:{direction:"event",booleanJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:"",name:"pattern",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"mask",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"icon",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"label",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"placeholder",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.ICON_POSITION[0],enumeratedValues:e.ICON_POSITION,name:"iconPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ICON_POSITION[0],isObservableProperty:!0},{default:e.INPUT_TYPE[0],enumeratedValues:e.INPUT_TYPE,name:"type",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.INPUT_TYPE[0],isObservableProperty:!0},{default:0,name:"minLength",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:99,conditionalMin:0,conditionalMax:99,conditionalMinValue:0,conditionalMaxValue:99},isObservableProperty:!0},{default:0,name:"maxLength",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:99,conditionalMin:0,conditionalMax:99,conditionalMinValue:0,conditionalMaxValue:99},isObservableProperty:!0},{default:0,name:"minValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:99,conditionalMin:0,conditionalMax:99,conditionalMinValue:0,conditionalMaxValue:99},isObservableProperty:!0},{default:0,name:"maxValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:99,conditionalMin:0,conditionalMax:99,conditionalMinValue:0,conditionalMaxValue:99},isObservableProperty:!0},{default:e.SIZE[0],enumeratedValues:e.SIZE,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZE[0],isObservableProperty:!0},{default:null,enumeratedValues:e.STRETCH,name:"stretch",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:null,isObservableProperty:!0,isNullable:!0},{default:e.TEXT_TRANSFORM[0],enumeratedValues:e.TEXT_TRANSFORM,name:"text-transform",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.TEXT_TRANSFORM[0],isObservableProperty:!0},{default:!1,name:"scaling",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:12,name:"minimumFontSize",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:1e4,conditionalMin:0,conditionalMax:1e4,conditionalMinValue:0,conditionalMaxValue:1e4},isObservableProperty:!0},{default:0,name:"tabIndex",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:1e5,conditionalMin:0,conditionalMax:1e5,conditionalMinValue:0,conditionalMaxValue:1e5},isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateFocus",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateValue",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnChange",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnFocus",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnBlur",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"onValidityChange",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"value",nameForSignal:"receiveStateValue",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnEnterKey",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnEscKey",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-textinput";static SCALING_INDEX=.25;primaryCssClass="ch5-textinput";_ch5Properties;_elContainer={};_elInput={};_elIcon={};_labelElement={};_maskingUtility=null;previousLength=0;lastValidState=!1;dirtyCustomEvent={};validityChangeEvent={};cleanCustomEvent={};_onValidityChange={};set pattern(e){this._ch5Properties.set("pattern",e,()=>{this.handlePattern()})}get pattern(){return this._ch5Properties.get("pattern")}set mask(e){const t=this._getTranslatedValue("mask",e);this._ch5Properties.set("mask",t,()=>{this.handleMask()})}get mask(){return this._ch5Properties.get("mask")}set iconClass(e){this._ch5Properties.set("iconClass",e,()=>{this.handleIconClass()})}get iconClass(){return this._ch5Properties.get("iconClass")}set icon(e){this._ch5Properties.set("icon",e,()=>{this.handleIcon()})}get icon(){return this._ch5Properties.get("icon")}set label(e){const t=this._getTranslatedValue("label",e);this._ch5Properties.set("label",t,()=>{this.handleLabel()})}get label(){return this._ch5Properties.get("label")}set placeholder(e){const t=this._getTranslatedValue("placeholder",e);this._ch5Properties.set("placeholder",t,()=>{this.handlePlaceholder()})}get placeholder(){return this._ch5Properties.get("placeholder")}set iconPosition(e){this._ch5Properties.set("iconPosition",e,()=>{""===this.iconClass?this.handleIcon():this.handleIconClass()})}get iconPosition(){return this._ch5Properties.get("iconPosition")}set type(e){this._ch5Properties.set("type",e,()=>{this.handleType()})}get type(){return this._ch5Properties.get("type")}set minLength(e){this._ch5Properties.set("minLength",e,()=>{this._elInput.minLength=this.minLength,this._elInput.setAttribute("minlength",this.minLength+"")})}get minLength(){return this._ch5Properties.get("minLength")}set maxLength(e){this._ch5Properties.set("maxLength",e,()=>{this._elInput.maxLength=this.maxLength,this._elInput.setAttribute("maxlength",this.maxLength+"")})}get maxLength(){return this._ch5Properties.get("maxLength")}set minValue(e){this._ch5Properties.set("minValue",e,()=>{this.handleMinValue()})}get minValue(){return this._ch5Properties.get("minValue")}set maxValue(e){this._ch5Properties.set("maxValue",e,()=>{this.handleMaxValue()})}get maxValue(){return this._ch5Properties.get("maxValue")}set size(e){this._ch5Properties.set("size",e,()=>{this.handleSize()})}get size(){return this._ch5Properties.get("size")}set stretch(e){this._ch5Properties.set("stretch",e,()=>{this.handleStretch()})}get stretch(){return this._ch5Properties.get("stretch")}set textTransform(e){this._ch5Properties.set("text-transform",e,()=>{this.handleTextTransform()})}get textTransform(){return this._ch5Properties.get("text-transform")}set scaling(e){this._ch5Properties.set("scaling",e,()=>{this.handleScaling()})}get scaling(){return this._ch5Properties.get("scaling")}set minimumFontSize(e){this._ch5Properties.set("minimumFontSize",e)}get minimumFontSize(){return this._ch5Properties.get("minimumFontSize")}set tabIndex(e){this._ch5Properties.set("tabIndex",e,()=>{this._elInput.tabIndex=e,this._elInput.setAttribute("tabindex",this.tabIndex+"")})}get tabIndex(){return this._ch5Properties.get("tabIndex")}set receiveStateFocus(e){this._ch5Properties.set("receiveStateFocus",e,null,e=>{!0===e?this._elInput.focus():this._elInput.blur()})}get receiveStateFocus(){return this._ch5Properties.get("receiveStateFocus")}set receiveStateValue(e){this._ch5Properties.set("receiveStateValue",e,null,e=>{this.updateValue(e)})}get receiveStateValue(){return this._ch5Properties.get("receiveStateValue")}set sendEventOnChange(e){this._ch5Properties.set("sendEventOnChange",e)}get sendEventOnChange(){return this._ch5Properties.get("sendEventOnChange")}set sendEventOnFocus(e){this._ch5Properties.set("sendEventOnFocus",e)}get sendEventOnFocus(){return this._ch5Properties.get("sendEventOnFocus")}set sendEventOnBlur(e){this._ch5Properties.set("sendEventOnBlur",e)}get sendEventOnBlur(){return this._ch5Properties.get("sendEventOnBlur")}set value(e){this._ch5Properties.set("value",e)}get value(){return this._ch5Properties.get("value")}set sendEventOnEnterKey(e){this._ch5Properties.set("sendEventOnEnterKey",e)}get sendEventOnEnterKey(){return this._ch5Properties.get("sendEventOnEnterKey")}set sendEventOnEscKey(e){this._ch5Properties.set("sendEventOnEscKey",e)}get sendEventOnEscKey(){return this._ch5Properties.get("sendEventOnEscKey")}set onValidityChange(e){null==e&&(e={}),e instanceof HtmlCallback&&this.onValidityChange instanceof Function||(this._onValidityChange=e)}get onValidityChange(){return this._onValidityChange}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=[],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes.concat(Ch5CommonInput.observedAttributes),i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){"text-transform"===t.toLowerCase()&&(this.textTransform=s),this.logger.log('ch5-textinput attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s);this._addAriaAttributes()}"disabled"===t&&(!0===this.disabled?this._elInput.setAttribute("disabled",""):this._elInput.removeAttribute("disabled")),this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5TextInput),this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-textinput"),this.appendChild(this._elContainer)),this.hasAttribute("value")&&(this.value=this.getAttribute("value"),this.cleanValue=this.value,this._elInput.value=this.cleanValue),this.attachEventListeners(),this.initAttributes(),this._addAriaAttributes(),this.initCommonMutationObserver(this),this.lastValidState=this.getValid(),this.previousLength=this._elInput.value.length,customElements.whenDefined("ch5-textinput").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this.classList.add(this.primaryCssClass),this._elContainer=document.createElement("div"),this._elContainer.classList.add(this.primaryCssClass+"-container"),this._elIcon=document.createElement("i"),this._elIcon.classList.add(this.primaryCssClass+"--icon"),this._elInput=document.createElement("input"),this._elInput.classList.add(this.primaryCssClass+"--input"),this._labelElement=document.createElement("label"),this._labelElement.classList.add(this.primaryCssClass+"--label"),this._elContainer.appendChild(this._elInput),this._elIcon.setAttribute("role","icon"),this._elInput.setAttribute("aria-multiline","false"),this._elInput.setAttribute("role","textbox"),this.appendChild(this._elContainer),this.logger.stop()}initAttributes(){super.initAttributes(),this.hasAttribute("text-transform")&&(this.textTransform=this.getAttribute("text-transform"));const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),this._elInput.addEventListener("keyup",this.onChangeHandler),this._elInput.addEventListener("keydown",this.keyDownHandler),this._elInput.addEventListener("focus",this.onFocusHandler),this._elInput.addEventListener("blur",this.onBlurHandler),this._elInput.addEventListener("input",this.onKeyPressHandler)}removeEventListeners(){super.removeEventListeners(),this._elInput.removeEventListener("keyup",this.onChangeHandler),this._elInput.removeEventListener("keydown",this.keyDownHandler),this._elInput.removeEventListener("focus",this.onFocusHandler),this._elInput.removeEventListener("blur",this.onBlurHandler),this._elInput.removeEventListener("input",this.onKeyPressHandler)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handlePattern(){this._elInput.setAttribute("pattern",this.pattern),""!==this.mask&&(this._elInput.removeAttribute("mask"),this.mask="",this._maskingUtility=null,this.repaint())}handleMask(){this.hasAttribute("pattern")&&null!==this.getAttribute("pattern")&&""!==this.getAttribute("pattern")||null!==this._maskingUtility&&(this._maskingUtility.stop(),Array.from(this._elContainer.children).forEach(e=>e.remove()),this._elContainer.appendChild(this._elIcon),this._elContainer.appendChild(this._elInput),this._maskingUtility=null,""===this.mask)||(this._elInput.setAttribute("mask",this.mask),this._maskingUtility=new Ch5TextInputMask(this._elInput,this.mask),this._maskingUtility.init(),this.hasAttribute("placeholder")&&(this._maskingUtility.placeholder=this.placeholder))}handleIconClass(){var e,t;this._elIcon.className="",this._elIcon.classList.add(this.primaryCssClass+"--icon"),this._elIcon.classList.add(this.primaryCssClass+"--icon-position-"+this.iconPosition),""!==this.iconClass.trim()&&this.iconClass.split(" ").forEach(e=>this._elIcon.classList.add(e)),""===this.iconClass?this._elIcon.remove():"first"===this.iconPosition?null==(e=this._elInput.parentElement)||e.prepend(this._elIcon):null==(t=this._elInput.parentElement)||t.appendChild(this._elIcon)}handleIcon(){var e,t;this._elIcon.className="",this._elIcon.classList.add(this.primaryCssClass+"--icon"),this._elIcon.classList.add(this.primaryCssClass+"--icon-position-"+this.iconPosition),""!==this.icon.trim()&&this.icon.split(" ").forEach(e=>this._elIcon.classList.add(e)),""===this.icon?this._elIcon.remove():"first"===this.iconPosition?null==(e=this._elInput.parentElement)||e.prepend(this._elIcon):null==(t=this._elInput.parentElement)||t.appendChild(this._elIcon)}handleLabel(){this.label=this._getTranslatedValue("label",this.label),this._labelElement.innerHTML=this.label,""===this.label?this.removeChild(this._labelElement):this.prepend(this._labelElement)}handlePlaceholder(){this.placeholder=this._getTranslatedValue("placeholder",this.placeholder),this._elInput.setAttribute("placeholder",this.placeholder),null!==this._maskingUtility&&(this._maskingUtility.placeholder=this.placeholder)}handleType(){this._elInput.setAttribute("type",this.type)}handleMinValue(){this._elInput.setAttribute("min",this.minValue+"")}handleMaxValue(){this._elInput.setAttribute("max",this.maxValue+"")}handleSize(){var t;Array.from(e.COMPONENT_DATA.SIZE.values).forEach(t=>{this.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+t)}),this.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),null==(t=this._maskingUtility)||t._makeMaskElementLookAsInputPlaceholder()}handleStretch(){Array.from(e.COMPONENT_DATA.STRETCH.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.STRETCH.classListPrefix+t)}),this.stretch&&this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.STRETCH.classListPrefix+this.stretch)}handleTextTransform(){Array.from(e.COMPONENT_DATA.TEXT_TRANSFORM.values).forEach(t=>{this._elInput.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.TEXT_TRANSFORM.classListPrefix+t)}),this._elInput.classList.add(this.primaryCssClass+e.COMPONENT_DATA.TEXT_TRANSFORM.classListPrefix+this.textTransform)}handleScaling(){this.scaling?this._elInput.classList.add("ch5-textinput--input-scaling"):this._elInput.classList.remove("ch5-textinput--input-scaling")}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this._elIcon.classList.add(this.primaryCssClass+e.COMPONENT_DATA.ICON_POSITION.classListPrefix+this.iconPosition),this._elInput.classList.add(this.primaryCssClass+e.COMPONENT_DATA.TEXT_TRANSFORM.classListPrefix+this.textTransform),this.logger.stop()}handleCleanWithScale(){const{clientWidth:t,scrollWidth:i}=this._elInput,s=t<i;if(!1===s)return this._elInput.style.removeProperty("font-size"),void(this.previousLength=this._elInput.value.length);for(;!0===s;){const t=window.getComputedStyle(this._elInput).fontSize,i=Number(t.replace("px",""));if(i===this.minimumFontSize)break;this._elInput.style.fontSize=i-e.SCALING_INDEX+"px";const{clientWidth:s,scrollWidth:n}=this._elInput;if(s<n==!1)break}}handleInputScaling(){const{clientWidth:t,scrollWidth:i}=this._elInput;if(!1===t<i)return this._elInput.style.removeProperty("font-size"),void(this.previousLength=this._elInput.value.length);const s=window.getComputedStyle(this._elInput).fontSize,n=Number(s.replace("px",""));this.previousLength>this._elInput.value.length?this._elInput.style.fontSize=n+e.SCALING_INDEX+"px":n>this.minimumFontSize&&(this._elInput.style.fontSize=n-e.SCALING_INDEX+"px"),this.previousLength=this._elInput.value.length}onChangeHandler=e=>{const t=e.currentTarget;this.value=e.currentTarget.value,this._dirty=!0,this._clean=!1,"direct"===this.feedbackMode?(this._onChangeSignal(t.value),this.dirtyTimerHandle()):"submit"===this.feedbackMode&&(this._createValidityChangeEvent(t.value),this._createDirtyCustomEvent(t.value),t.dispatchEvent(this.dirtyCustomEvent),this.runEventHandlers("dirty",this.dirtyCustomEvent),this.lastValidState!==this.getValid()&&(t.dispatchEvent(this.validityChangeEvent),this.onValidityChange instanceof HtmlCallback?this.onValidityChange.run(this.validityChangeEvent):this.onValidityChange instanceof Function&&this.onValidityChange.call(this,this.validityChangeEvent)),this.lastValidState=this.getValid()),this.highlightInputIfNotValid()};_onChangeSignal(e){var t;this.sendEventOnChange&&(null==(t=Ch5SignalFactory.getInstance().getStringSignal(this.sendEventOnChange))||t.publish(Ch5Common.handlingTextTransformValue(e,this.textTransform)))}dirtyTimerHandle(){null!==this._dirtyTimerHandle&&clearTimeout(this._dirtyTimerHandle),this._dirtyTimerHandle=window.setTimeout(()=>this.valueSync(),this.signalValueSyncTimeout)}valueSync(){if(this._dirtyTimerHandle=null,this._elInput.value!==this.cleanValue&&(this._createCleanCustomEvent(),this.dispatchEvent(this.cleanCustomEvent),this.runEventHandlers("clean",this.cleanCustomEvent),this.value=Ch5Common.handlingTextTransformValue(this.cleanValue,this.textTransform),this._elInput.value=this.value+"",this._clean=!0,this._dirty=!1,this.scaling&&this.handleCleanWithScale(),""!==this.mask&&null!==this._maskingUtility)){const e=this._maskingUtility.lastValueLength,t=this.value.length;this._maskingUtility.dispatchMaskUpdateEvent();for(let i=e;i>=t;i--)this._maskingUtility._updateCharactersInMask(),this._maskingUtility.lastValueLength--;if(0===this.value.length){const e=new Event("focus");this._elInput.dispatchEvent(e)}}}keyDownHandler=e=>{var t,i,s,n;const r=13===e.keyCode||"Enter"===e.code||"Enter"===e.key,a=27===e.keyCode||e.code.includes("Esc")||e.key.includes("Esc");if(r||a){const t=e.currentTarget;this._dirty=!0,this._clean=!1,this.dirtyValue=t.value}r&&this.sendEventOnEnterKey?(null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnEnterKey))||t.publish(!0),null==(i=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnEnterKey))||i.publish(!1)):a&&this.sendEventOnEscKey&&(null==(s=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnEscKey))||s.publish(!0),null==(n=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnEscKey))||n.publish(!1)),this.scaling&&this.handleInputScaling()};onFocusHandler=()=>{var e,t;void 0!==this.lastValidState&&null!==this.lastValidState||(this.lastValidState=this.getValid()),this.sendEventOnFocus&&(null==(e=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnFocus))||e.publish(!0),null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnFocus))||t.publish(!1)),this.classList.add(this.primaryCssClass+"--focused"),this.highlightInputIfNotValid()};onBlurHandler=()=>{var e,t;this.sendEventOnBlur&&(null==(e=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnBlur))||e.publish(!0),null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnBlur))||t.publish(!1)),this.classList.remove(this.primaryCssClass+"--focused"),this.highlightInputIfNotValid()};highlightInputIfNotValid(){const e=this.primaryCssClass+"--error";this.getValid()?(this.classList.remove(e),this._elInput.classList.remove(e)):(this.classList.add(e),this._elInput.classList.add(e))}onKeyPressHandler=e=>{if("direct"===this.feedbackMode){const t=e.currentTarget;this._dirty=!0,this._clean=!1,this.dirtyValue=t.value}};setValue(e){this.value=e,this._elInput.value=e}submit(){"submit"===this.feedbackMode&&!0===this.getValid()&&(this.value!==this.cleanValue&&this.dirtyValue!==this.value&&this._onChangeSignal(this.value),this._submitted=!0,this._dirty=!1,this.dirtyValue=this._elInput.value,this.dirtyTimerHandle(),this._clean=!0)}reset(){this._clean=!0,this._dirty=!1,this.value=this._cleanValue,this._elInput.value=this.value+"",this._createCleanCustomEvent(),this.dispatchEvent(this.cleanCustomEvent),this.onclean instanceof HtmlCallback?this.onclean.run({}):this.onclean instanceof Function&&this.onclean()}updateValue(e){this.dirtyValue=e,this.value=this._elInput.value=e,this.cleanValue=e,this._elInput.setAttribute("value",this.cleanValue+""),this.scaling&&this.handleCleanWithScale()}getValid(){return this._elInput.validity.valid&&!this._elInput.validity.tooLong&&!this._elInput.validity.tooShort}getTargetElementForCssClassesAndStyle(){return this}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}_createValidityChangeEvent(e){this.validityChangeEvent=this._createCustomEvent("validitychange",e)}_createDirtyCustomEvent(e){this.dirtyCustomEvent=this._createCustomEvent("dirty",e)}_createCleanCustomEvent(){this.cleanCustomEvent=this._createCustomEvent("clean")}_createCustomEvent(e,t=""){return new CustomEvent(e,{detail:{message:t,time:new Date},bubbles:!0,cancelable:!0})}_addAriaAttributes(){this._elInput.setAttribute("aria-placeholder",this.placeholder),this._elInput.setAttribute("aria-required",this.required+""),this._labelElement.setAttribute("aria-label",this.label),this._elInput.setAttribute("aria-labeledby",this.label)}};Ch5TextInput.registerCustomElement(),Ch5TextInput.registerSignalAttributeTypes();var Ch5Toggle=class e extends Ch5CommonInput{static HANDLE_SHAPE=["circle","rectangle"];static ORIENTATION=["horizontal","vertical"];static SIZES=["regular","x-small","small","large","x-large"];static MODES=["direct","submit"];static COMPONENT_DATA={HANDLE_SHAPE:{default:e.HANDLE_SHAPE[0],values:e.HANDLE_SHAPE,key:"handleShape",attribute:"handleShape",classListPrefix:"--handle-shape-"},ORIENTATION:{default:e.ORIENTATION[0],values:e.ORIENTATION,key:"orientation",attribute:"orientation",classListPrefix:"--orientation-"},SIZE:{default:e.SIZES[0],values:e.SIZES,key:"size",classListPrefix:"--size-"},MODES:{default:e.MODES[0],values:e.MODES,key:"mode",classListPrefix:"--"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatevalue:{direction:"state",booleanJoin:1,contractName:!0},receivestatescriptlabelhtml:{direction:"state",stringJoin:1,contractName:!0},sendeventonclick:{direction:"event",booleanJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:e.HANDLE_SHAPE[0],enumeratedValues:e.HANDLE_SHAPE,name:"handleShape",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.HANDLE_SHAPE[0],isObservableProperty:!0},{default:"",name:"label",nameForSignal:"receiveStateScriptLabelHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelOn",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelOff",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconOn",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconOff",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.ORIENTATION[0],enumeratedValues:e.ORIENTATION,name:"orientation",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ORIENTATION[0],isObservableProperty:!0},{default:!1,name:"value",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:e.SIZES[0],enumeratedValues:e.SIZES,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZES[0],isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateValue",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateScriptLabelHTML",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"sendEventOnClick",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"sendEventOnTouch",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-toggle";primaryCssClass="ch5-toggle";changeEvent={};cleanEvent={};dirtyEvent={};_dirtyTimerHandle=null;_dirty=!1;_clean=!0;_ch5Properties;_elContainer={};_elBody={};_elLabel={};_elHandle={};_elIconOn={};_elIconOff={};_elLabelOn={};_elLabelOff={};_elOnContainer={};_elOffContainer={};_elKnob={};set handleShape(e){this._ch5Properties.set("handleShape",e,()=>{this.handleHandleShape()})}get handleShape(){return this._ch5Properties.get("handleShape")}set label(e){const t=this._getTranslatedValue("label",e);this._ch5Properties.set("label",t,()=>{this.handleLabel()})}get label(){return this._ch5Properties.get("label")}set labelOn(e){const t=this._getTranslatedValue("labelOn",e);this._ch5Properties.set("labelOn",t,()=>{this._elLabelOn.innerText=this._getTranslatedValue("labelOn",this.labelOn)})}get labelOn(){return this._ch5Properties.get("labelOn")}set labelOff(e){const t=this._getTranslatedValue("labelOff",e);this._ch5Properties.set("labelOff",t,()=>{this._elLabelOff.innerText=this._getTranslatedValue("labelOff",this.labelOff)})}get labelOff(){return this._ch5Properties.get("labelOff")}set iconOn(e){this._ch5Properties.set("iconOn",e,()=>{this.handleIconOn()})}get iconOn(){return this._ch5Properties.get("iconOn")}set iconOff(e){this._ch5Properties.set("iconOff",e,()=>{this.handleIconOff()})}get iconOff(){return this._ch5Properties.get("iconOff")}set orientation(e){this._ch5Properties.set("orientation",e,()=>{this.handleOrientation()})}get orientation(){return this._ch5Properties.get("orientation")}set value(e){this._ch5Properties.set("value",e,()=>{this.handleValue()})}get value(){return this._ch5Properties.get("value")}set size(e){this._ch5Properties.set("size",e,()=>{this.handleSize()})}get size(){return this._ch5Properties.get("size")}set receiveStateValue(e){this._ch5Properties.set("receiveStateValue",e,null,e=>{this.value=e,this.cleanValue=e,this._dirty=!1,this._clean=!0,null!==this._dirtyTimerHandle&&clearTimeout(this._dirtyTimerHandle)})}get receiveStateValue(){return this._ch5Properties.get("receiveStateValue")}set receiveStateScriptLabelHTML(e){this._ch5Properties.set("receiveStateScriptLabelHTML",e,null,e=>{this._ch5Properties.setForSignalResponse("label",e,()=>{this.handleLabel()})})}get receiveStateScriptLabelHTML(){return this._ch5Properties.get("receiveStateScriptLabelHTML")}set sendEventOnClick(e){this._ch5Properties.set("sendEventOnClick",e)}get sendEventOnClick(){return this._ch5Properties.get("sendEventOnClick")}set sendEventOnTouch(e){this._ch5Properties.set("sendEventOnTouch",e)}get sendEventOnTouch(){return this._ch5Properties.get("sendEventOnTouch")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=[],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-toggle attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.addAriaAttributes(),this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Toggle),this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-toggle"),this.appendChild(this._elContainer)),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this._cleanValue=this.value,customElements.whenDefined("ch5-toggle").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._elBody=document.createElement("div"),this._elLabel=document.createElement("span"),this._elLabel.hidden=!0,this._elLabel.classList.add(this.primaryCssClass+"__label"),this._elHandle=document.createElement("span"),this._elHandle.classList.add(this.primaryCssClass+"__handle"),this._elIconOn=document.createElement("i"),this._elIconOn.classList.add(this.primaryCssClass+"__on-icon"),this._elLabelOn=document.createElement("span"),this._elLabelOn.classList.add(this.primaryCssClass+"__on-label"),this._elOnContainer=document.createElement("div"),this._elOnContainer.appendChild(this._elIconOn),this._elOnContainer.appendChild(this._elLabelOn),this._elIconOff=document.createElement("i"),this._elIconOff.classList.add(this.primaryCssClass+"__off-icon"),this._elLabelOff=document.createElement("span"),this._elLabelOff.classList.add(this.primaryCssClass+"__off-label"),this._elOffContainer=document.createElement("div"),this._elOffContainer.appendChild(this._elIconOff),this._elOffContainer.appendChild(this._elLabelOff),this._elKnob=document.createElement("a"),this._elBody.appendChild(this._elLabel),this._elBody.appendChild(this._elHandle),this._elHandle.appendChild(this._elOffContainer),this._elHandle.appendChild(this._elOnContainer),this._elHandle.appendChild(this._elKnob),this._elContainer.appendChild(this._elBody),this.setAttribute("tabindex","0"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),this.addEventListener("click",this.handleClick)}removeEventListeners(){super.removeEventListeners(),this.removeEventListener("click",this.handleClick)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleHandleShape(){Array.from(e.COMPONENT_DATA.HANDLE_SHAPE.values).forEach(e=>{this._elContainer.classList.remove(this.primaryCssClass+"--"+e)}),this._elContainer.classList.add(this.primaryCssClass+"--"+this.handleShape)}handleLabel(){this._elLabel.innerHTML=this._getTranslatedValue("label",this.label),this._elLabel.hidden=!1}handleIconOn(){this.iconOn.split(" ").forEach(e=>{""!==e.trim()&&this._elIconOn.classList.remove(e)}),this.iconOn.split(" ").forEach(e=>{""!==e.trim()&&this._elIconOn.classList.add(e)})}handleIconOff(){this.iconOff.split(" ").forEach(e=>{""!==e.trim()&&this._elIconOff.classList.remove(e)}),this.iconOff.split(" ").forEach(e=>{""!==e.trim()&&this._elIconOff.classList.add(e)})}handleOrientation(){Array.from(e.COMPONENT_DATA.ORIENTATION.values).forEach(e=>{this._elContainer.classList.remove(this.primaryCssClass+"--"+e)}),this._elContainer.classList.add(this.primaryCssClass+"--"+this.orientation)}handleSize(){Array.from(e.COMPONENT_DATA.SIZE.values).forEach(t=>{this._elHandle.classList.remove(this.primaryCssClass+"__handle"+e.COMPONENT_DATA.SIZE.classListPrefix+t)}),this._elHandle.classList.add(this.primaryCssClass+"__handle"+e.COMPONENT_DATA.SIZE.classListPrefix+this.size)}handleSendEventOnClick(){var e,t,i,s;this.sendEventOnClick?(null==(e=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick))||e.publish(!0),null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnClick))||t.publish(!1)):this.sendEventOnTouch&&(null==(i=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnTouch))||i.publish(!0),null==(s=Ch5SignalFactory.getInstance().getBooleanSignal(this.sendEventOnTouch))||s.publish(!1))}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this._elContainer.classList.add(this.primaryCssClass+`--${this.handleShape}`),this._elContainer.classList.add(this.primaryCssClass+`--${this.orientation}`),this._elHandle.classList.add(this.primaryCssClass+"__handle"+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this.logger.stop()}handleClick=()=>{this.disabled||this.toggleChecked()};_dispatchEvents(e){this.dispatchEvent(this.changeEvent=new CustomEvent("change",{detail:e,bubbles:!0}))}addAriaAttributes(){this.disabled?(this.removeAttribute("tabindex"),this.blur()):this.setAttribute("tabindex","0"),this.setAttribute("aria-checked",this.value+""),this.setAttribute("aria-disabled",this.disabled+"")}handleValue(){this.dirtyValue=this.value,this._clean=!1,this.value?(this.setAttribute("checked",""),this._elContainer.classList.add(this.primaryCssClass+"--on")):(this.removeAttribute("checked"),this._elContainer.classList.remove(this.primaryCssClass+"--on"))}setDirtyHandler(){null!==this._dirtyTimerHandle&&clearTimeout(this._dirtyTimerHandle),this._dirtyTimerHandle=window.setTimeout(()=>this.valueSync(),this._signalValueSyncTimeout)}valueSync(){null!==this._dirtyTimerHandle&&clearTimeout(this._dirtyTimerHandle),this.dirtyValue!==this.cleanValue&&(this.value=this.cleanValue,this.setClean())}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}submit(){"submit"===this.feedbackMode&&this.dirtyValue!==this.cleanValue&&(this._submitted=!0,this.setDirtyHandler(),this.handleSendEventOnClick())}reset(){this.setClean(),this.value=this.cleanValue}toggleChecked(){this.value=!this.value;const e={value:this.value};this._dirty?this.setClean():(this._dirtyValue=this.value,this.setDirty()),"submit"!==this.feedbackMode&&(this.setDirtyHandler(),this.handleSendEventOnClick()),this._dispatchEvents(e)}getDirty(){return"submit"===this.feedbackMode&&this._dirty}setDirty(){if(this._dirty=!0,this._clean=!1,"submit"===this.feedbackMode){const e={value:this.value};this.dispatchEvent(this.dirtyEvent=new CustomEvent("dirty",{bubbles:!0,cancelable:!1,detail:e})),this.ondirty instanceof HtmlCallback?this.ondirty.run({}):this.onclean instanceof Function&&this.onclean()}}setClean(){if(null!==this._dirtyTimerHandle&&clearTimeout(this._dirtyTimerHandle),this._dirty=!1,this._clean=!0,this._submitted=!1,"submit"===this.feedbackMode){const e={value:this.value};this.dispatchEvent(this.cleanEvent=new CustomEvent("clean",{bubbles:!0,cancelable:!1,detail:e})),this.onclean instanceof HtmlCallback?this.onclean.run({}):this.onclean instanceof Function&&this.onclean()}}};Ch5Toggle.registerCustomElement(),Ch5Toggle.registerSignalAttributeTypes();import{isNil as isNil20}from"lodash";var Ch5TouchActivitySignals=(e=>(e.CsigTime="Csig.Time",e.CsigResetActivityTimer="Csig.Reset_Activity_Timer",e.CsigTouchActivity="Csig.Touch_Activity",e))(Ch5TouchActivitySignals||{}),Ch5TouchActivity=class e{static _instance;_ch5SignalFactory;_ch5TimeSignal=null;_ch5ResetActivityTimerSignal=null;_ch5Platform;_supportsTouchActivity=!0;_touchInactivityPeriod=0;_touchActivityTimeoutId=0;constructor(e,t){this._ch5SignalFactory=e,this._ch5Platform=t,this._onTouchStart=this._onTouchStart.bind(this),document.addEventListener("touchstart",this._onTouchStart),this._onTouchMove=this._onTouchMove.bind(this),document.addEventListener("touchmove",this._onTouchMove),this._onTouchEnd=this._onTouchEnd.bind(this),document.addEventListener("touchend",this._onTouchEnd),this._onTouchCancel=this._onTouchCancel.bind(this),document.addEventListener("touchcancel",this._onTouchCancel)}static getInstance(t,i){return isNil20(this._instance)&&(isNil20(i)&&(i=Ch5Platform.getInstance()),isNil20(t)&&(t=Ch5SignalFactory.getInstance()),this._instance=new e(t,i)),this._instance}init(){this.setSupportsTouchActivity(this._ch5Platform.getPlatformInfo()),this._ch5Platform.registerUpdateCallback(e=>{if(this.setSupportsTouchActivity(e),this._supportsTouchActivity)Ch5Debug.info("Ch5TouchActivity","Touch activity is supported");else{const{CsigTime:e,CsigResetActivityTimer:t}=Ch5TouchActivitySignals;Ch5Debug.info("Ch5TouchActivity",`No support for touch activity, subscribing to ${e} and ${t}`),this.subscribeToTimeSignal(),this.subscribeToResetActivityTimerSignal()}})}setSupportsTouchActivity(e){this._supportsTouchActivity=!isNil20(e.capabilities)&&e.capabilities.supportsTouchActivity}subscribeToTimeSignal(){this._ch5TimeSignal=this._ch5SignalFactory.getNumberSignal("Csig.Time",!0),isNil20(this._ch5TimeSignal)||this._ch5TimeSignal.subscribe(e=>{Ch5Debug.info("Ch5TouchActivity",`CSIG_TIME: ${e}`),this._touchInactivityPeriod=e,this.clearTouchInactivityTimeout(),this.setTouchInactivityTimeout()})}subscribeToResetActivityTimerSignal(){this._ch5ResetActivityTimerSignal=this._ch5SignalFactory.getBooleanSignal("Csig.Reset_Activity_Timer",!0),isNil20(this._ch5ResetActivityTimerSignal)||this._ch5ResetActivityTimerSignal.subscribe(e=>{Ch5Debug.info("Ch5TouchActivity",`CSIG_RESET_ACTIVITY_TIMER: ${e}`),e&&(this.clearTouchInactivityTimeout(),this.publishTouchActivityEvent(!1),this.setTouchInactivityTimeout())})}_onTouchStart(e){Ch5Debug.info("Ch5TouchActivity",`_onTouchStart(${e.type})`),this.clearTouchInactivityTimeout(),this.publishTouchActivity()}_onTouchMove(e){Ch5Debug.info("Ch5TouchActivity",`_onTouchMove(${e.type})`),this.clearTouchInactivityTimeout(),this.publishTouchActivity()}_onTouchEnd(e){Ch5Debug.info("Ch5TouchActivity",`_onTouchEnd(${e.type})`),this.clearTouchInactivityTimeout(),this.setTouchInactivityTimeout(),this.publishTouchActivity()}_onTouchCancel(e){Ch5Debug.info("Ch5TouchActivity",`_onTouchCancel(${e.type})`),this.clearTouchInactivityTimeout(),this.setTouchInactivityTimeout(),this.publishTouchActivity()}publishTouchActivity(){this._touchInactivityPeriod<=0||(Ch5Debug.info("Ch5TouchActivity","Publish touch activity with true"),this.publishTouchActivityEvent(!0))}setTouchInactivityTimeout(){this._touchInactivityPeriod<=0||(Ch5Debug.info("Ch5TouchActivity",`Publish touch activity with false after ${this._touchInactivityPeriod}s`),this._touchActivityTimeoutId=window.setTimeout(()=>{this.clearTouchInactivityTimeout(),this.publishTouchActivityEvent(!1)},1e3*this._touchInactivityPeriod))}clearTouchInactivityTimeout(){isNil20(this._touchActivityTimeoutId)||window.clearTimeout(this._touchActivityTimeoutId)}publishTouchActivityEvent(e){Ch5Debug.info("Ch5TouchActivity",`CSIG_TOUCH_ACTIVITY: ${e}`),publishEvent("boolean","Csig.Touch_Activity",e)}};Ch5TouchActivity.getInstance().init();import _37 from"lodash";var _parentTriggerViewNodeName="CH5-TRIGGERVIEW",Ch5TriggerViewChild=class e extends Ch5Common{get selected(){return this.info("Ch5TriggerViewChild get selected()"),this.hasAttribute("selected")}set selected(e){this.info("Ch5TriggerViewChild set selected()"),(e=Boolean(e))?(this.setAttribute("selected",""),this.setAttribute("aria-selected","true")):(this.removeAttribute("selected"),this.setAttribute("aria-selected","false"))}get sendEventOnShow(){return this._sendEventOnShowSigName}set sendEventOnShow(e){this.info("set sendEventOnShow('"+e+"')"),""!==e&&this._sendEventOnShowSigName!==e&&(this._sendEventOnShowSigName=e,this.setAttribute("sendeventonshow",e))}get receiveStateShow(){return this._attributeValueAsString("receivestateshow")}set receiveStateShow(e){if(this.info("set receiveStateShow('"+e+"')"),""===e||this._receiveStateShowSigName===e||null==e)return;if(""!==this._receiveStateShowSigName&&void 0!==this._receiveStateShowSigName&&null!==this._receiveStateShowSigName){const e=Ch5Signal.getSubscriptionSignalName(this._receiveStateShowSigName),t=Ch5SignalFactory.getInstance().getBooleanSignal(e);null!==t&&t.unsubscribe(this._subReceiveSignalShowId)}this._receiveStateShowSigName=e,this.setAttribute("receivestateshow",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateShowSigName),i=Ch5SignalFactory.getInstance().getBooleanSignal(t);if(null===i)return;let s=!1;this._subReceiveSignalShowId=i.subscribe(e=>{if(e&&!0===e&&i.hasChangedSinceInit()){const e=this.getTriggerViewParent();null!==e&&(e.setActiveViewChild(this),s=!0)}e!==this.show&&s&&(this.show=e)})}set sigNameReceiveShow(e){}constructor(){super(),this.info("Ch5TriggerViewChild.constructor()"),this._listOfAllPossibleComponentCssClasses=this._generateListOfAllPossibleComponentCssClasses()}static get observedAttributes(){return Ch5Common.observedAttributes.concat(["selected","sendeventonshow","receivestateshow"])}static ELEMENT_NAME="ch5-triggerview-child";static SHOW_TYPES=["visibility"];primaryCssClass="ch5-viewchild";_noshowType=e.SHOW_TYPES[0];_sendEventOnShowSigName="";_receiveStateShowSigName="";_subReceiveSignalShowId="";static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}connectedCallback(){this.info("Ch5TriggerViewChild.connectedCallback()"),this.cacheComponentChildrens(),this.setAttribute("noshowtype",e.SHOW_TYPES[0]),this.updateCssClasses(),this.setAttribute("role",Ch5RoleAttributeMapping.ch5TriggerViewChild),this.setAttribute("data-ch5-id",this.getCrId()),this.hasAttribute("tabindex")||(this.tabIndex=-1),this.initAttributes(),this.initCommonMutationObserver(this)}disconnectedCallback(){this.info("Ch5TriggerViewChild.disconnectedCallback()"),this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver()}attributeChangedCallback(t,i,s){if(i!==s)switch(this.info('Ch5TriggerViewChild.attributeChangedCallback("'+t+'","'+i+'","'+s+')"'),t){case"selected":this.hasAttribute("selected")?(this.setAttribute("aria-selected","true"),this._sendSignalValueOnShow()):this.setAttribute("aria-selected","false");break;case"sendeventonshow":this.hasAttribute("sendeventonshow")?this.sendEventOnShow=s:this.sendEventOnShow="";break;case"receivestateshow":this.hasAttribute("receivestateshow")?this.receiveStateShow=s:this.receiveStateShow="";break;case"noshowtype":this.noshowType=e.SHOW_TYPES[0];break;case"show":if(this.hasAttribute("show")){const e=this.getAttribute("show");this.show="false"!==e&&"0"!==e}else this.show=!0;this.noshowType=e.SHOW_TYPES[0],this.updateForChangeInShowStatusOld();break;default:super.attributeChangedCallback(t,i,s)}}unsubscribeFromSignals(){super.unsubscribeFromSignals();const e=Ch5SignalFactory.getInstance();if(""!==this._subReceiveSignalShowId&&""!==this._receiveStateShowSigName){const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateShowSigName),i=e.getNumberSignal(t);null!==i&&(i.unsubscribe(this._subReceiveSignalShowId),this._receiveStateShowSigName="")}}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}getTriggerViewParent(){const e=t=>_37.isNil(t)||t.nodeName===_parentTriggerViewNodeName?t:e(t.parentNode);return _37.isNil(this.parentElement)?null:e(this.parentElement)}initAttributes(){super.initAttributes(),this._upgradeProperty("sendEventOnShow"),this._upgradeProperty("receiveStateShow")}updateCssClasses(){super.updateCssClasses();const e=new Set;e.add(this.primaryCssClass);const t=this.getTargetElementForCssClassesAndStyle();void 0!==t.classList&&this._listOfAllPossibleComponentCssClasses.forEach(i=>{e.has(i)?(t.classList.add(i),this.info("add CSS class",i)):(t.classList.remove(i),this.info("remove CSS class",i))})}attachEventListeners(){super.attachEventListeners()}removeEvents(){super.removeEventListeners()}_generateListOfAllPossibleComponentCssClasses(){const e=this._listOfAllPossibleComponentCssClasses;return e.push(this.primaryCssClass),e}_sendSignalValueOnShow(){this.info("Ch5TriggerViewChild._sendSignalValueOnShow()");let e=null;""!==this._sendEventOnShowSigName&&void 0!==this._sendEventOnShowSigName&&null!==this._sendEventOnShowSigName&&(e=Ch5SignalFactory.getInstance().getBooleanSignal(this._sendEventOnShowSigName),null!==e&&(e.publish(!0),e.publish(!1)))}_upgradeProperty(e){if(this.constructor.prototype.hasOwnProperty(e)){const t=this[e];delete this[e],this[e]=t}}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5TriggerViewChild.ELEMENT_NAME,Ch5TriggerViewChild),Ch5TriggerViewChild.registerSignalAttributeTypes();import Swiper from"swiper";import{isNil as isNil21}from"lodash";var Ch5TriggerViewSwiper=class{slides=[];_activeView=0;get activeView(){return this._activeView}set activeView(e){this._activeView=e}constructor(e){}incrementActiveView(e){!0===e?this._activeView!==this.slides.length-1?this._activeView+=1:this._activeView=0:this._activeView!==this.slides.length-1&&(this._activeView+=1)}decrementActiveView(e){!0===e?0!==this._activeView?this._activeView-=1:this._activeView=this.slides.length-1:0!==this._activeView&&(this._activeView-=1)}};import _38 from"lodash";var Ch5TriggerViewSlidesManager=class e{static TRIGGERVIEW_SLIDER_CONTAINER_CLASS="swiper";static TRIGGERVIEW_SLIDES_WRAPPER_CLASS="swiper-wrapper";static TRIGGERVIEW_SLIDE_CLASS="swiper-slide";static TRIGGERVIEW_CHILD_SELECTOR="ch5-triggerview-child";triggerViewEl={};_slidesGap=0;isSwiperInitialized=!1;isCh5SwiperInitialized=!1;_swiper=null;_ch5Swiper=null;_transitionSpeed=200;_externalWrapper=null;_slidesWrapper=null;_touchMoveListRelatedEventDisabled=!1;constructor(e){this.triggerViewEl=e}prepareSwiperSlides(){const e=this.getTriggerViewChildSlides();-1===this.triggerViewEl.flag&&(this.triggerViewEl.slidesNumber=e.length,this.triggerViewEl.flag=0),this._externalWrapper||this._createSlidesWrappers(),this.initSlides(e),this._computeSizes()}initSwiper(){const t=this.triggerViewEl.getCrId();if(!1===this.triggerViewEl.gestureable&&!0===this.triggerViewEl.disableAnimation){_38.isNil(this._slidesWrapper)||this._slidesWrapper.classList.add("slider-full-width-page"),this._ch5Swiper=new Ch5TriggerViewSwiper(`#${t} .${e.TRIGGERVIEW_SLIDER_CONTAINER_CLASS}`),this.isSwiperInitialized=!1,this.isCh5SwiperInitialized=!0;const i=this.getTriggerViewChildSlides();this._ch5Swiper.slides=i,this._ch5Swiper.activeView=this.triggerViewEl.activeView,this.setActiveIndexForLite()}else _38.isNil(this._slidesWrapper)||this._slidesWrapper.classList.remove("slider-full-width-page"),this._swiper=new Swiper(`#${t} .${e.TRIGGERVIEW_SLIDER_CONTAINER_CLASS}`,{slidesPerView:1,spaceBetween:this._slidesGap,loop:this.triggerViewEl.endless,speed:this._getSlidingSpeed(),touchRatio:1.4,followFinger:!0,threshold:this.triggerViewEl.swipeThreshold,touchStartPreventDefault:!1,touchMoveStopPropagation:!1,nested:this.triggerViewEl.nested,updateOnImagesReady:!0,initialSlide:this.getInitialSlide()}),this.isSwiperInitialized=!0,this.isCh5SwiperInitialized=!1,this._swiper.on("slideChange",()=>{this._updateActiveSlideAttributes(),this._updateTriggerViewElActiveViewWhenChangedBySwiper(),publishEvent("b","triggerview.slidechange",!0)}),this._swiper.on("slideChangeTransitionStart",()=>{publishEvent("b","triggerview.slidemove",!0)}),this.setAllowTouchMove(this.triggerViewEl.gestureable),this._swiper.on("touchStart",(...e)=>{const t=e[0].target;this.eventTargetBelongsToCh5List(t)&&(this.setAllowTouchMove(!1),this._touchMoveListRelatedEventDisabled=!0)}),this._swiper.on("touchEnd",(...e)=>{const t=e[0].target;(this.eventTargetBelongsToCh5List(t)||this._touchMoveListRelatedEventDisabled)&&(this.setAllowTouchMove(this.triggerViewEl.gestureable),this._touchMoveListRelatedEventDisabled=!1),publishEvent("b","triggerview.touchend",!0)})}getInitialSlide(){return this.triggerViewEl&&0!==this.triggerViewEl.activeView?this.triggerViewEl.activeView:0}setActiveIndexForLite(){if(this._ch5Swiper){const e=this._ch5Swiper.activeView;e!==this.triggerViewEl.activeView&&(this.triggerViewEl.activeView=this._ch5Swiper.activeView);const t=this.getTriggerViewChildSlides();Array.from(t).forEach((t,i)=>{t.style.width="100%",i!==e?(t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),t.setAttribute("inert","true"),t.classList.add("ch5-hide-vis-position"),t.removeAttribute("selected")):(t.setAttribute("tabindex","1"),t.setAttribute("aria-hidden","false"),t.removeAttribute("inert"),t.classList.remove("ch5-hide-vis-position"),t.setAttribute("selected",""))})}}eventTargetBelongsToCh5List(e){const t=!!e&&null!==e.closest("ch5-slider");let i=!1;if(!!e&&null!==e.closest("ch5-list")){const t=e.closest("ch5-list");if(t.hasAttribute("orientation")){i="horizontal"===t.getAttribute("orientation")}}return t||i}reinitializeSwiper(){this.swiperIsActive()?(this.destroySwiper(),this.initSwiper()):this.ch5SwiperIsActive()&&(this._ch5Swiper=null,this.initSwiper())}set swiperSensitivity(e){this.triggerViewEl.swipeThreshold=e,null!==this._swiper&&(this._swiper.params.threshold=e)}swiperIsActive(){return this._swiper instanceof Swiper&&!_38.isNil(this._swiper)&&!0===this.isSwiperInitialized}ch5SwiperIsActive(){return this._ch5Swiper instanceof Ch5TriggerViewSwiper&&!_38.isNil(this._ch5Swiper)&&!0===this.isCh5SwiperInitialized}destroySwiper(){this.swiperIsActive()&&this._swiper&&this._swiper.$el&&this._swiper.destroy(!0,!1)}getSlidesNumber(){if(0===this.triggerViewEl.slidesNumber){if(!this.swiperIsActive()||isNil21(this._swiper)||isNil21(this._swiper.slides)){if(!this.ch5SwiperIsActive()||isNil21(this._ch5Swiper)||isNil21(this._ch5Swiper.slides)){return this.getTriggerViewChildSlides().length}return this._ch5Swiper.slides.length}return this._swiper.slides.length}return this.triggerViewEl.slidesNumber}swiperActiveViewInitialized(){return!this._swiper||void 0!==this._swiper.activeIndex}initSlides(t){Ch5CustomAttributes.preventUnsubscribe=!0;const i="list"===this.triggerViewEl.getAttribute("role");Array.from(t).forEach((t,s)=>{const n=t.hasAttribute("selected")||s===this.triggerViewEl.activeView;t.setAttribute("tabindex",n?"1":"-1"),t.setAttribute("aria-hidden",String(!n)),n?(t.removeAttribute("inert"),t.hasAttribute("selected")||t.setAttribute("selected","")):t.setAttribute("inert","true"),i&&t.setAttribute("role","listitem"),t.classList.add(e.TRIGGERVIEW_SLIDE_CLASS),this._slidesWrapper.appendChild(t)})}swipeTo(e,t=!1,i){if(this.swiperIsActive()){const s=_38.isNil(i)?this._transitionSpeed:i,n=this.triggerViewEl.endless?e+1:e;if(n!==this._swiper.activeIndex&&this._swiper.hasOwnProperty("snapGrid")){const e=t?0:s;try{this._swiper.slideTo(n,e)}catch(e){}this._updateActiveSlideAttributes()}}else this.ch5SwiperIsActive()&&!_38.isNil(this._ch5Swiper)&&(this._ch5Swiper.activeView=e,this.setActiveIndexForLite())}getChildElSwipeIndex(e){let t=null;if(this.swiperIsActive()){let i=null,s=null;isNil21(this._swiper)||isNil21(this._swiper.slides)||Array.from(this._swiper.slides).forEach((t,n)=>{t.classList.contains("swiper-slide-duplicate")||e!==t||(i=t,s=n)}),null!==i&&(t=this.triggerViewEl.endless?Number(i.getAttribute("data-swiper-slide-index")):s)}else if(this.ch5SwiperIsActive()&&!isNil21(this._ch5Swiper)){let i=null,s=null;Array.from(this._ch5Swiper.slides).forEach((t,n)=>{e===t&&(i=t,s=n)}),null!==i&&(t=this.triggerViewEl.endless?Number(i.getAttribute("data-swiper-slide-index")):s)}return isNaN(t)?null:t}slideNext(){this.swiperIsActive()?this._swiper.slideNext(this._getSlidingSpeed()):this.ch5SwiperIsActive()&&!_38.isNil(this._ch5Swiper)&&(this._ch5Swiper.incrementActiveView(this.triggerViewEl.endless),this.setActiveIndexForLite())}slidePrevious(){this.swiperIsActive()?this._swiper.slidePrev(this._getSlidingSpeed()):this.ch5SwiperIsActive()&&!_38.isNil(this._ch5Swiper)&&(this._ch5Swiper.decrementActiveView(this.triggerViewEl.endless),this.setActiveIndexForLite())}setAllowTouchMove(e){this.swiperIsActive()&&(this._swiper.allowTouchMove=e)}refreshSlideSpeed(){this.swiperIsActive()&&(this._swiper.params.speed=this._getSlidingSpeed())}getActiveIndex(){return this.swiperIsActive()?this._swiper.realIndex:this.ch5SwiperIsActive()&&!_38.isNil(this._ch5Swiper)?this._ch5Swiper.activeView:this._swiper.realIndex}getSwiperParam(e){return this.swiperIsActive()?this._swiper.params[e]:null}getTriggerViewChildSlides(){if(this.swiperIsActive()){return Array.from(this.triggerViewEl.children).filter(t=>t.tagName.toLowerCase()===e.TRIGGERVIEW_CHILD_SELECTOR)}if(this.ch5SwiperIsActive()){if(this.triggerViewEl.children&&this.triggerViewEl.children.length>1&&this.triggerViewEl.children[1].children&&this.triggerViewEl.children[1].children.length>0){return Array.from(this.triggerViewEl.children[1].children[0].children).filter(t=>t.tagName.toLowerCase()===e.TRIGGERVIEW_CHILD_SELECTOR)}return[]}return Array.from(this.triggerViewEl.children).filter(t=>t.tagName.toLowerCase()===e.TRIGGERVIEW_CHILD_SELECTOR)}_createSlidesWrappers(){this._externalWrapper=document.createElement("div"),this._externalWrapper.classList.add(e.TRIGGERVIEW_SLIDER_CONTAINER_CLASS),this._slidesWrapper=document.createElement("div"),this._slidesWrapper.classList.add(e.TRIGGERVIEW_SLIDES_WRAPPER_CLASS),this._externalWrapper.appendChild(this._slidesWrapper),this.triggerViewEl.appendChild(this._externalWrapper)}_computeSizes(){this._slidesGap=this._getSlidesGap()}_getSlidesGap(){/\d$/.test(getCSSCustomProperty(this.triggerViewEl,"--ch5-triggerview-gap"))&&console.warn("Warning: it looks like --ch5-triggerview-gap has a unitless value.\n Add CSS units to its value to avoid breaking the slides layout.");const t=this.triggerViewEl.querySelector(e.TRIGGERVIEW_CHILD_SELECTOR);if(t){const e=parseInt(window.getComputedStyle(t).getPropertyValue("margin-right"),10);return Number.isFinite(e)?e:0}return 0}_updateActiveSlideAttributes(){if(this.swiperIsActive()){const e=this._swiper.activeIndex;Array.from(this._swiper.slides).forEach((t,i)=>{i!==e?(t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),t.setAttribute("inert","true"),t.removeAttribute("selected")):(t.setAttribute("tabindex","1"),t.setAttribute("aria-hidden","false"),t.removeAttribute("inert"),t.setAttribute("selected",""))})}}_updateTriggerViewElActiveViewWhenChangedBySwiper(){this.triggerViewEl.setAttribute("activeView",String(this.getActiveIndex()))}_getSlidingSpeed(){return this.triggerViewEl.disableAnimation?0:this.triggerViewEl.gestureable?this._transitionSpeed:0}getSlidesArray(){return!this.swiperIsActive()||isNil21(this._swiper)||isNil21(this._swiper.slides)?(!this.ch5SwiperIsActive()||isNil21(this._ch5Swiper)||isNil21(this._ch5Swiper.slides),this.getTriggerViewChildSlides()):Array.from(this._swiper.slides)}};import{isNil as isNil22}from"lodash";var SPEED_BETWEEN_PAGES=300,triggerViewHtml='\n <slot id="slidesSlot">\n <p class="slidesFallback">No content available</p>\n </slot>\n <div id="aria-live">\n <slot id="ariaSlot" name="ariaSlot"></slot>\n </div>',triggerViewStyles="\n/*******************************************************************************\n Host and CSS properties\n*******************************************************************************/\n\n:host {\n position: relative;\n\n display: flex;\n flex-direction: column;\n align-items: stretch;\n\n contain: content;\n\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n\n --ch5-triggerview-gap: 16px;\n\n --ch5-triggerview-background-color: transparent;\n\n --ch5-triggerview-slide-min-height: 0px;\n --ch5-triggerview-slide-max-height: none;\n\n --ch5-triggerview-transition-duration: 0.6s;\n --ch5-triggerview-transition-timing-function: ease-in-out;\n\n --ch5-triggerview-fallback-message-color-background: #fff;\n\n --ch5-triggerview__internal__slides-per-view: 1;\n \n overflow: hidden;\n}\n\n:host([hidden]) {\n display: none\n}\n\n/*******************************************************************************\nSlides wrapper: flexbox container, is the transitioning element when moving the slides.\n*******************************************************************************/\n#slidesWrapper {\n display: flex;\n align-items: stretch;\n\n height: 100%;\n min-height: var(--ch5-triggerview-slide-min-height);\n max-height: var(--ch5-triggerview-slide-max-height);\n\n will-change: transform;\n}\n\n:host([transitioning]) #slidesWrapper {\n transition-property: transform;\n transition-duration: var(--ch5-triggerview-transition-duration);\n transition-timing-function: var(--ch5-triggerview-transition-timing-function);\n}\n\n/*******************************************************************************\nSlides: width is calculated with a css formula\n*******************************************************************************/\n#slidesWrapper ::slotted(*) {\n flex-grow: 0;\n flex-shrink: 0;\n /* (100% - gap * (slidesPerView - 1)) / slidesPerView */\n flex-basis: calc((100% - (var(--ch5-triggerview__internal__slides-per-view) - 1) *\n var(--ch5-triggerview-gap)) / var(--ch5-triggerview__internal__slides-per-view));\n\n min-height: var(--ch5-triggerview-slide-min-height);\n max-height: var(--ch5-triggerview-slide-max-height);\n\n margin-right: var(--ch5-triggerview-gap);\n\n /*\n * Enforces the slides to keep their size even if the content requires\n * a bigger slide size.\n */\n overflow: hidden;\n\n outline: 0;\n\n user-select: auto;\n}\n\n.slidesFallback {\n display: flex;\n align-items: center;\n justify-content: center;\n\n margin: 0;\n padding: .5em 1em;\n\n width: 100%;\n\n background-color: var(--ch5-triggerview-fallback-message-color-background);\n}\n\n:host([gestureable=true]) #slidesWrapper ::slotted(*) {\n user-select: none;\n}\n\n/*******************************************************************************\n aria-live styles\n*******************************************************************************/\n#aria-live ::slotted(*) {\n position: absolute;\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n clip: rect(0 0 0 0);\n overflow: hidden;\n border: 0;\n}\n\n/*******************************************************************************\n * Print styles:\n * - Show all slides and stack them vertically\n * - Eliminate the slide gap, show an outline\n * - make sure the page doesn't break a slide in half\n *******************************************************************************/\n\n@media print {\n #slidesWrapper ::slotted(*) {\n margin-right: 0;\n margin-bottom: .2em;\n outline: 1px solid #000;\n color: #000;\n page-break-inside: avoid;\n }\n\n /* Stack the slides */\n #slidesWrapper {\n display: block;\n transform: none !important;\n transition: 0s;\n }\n}\n",template=document.createElement("template");template.innerHTML=`<style>${triggerViewStyles}</style> ${triggerViewHtml}`;var Ch5TriggerView=class e extends Ch5Common{static ELEMENT_NAME="ch5-triggerview";static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateshowchildindex:{direction:"state",numericJoin:1,contractName:!0},sendeventshowchildindex:{direction:"event",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:!1,name:"endless",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"gestureable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"nested",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"disableAnimation",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0}];_ch5Properties;constructor(){super(),this.info("Ch5TriggerView.constructor()"),this._listOfAllPossibleComponentCssClasses=this.generateListOfAllPossibleComponentCssClasses(),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(template.content.cloneNode(!0)),this._slidesSlot=this.shadowRoot.querySelector("#slidesSlot"),this._ariaSlot=this.shadowRoot.querySelector("#ariaSlot"),this.slidesManager=new Ch5TriggerViewSlidesManager(this)}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(["activeview","sendeventshowchildindex","receivestateshowchildindex"].concat(i))}set endless(e){this._ch5Properties.set("endless",e,()=>{const e=this.slidesManager.getSwiperParam("loop");"boolean"==typeof e&&e!==this.endless&&this.slidesManager.reinitializeSwiper()})}get endless(){return this._ch5Properties.get("endless")}set gestureable(e){this._ch5Properties.set("gestureable",e,()=>{this.disableAnimation?this.slidesManager.reinitializeSwiper():(this.slidesManager.setAllowTouchMove(this.gestureable),this.slidesManager.refreshSlideSpeed())})}get gestureable(){return this._ch5Properties.get("gestureable")}set nested(e){this._ch5Properties.set("nested",e,()=>{this.slidesManager.reinitializeSwiper()})}get nested(){return this._ch5Properties.get("nested")}set disableAnimation(e){this._ch5Properties.set("disableAnimation",e,()=>{const e=this.slidesManager.getSwiperParam("followFinger");"boolean"==typeof e&&!e!==this.disableAnimation&&this.slidesManager.reinitializeSwiper()})}get disableAnimation(){return this._ch5Properties.get("disableAnimation")}set activeViewCallback(e){e instanceof Function&&(this._activeViewCallback=e)}get activeViewCallback(){return this._activeViewCallback}set activeView(e){if(e=Number(e),isNaN(e)&&(e=0),this.slidesManager.swiperIsActive()){const t=this.computeTransitionByDistance(e);this.slidesManager.swipeTo(this.activeView,this.disableAnimation,t)}else this.slidesManager.ch5SwiperIsActive()&&this.slidesManager.swipeTo(this.activeView,!1,0);if(this.dispatchEvent(new CustomEvent("select",{detail:e,bubbles:!1})),this._sendEventShowChildIndexSigName!==this._receiveStateShowChildIndexSigName){let e=null;""!==this._sendEventShowChildIndexSigName&&void 0!==this._sendEventShowChildIndexSigName&&null!==this._sendEventShowChildIndexSigName&&(e=Ch5SignalFactory.getInstance().getNumberSignal(this._sendEventShowChildIndexSigName),null!==e&&e.publish(this.activeView))}this._updateAriaLiveDom(),this.activeViewCallback instanceof Function&&this.activeViewCallback(),!0===this.slidesManager.swiperActiveViewInitialized()||this.slidesManager.ch5SwiperIsActive()?(intSetter(this,"activeview",e),this._activeView=e):(intSetter(this,"activeview",this.activeView),this._activeView=this.activeView)}get activeView(){return intGetter(this,"activeview",0)}get getSwiperSensitivity(){return this.swipeThreshold}get sendEventShowChildIndex(){return this._sendEventShowChildIndexSigName}set sendEventShowChildIndex(e){this.info("set _sendEventShowChildIndexSigName('"+e+"')"),""!==e&&this._sendEventShowChildIndexSigName!==e&&(this._sendEventShowChildIndexSigName=e,this.setAttribute("sendeventshowchildindex",e))}get receiveStateShowChildIndex(){return this._attributeValueAsString("receivestateshowchildindex")}set receiveStateShowChildIndex(e){if(this.info("set receiveStateShowChildIndex('"+e+"')"),""===e||this._receiveStateShowChildIndexSigName===e||null==e)return;if(""!==this._receiveStateShowChildIndexSigName&&void 0!==this._receiveStateShowChildIndexSigName&&null!==this._receiveStateShowChildIndexSigName){const e=Ch5Signal.getSubscriptionSignalName(this._receiveStateShowChildIndexSigName),t=Ch5SignalFactory.getInstance().getNumberSignal(e);null!==t&&t.unsubscribe(this._subReceiveStateShowChildIndexId)}this._receiveStateShowChildIndexSigName=e,this.setAttribute("receivestateshowchildindex",e);const t=Ch5Signal.getSubscriptionSignalName(this._receiveStateShowChildIndexSigName),i=Ch5SignalFactory.getInstance().getNumberSignal(t);null!==i&&(this._subReceiveStateShowChildIndexId=i.subscribe(e=>{!isNaN(e)&&i.hasChangedSinceInit()?(this._signalIsReceived=!0,setTimeout(()=>{this.activeView=e},50)):this.info("Ch5TriggerView receiveStateShowChildIndex signal value for "+this.getAttribute("data-ch5-id")+" is invalid")}))}set swipeThreshold(e){isNil22(e)||isNaN(e)||(this._swipeThreshold=e)}get swipeThreshold(){return this._swipeThreshold}primaryCssClass="ch5-triggerview";_activeViewCallback={};_swipeThreshold=30;_activeView=0;_slidesSlot;_ariaSlot;_ariaLiveRegion={};_sendEventShowChildIndexSigName="";_receiveStateShowChildIndexSigName="";_subReceiveStateShowChildIndexId="";_signalIsReceived=!1;slidesManager={};flag=-1;slidesNumber=0;static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}connectedCallback(){const e=()=>{this.info("Ch5TriggerView.connectedCallback()"),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5TriggerView),this.cacheComponentChildrens(),this.initAttributes(),this.updateCssClasses(),this.attachEventListeners(),this._onSlidesSlotChange(),this.id=this.getCrId(),this.slidesManager.prepareSwiperSlides(),this.slidesManager.initSwiper()};this.closest("ch5-modal-dialog")?subscribeInViewPortChange(this,()=>{this.info("ch5-triggerview.subscribeInViewPortChange()"),this.elementIsInViewPort&&!this.wasInstantiatedInViewport&&(this._updateSizeStyleProperties(),e(),this.wasInstantiatedInViewport=!0)}):setTimeout(e)}disconnectedCallback(){this.info("Ch5TriggerView.disconnectedCallback()"),this.removeEvents(),this.unsubscribeFromSignals(),this.slidesManager.destroySwiper()}handleEvent(e){"slotchange"===e.type&&e.target===this._slidesSlot&&this._onSlidesSlotChange()}previousViewChild(){this.slidesManager.slidePrevious()}nextViewChild(){this.slidesManager.slideNext()}setActiveViewChild(e){const t=this.slidesManager.getChildElSwipeIndex(e);null!==t&&(this.activeView=t)}setActiveView(e){this.activeView=e}allowPageAnimation(){return!1===this.gestureable&&!0===this.disableAnimation}attributeChangedCallback(t,i,s){if(i===s)return;this.info('Ch5TriggerView attributeChangedCallback("'+t+'","'+i+'","'+s+')"'),0===this.slidesManager.getSlidesNumber()&&this._onSlidesSlotChange();const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else switch(t){case"activeview":if(i!==s){const e=parseInt(s,10);if(this.slidesManager.getSlidesNumber()>=0&&(e>this.slidesManager.getSlidesNumber()||e<0))return void(this.activeView=0);this.activeView=e}break;case"sendeventshowchildindex":this.hasAttribute("sendeventshowchildindex")?this.sendEventShowChildIndex=s:this.sendEventShowChildIndex="";break;case"receivestateshowchildindex":this.hasAttribute("receivestateshowchildindex")?this.receiveStateShowChildIndex=s:this.receiveStateShowChildIndex="";break;default:super.attributeChangedCallback(t,i,s)}"dir"===t&&(this.style.setProperty("direction","ltr"),this._updateChildrenDirAttr())}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this.info("Ch5TriggerView.unsubscribeFromSignals()");const e=Ch5SignalFactory.getInstance();if(""!==this._subReceiveStateShowChildIndexId&&""!==this._receiveStateShowChildIndexSigName){const t=e.getNumberSignal(this._receiveStateShowChildIndexSigName);null!==t&&(t.unsubscribe(this._subReceiveStateShowChildIndexId),this._receiveStateShowChildIndexSigName="")}}getSlidesAsArray(){return Array.prototype.slice.call(this.slidesManager.getSlidesArray(),0)}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}getPlainActiveView(){return this._activeView}setSwiperSensitivity(e){this.slidesManager.swiperSensitivity=e}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}this.hasAttribute("activeView")||this.setAttribute("activeView","0"),this.hasAttribute("receiveStateShowChildIndex")&&this._upgradeProperty("receiveStateShowChildIndex"),this.hasAttribute("sendEventShowChildIndex")&&this._upgradeProperty("sendEventShowChildIndex")}attachEventListeners(){super.attachEventListeners(),this._slidesSlot.addEventListener("slotchange",this)}removeEvents(){super.removeEventListeners(),this._slidesSlot.removeEventListener("slotchange",this)}_updateSizeStyleProperties(){this.style.width=`${this.offsetWidth}px`}updateCssClasses(){super.updateCssClasses();const e=new Set;e.add(this.primaryCssClass);const t=this.getTargetElementForCssClassesAndStyle();void 0!==t.classList&&this._listOfAllPossibleComponentCssClasses.forEach(i=>{e.has(i)?(t.classList.add(i),this.info("add CSS class",i)):(t.classList.remove(i),this.info("remove CSS class",i))})}generateListOfAllPossibleComponentCssClasses(){const e=this._listOfAllPossibleComponentCssClasses;return e.push(this.primaryCssClass),e}computeTransitionByDistance(e){const t=Math.abs(this._activeView-e);return SPEED_BETWEEN_PAGES*t}_onSlidesSlotChange(){this._slidesSlot.assignedNodes({flatten:!0}).forEach(e=>{e.nodeType===Node.TEXT_NODE&&e.parentNode&&e.parentNode.removeChild(e)})}_updateAriaLiveDom(){1!==this._ariaSlot.assignedNodes().length&&(this._ariaLiveRegion=document.createElement("div"),this._ariaLiveRegion.setAttribute("slot","ariaSlot"),this._ariaLiveRegion.setAttribute("aria-live","polite"),this._ariaLiveRegion.setAttribute("aria-atomic","true"),this.appendChild(this._ariaLiveRegion)),this._ariaLiveRegion.textContent=`Item ${this.activeView} of ${this.slidesManager.getSlidesNumber()} visible`}_updateChildrenDirAttr(){customElements.whenDefined("ch5-triggerview-child").then(()=>{})}_upgradeProperty(e){if(this.constructor.prototype.hasOwnProperty(e)){const t=this[e];delete this[e],this[e]=t}}};"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&window.customElements.define(Ch5TriggerView.ELEMENT_NAME,Ch5TriggerView),Ch5TriggerView.registerSignalAttributeTypes();var LogMessage=class{date={};level=1;message="";source="";constructor(e,t){const i=new Date;this.date=i,this.message=e.message,this.level=e.level,this.source=e.source}getStringTime(){return`[${this.date.getHours()}:${this.date.getMinutes()}:${this.date.getSeconds()}]`}toString(){return`[level ${this.level}][${this.source}] ${this.getStringTime()} - ${this.message}`}};import isNil23 from"lodash/isNil";var LogMessagesFilter=class e{_regularExpression="";level;source=Ch5Debug.getConfigKeyValue(Ch5Debug.DEBUG_MESSAGE_FILTER_SOURCE_KEY);static getDefaultLevel(){const e=Ch5Debug.getConfigKeyValue(Ch5Debug.DEBUG_MESSAGE_FILTER_LEVEL_KEY);return e||2}constructor(t,i,s){this.level=isNil23(t)?e.getDefaultLevel():t,this.regularExpression=s||this._regularExpression,this.source=i||this.source}get regularExpression(){return this._regularExpression}set regularExpression(e){if(isNil23(e))this._regularExpression="";else{if("/"===e.charAt(0)&&"/"===e.charAt(e.length-1)){const t=e.lastIndexOf("/");return void(this._regularExpression=e.substr(1).substring(0,t-1))}this._regularExpression=e}}undateSourceFromConfig(){this.source=Ch5Debug.getConfigKeyValue(Ch5Debug.DEBUG_MESSAGE_FILTER_SOURCE_KEY)}clearFilter(){this.level=e.getDefaultLevel(),this.regularExpression="",this.source=""}applyFilter(e){const t=this.isMatchingFilterLevel(e.level),i=this.isMatchingFilterRegex(e.message),s=this.isMatchingFilterSource(e.source);return t&&i&&s}isMatchingFilterLevel(e){return e>=this.level}isMatchingFilterRegex(e){if(!this.regularExpression)return!0;return!!new RegExp(this.regularExpression,"i").test(e)}isMatchingFilterSource(e){return!this.source||!isNil23(e)&&e.indexOf(this.source)>-1}};import{timer,BehaviorSubject as BehaviorSubject2}from"rxjs";import isNil24 from"lodash/isNil";var AbstractAppender=class{_sendLogTimeOffset={};isInitialized=!1;isInitializedSubject=new BehaviorSubject2(this.isInitialized);constructor(e){this.sendLogTimeOffset=timer(e)}set sendLogTimeOffset(e){isNil24(e)||(this._sendLogTimeOffset=e)}get sendLogTimeOffset(){return this._sendLogTimeOffset}};import isNil25 from"lodash/isNil";import{BehaviorSubject as BehaviorSubject3}from"rxjs";var Logger=class e{static _instance;_subscribeDockerStatus=new BehaviorSubject3("");_appender={};_logFilter=new LogMessagesFilter;_messagesQueue=[];originalConsole;static getInstance(t,i){return void 0===e._instance&&(e._instance=new e(t,i)),e._instance}disconnect(){console.log=this.originalConsole.log,console.error=this.originalConsole.error,console.info=this.originalConsole.info,console.warn=this.originalConsole.warn,this.appender.closeSocketConnection()}constructor(e,t){if(!(e instanceof AbstractAppender))throw Error("Appender is not defined");this.originalConsole={log:console.log,error:console.error,info:console.info,warn:console.warn},this.appender=e,this.addWindowErrorListener(),this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),t&&(this.logFilter=t),this._appender.isInitializedSubject.subscribe(e=>{e&&this.checkAndAppendMessages()})}get subscribeDockerStatus(){return this._subscribeDockerStatus}set subscribeDockerStatus(e){this._subscribeDockerStatus=e}set logFilter(e){isNil25(e)?this._logFilter=new LogMessagesFilter:this._logFilter=new LogMessagesFilter(e.level,e.source,e.regularExpression)}get logFilter(){return this._logFilter}log(...e){const t=this.formatMessage(0,e.join(" "));this.queueMessage(t)}info(...e){const t=this.formatMessage(1,e.join(" "));this.queueMessage(t)}warn(e){const t=this.formatMessage(2,e);this.queueMessage(t)}error(e,t){t&&(e+=String(t));const i=this.formatMessage(3,e);this.queueMessage(i)}windowErrorListener(e){e instanceof ErrorEvent?this.error(e.message,e.lineno):e instanceof CustomEvent&&this.error(e.detail)}restoreConsole(){console.log=this.originalConsole.log,console.error=this.originalConsole.error,console.info=this.originalConsole.info,console.warn=this.originalConsole.warn}addWindowErrorListener(){window.addEventListener("error",e=>{this.windowErrorListener(e)})}set appender(e){e instanceof AbstractAppender&&(this._appender=e)}get appender(){return this._appender}formatMessage(e,t){const i=t.indexOf(":"),s=i>-1?t.slice(0,i):"",n=i>-1?t.slice(i):t;return new LogMessage({level:e,message:n,source:s},this.logFilter)}checkAndAppendMessages(){for(;this._messagesQueue.length>0;){if(!this._appender.isInitialized)return;const e=this._messagesQueue.shift();e&&this.logFilter.applyFilter(e)&&this.appender.log(e)}}queueMessage(e){this._messagesQueue.push(e),this.checkAndAppendMessages()}};function getLogger(e,t,i){const s=Logger.getInstance(e,i);return e.configObserver(s,!!i),t&&(console.log=s.log,console.error=s.error,console.info=s.info,console.warn=s.warn),s}function uriSchemaValidation(e){return""!==e}import Axios from"axios";var RequestService=class{_uri="";_requestAPI={};constructor(e){this.uri=e,this._requestAPI=Axios}async post(e,t){return 200===(await this._requestAPI.post(`${this._uri}/${e}`,JSON.stringify(t),{headers:{"content-type":"application/json;charset=utf8"}})).status}get(e){try{return this._requestAPI.get(`${this._uri}/${e}`)}catch(e){return!1}}set uri(e){if(!uriSchemaValidation(e))throw new Error("Invalid URI schema");this._uri=e}get uri(){return this._uri}},RemoteAppender=class e extends AbstractAppender{static _instance;webSocket={};_requestService={};_address="";static getInstance(t,i){return void 0===e._instance&&(e._instance=new e(t,i)),e._instance}closeSocketConnection(){this.webSocket&&this.webSocket.readyState&&1===this.webSocket.readyState&&this.webSocket.close()}constructor(e,t){super(e),t.hostname&&t.port&&this.setIP(t)}log(e){this.sendLogTimeOffset.subscribe(()=>{this._requestService.post("log",e)})}resetIP(e,t,i=!1){const s={hostname:e,port:t,secure:i};this.setIP(s)}setIP(e){if(""===e.hostname||""===e.port)return;const t=`${e.secure?"https":"http"}://${e.hostname}:${e.port}`;this._address=`${e.hostname}:${e.port}`,this.initializeRequest(t)}configObserver(e,t){if(e.subscribeDockerStatus.next("DOCKER_CONNECTING"),!t){const t=this._requestService.get("configuration");t&&t instanceof Promise&&t.then(t=>{const i=t.data;e.logFilter=new LogMessagesFilter(i.level,i.source,i.regularExpression),this.isInitialized=!0,this.isInitializedSubject.next(this.isInitialized),e.subscribeDockerStatus.next("DOCKER_CONNECTED")})}this.webSocket=new WebSocket(`ws://${this._address}`),this.webSocket.onopen=()=>{this.webSocket.onmessage=t=>{const i=JSON.parse(t.data).filter;e.logFilter=new LogMessagesFilter(i.level,i.source,i.regularExpression),e.subscribeDockerStatus.next("DOCKER_CONNECTED")}},this.webSocket.onclose=t=>{let i="";3001!==t.code&&1e3!==t.code||(i="DOCKER_DISCONNECTED",this.webSocket={},e.logFilter=new LogMessagesFilter,this.isInitialized=!1,this.isInitializedSubject.next(this.isInitialized),e.subscribeDockerStatus.next(i))},this.webSocket.onerror=t=>{e.subscribeDockerStatus.next("DOCKER_ERROR")}}initializeRequest(e){this._requestService=new RequestService(e)}},AppenderFactory=class{getAppender(e,t=0,i){if("remote"===e)return RemoteAppender.getInstance(t,i);throw new Error("Appender type is invalid")}};function getRemoteAppender(e,t,i){const s={hostname:e,port:t,secure:i};return(new AppenderFactory).getAppender("remote",0,s)}var CH5VideoUtils=class{static VIDEO_ACTION={START:"start",STARTED:"started",STOP:"stop",STOPPED:"stopped",RESIZE:"resize",RESIZED:"resized",REFILL:"refill",SNAPSHOT:"snapshot",MARK:"mark",NOURL:"nourl",FULLSCREEN:"fullscreen",ERROR:"error",EMPTY:""}};import _39 from"lodash";var Ch5VideoSnapshot=class{url="";userId="";password="";refreshRate=5;snapshotTimer=null;videoImage=new Image;sendEventSnapshotStatus="";sendEventSnapshotLastUpdateTime="";constructor(){this.videoImage.alt="Video Snapshot",this.videoImage.classList.add("hide")}startLoadingSnapshot(){""!==this.url.trim()&&-1!==this.refreshRate&&(this.canProcessUri()&&!this.url.startsWith("ch5-img")&&this.processUri(),this.snapshotTimer&&(window.clearInterval(this.snapshotTimer),this.snapshotTimer=null),this.setSnapshot(),this.videoImage.classList.remove("hide"),0!==this.refreshRate&&(this.snapshotTimer=window.setInterval(()=>{this.snapshotTimer&&this.setSnapshot()},1e3*this.refreshRate,0)))}stopLoadingSnapshot(){this.videoImage.removeAttribute("src"),window.clearInterval(this.snapshotTimer),this.snapshotTimer=null,this.videoImage.classList.add("hide")}splitUrl(){const e=this.url.split("@")[0].split("//")[1];if(!1===e.includes(":"))return console.warn("Please use valid url format"),!1;const t=this.url.split("@")[0].split("//")[0];return this.userId=e.split(":")[0],this.password=e.split(":")[1],this.url=t+"//"+this.url.split("@")[1],!0}canProcessUri(){return!(_39.isEmpty(this.password)||_39.isEmpty(this.userId)||_39.isEmpty(this.url))||!!this.url.includes("@")&&this.splitUrl()}processUri(){const{http:e,https:t}={http:"ch5-img-auth",https:"ch5-img-auths"},i=new Ch5ImageUriModel({http:e,https:t},this.userId,this.password,this.url);i.isValidAuthenticationUri()&&(this.url=i.toString())}setSnapshot(){var e;this.videoImage.onerror=()=>{var e;null!==this.sendEventSnapshotStatus&&void 0!==this.sendEventSnapshotStatus&&""!==this.sendEventSnapshotStatus&&(null==(e=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventSnapshotStatus))||e.publish(2))},this.videoImage.onload=e=>{var t;null!==this.sendEventSnapshotStatus&&void 0!==this.sendEventSnapshotStatus&&""!==this.sendEventSnapshotStatus&&(null==(t=Ch5SignalFactory.getInstance().getNumberSignal(this.sendEventSnapshotStatus))||t.publish(1))},this.videoImage.src=this.url+"#"+(new Date).toISOString(),null!==this.sendEventSnapshotLastUpdateTime&&void 0!==this.sendEventSnapshotLastUpdateTime&&""!==this.sendEventSnapshotLastUpdateTime&&(null==(e=Ch5SignalFactory.getInstance().getStringSignal(this.sendEventSnapshotLastUpdateTime))||e.publish(this.videoImage.src))}getImage(){return this.videoImage}},Ch5VideoTouchManager=class{customOnTouchHandlers;constructor(e){this._onTouchStart=this._onTouchStart.bind(this),document.addEventListener("touchstart",this._onTouchStart),this._onTouchMove=this._onTouchMove.bind(this),document.addEventListener("touchmove",this._onTouchMove),this._onTouchEnd=this._onTouchEnd.bind(this),document.addEventListener("touchend",this._onTouchEnd),this._onTouchCancel=this._onTouchCancel.bind(this),document.addEventListener("touchcancel",this._onTouchCancel),this.customOnTouchHandlers=this.updateHandlersIfUnavailable(e)}updateHandlersIfUnavailable(e){return{pollingDuration:this.checkAndReturnDefault(e.pollingDuration,300),onTouchStartHandler:this.checkAndReturnDefault(e.onTouchStartHandler,()=>{console.log("empty onTouchStartHandler")}),onTouchMoveHandler:this.checkAndReturnDefault(e.onTouchMoveHandler,()=>{console.log("empty onTouchMoveHandler")}),onTouchEndHandler:this.checkAndReturnDefault(e.onTouchEndHandler,()=>{console.log("empty onTouchEndHandler")}),onTouchCancelHandler:this.checkAndReturnDefault(e.onTouchCancelHandler,()=>{console.log("empty onTouchCancelHandler")}),componentID:e.componentID}}_onTouchStart(e){this.customOnTouchHandlers.onTouchStartHandler()}_onTouchMove(e){this.customOnTouchHandlers.onTouchMoveHandler()}_onTouchEnd(e){this.customOnTouchHandlers.onTouchEndHandler()}_onTouchCancel(e){this.customOnTouchHandlers.onTouchCancelHandler()}checkAndReturnDefault(e,t){return null!=e&&e?e:t}destructor(){document.removeEventListener("touchstart",this._onTouchStart),document.removeEventListener("touchmove",this._onTouchMove),document.removeEventListener("touchend",this._onTouchEnd),document.removeEventListener("touchcancel",this._onTouchCancel)}};import _40 from"lodash";var Ch5Video=class e extends Ch5Common{static SVG_ICONS={FULLSCREEN_ICON:'<svg xmlns="http://www.w3.org/2000/svg" class="svgIconStyle" class="svgIconStyle" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>'};static ASPECT_RATIO=["16:9","4:3"];static SOURCE_TYPE=["Network","HDMI"];static SIZE=["regular","x-small","small","large","x-large","xx-large"];static COMPONENT_DATA={ASPECT_RATIO:{default:e.ASPECT_RATIO[0],values:e.ASPECT_RATIO,key:"aspectRatio",attribute:"aspectRatio",classListPrefix:"--aspect-ratio-"},SIZE:{default:e.SIZE[0],values:e.SIZE,key:"size",attribute:"size",classListPrefix:"--size-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestateplay:{direction:"state",booleanJoin:1,contractName:!0},receivestateselect:{direction:"state",numericJoin:1,contractName:!0},receivestateurl:{direction:"state",stringJoin:1,contractName:!0},receivestatesourcetype:{direction:"state",stringJoin:1,contractName:!0},receivestateuserid:{direction:"state",stringJoin:1,contractName:!0},receivestatepassword:{direction:"state",stringJoin:1,contractName:!0},receivestatesnapshoturl:{direction:"state",stringJoin:1,contractName:!0},receivestatesnapshotrefreshrate:{direction:"state",numericJoin:1,contractName:!0},receivestatesnapshotuserid:{direction:"state",stringJoin:1,contractName:!0},receivestatesnapshotpassword:{direction:"state",stringJoin:1,contractName:!0},receivestatevideocount:{direction:"state",numericJoin:1,contractName:!0},sendeventonclick:{direction:"event",booleanJoin:1,contractName:!0},sendeventselectionchange:{direction:"event",numericJoin:1,contractName:!0},sendeventselectionsourcetype:{direction:"event",stringJoin:1,contractName:!0},sendeventselectionurl:{direction:"event",stringJoin:1,contractName:!0},sendeventsnapshoturl:{direction:"event",stringJoin:1,contractName:!0},sendeventstate:{direction:"event",numericJoin:1,contractName:!0},sendeventerrorcode:{direction:"event",numericJoin:1,contractName:!0},sendeventerrormessage:{direction:"event",stringJoin:1,contractName:!0},sendeventretrycount:{direction:"event",numericJoin:1,contractName:!0},sendeventresolution:{direction:"event",stringJoin:1,contractName:!0},sendeventsnapshotstatus:{direction:"event",numericJoin:1,contractName:!0},sendeventsnapshotlastupdatetime:{direction:"event",stringJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:"",name:"indexId",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.ASPECT_RATIO[0],enumeratedValues:e.ASPECT_RATIO,name:"aspectRatio",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ASPECT_RATIO[0],isObservableProperty:!0},{default:!1,name:"stretch",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!1,isObservableProperty:!0},{default:"",name:"url",nameForSignal:"receiveStateURL",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.SOURCE_TYPE[0],enumeratedValues:e.SOURCE_TYPE,name:"sourceType",removeAttributeOnNull:!0,nameForSignal:"receiveStateSourceType",type:"enum",valueOnAttributeEmpty:e.SOURCE_TYPE[0],isObservableProperty:!0},{default:"",name:"userId",nameForSignal:"receiveStateUserId",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"password",nameForSignal:"receiveStatePassword",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"snapshotURL",nameForSignal:"receiveStateSnapshotURL",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:5,name:"snapshotRefreshRate",removeAttributeOnNull:!0,nameForSignal:"receiveStateSnapshotRefreshRate",type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:60,conditionalMin:0,conditionalMax:60,conditionalMinValue:0,conditionalMaxValue:60},isObservableProperty:!0},{default:"",name:"snapshotUserId",nameForSignal:"receiveStateSnapshotUserId",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"snapshotPassword",nameForSignal:"receiveStateSnapshotPassword",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.SIZE[0],enumeratedValues:e.SIZE,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZE[0],isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStatePlay",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!0,name:"show",nameForSignal:"receiveStateShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateShow",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSelect",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateURL",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSourceType",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateUserId",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStatePassword",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSnapshotURL",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSnapshotRefreshRate",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSnapshotUserId",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateSnapshotPassword",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateVideoCount",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventOnClick",signalType:"boolean",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventSelectionChange",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventSelectionSourceType",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventSelectionURL",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventSnapshotURL",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventState",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventErrorCode",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventErrorMessage",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventRetryCount",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventResolution",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventSnapshotStatus",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"sendEventSnapshotLastUpdateTime",signalType:"string",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];static ELEMENT_NAME="ch5-video";primaryCssClass="ch5-video";_ch5Properties;_elContainer={};_fullScreenIcon={};responseObj={};parentCh5Background=[];INTERSECTION_RATIO_VALUE=.98;playValue=!0;lastResponseStatus="";lastRequestStatus="";orientationChanged=!1;isVideoPublished=!1;isFullScreen=!1;isSwipeDebounce;stopDebounce;controlTimer;snapshotImage=new Ch5VideoSnapshot;videoErrorMessages=new Map;maxVideoCount=1;selectedVideo=0;retryCount=0;ch5UId=0;videoTouchHandler={};isTouchInProgress=!1;swipeDeltaCheckNum=1;touchCoordinates={startX:0,startY:0,endX:0,endY:0};signalHolder=[];set indexId(e){this._ch5Properties.set("indexId",e.trim())}get indexId(){return this._ch5Properties.get("indexId")}set aspectRatio(e){this._ch5Properties.set("aspectRatio",e,()=>{this.handleAspectRatio()})}get aspectRatio(){return this._ch5Properties.get("aspectRatio")}set stretch(e){this._ch5Properties.set("stretch",e,()=>{this.handleStretch()})}get stretch(){return this._ch5Properties.get("stretch")}set url(e){this._ch5Properties.set("url",e.trim(),()=>{this.sendEvent(this.sendEventSelectionURL,this.url),this.checkUrlAndPublishVideo()})}get url(){return this._ch5Properties.get("url")}set sourceType(e){this._ch5Properties.set("sourceType",e,()=>{this.sendEvent(this.sendEventSelectionSourceType,this.sourceType),this.videoIntersectionObserver()})}get sourceType(){return this._ch5Properties.get("sourceType")}set userId(e){this._ch5Properties.set("userId",e.trim(),()=>{(this.userId.trim().includes("@")||this.userId.trim().includes(":"))&&console.warn("Please avoid using '@' and ':' characters for userid and password"),this.videoIntersectionObserver()})}get userId(){return this._ch5Properties.get("userId")}set password(e){this._ch5Properties.set("password",e.trim(),()=>{(this.password.trim().includes("@")||this.password.trim().includes(":"))&&console.warn("Please avoid using '@' and ':' characters for userid and password"),this.videoIntersectionObserver()})}get password(){return this._ch5Properties.get("password")}set snapshotURL(e){this._ch5Properties.set("snapshotURL",e.trim(),()=>{this.sendEvent(this.sendEventSnapshotURL,this.snapshotURL),this.validateAndAttachSnapshot()})}get snapshotURL(){return this._ch5Properties.get("snapshotURL")}set snapshotRefreshRate(e){this._ch5Properties.set("snapshotRefreshRate",e,()=>{this.validateAndAttachSnapshot()})}get snapshotRefreshRate(){return this._ch5Properties.get("snapshotRefreshRate")}set snapshotUserId(e){this._ch5Properties.set("snapshotUserId",e,()=>{this.validateAndAttachSnapshot()})}get snapshotUserId(){return this._ch5Properties.get("snapshotUserId")}set snapshotPassword(e){this._ch5Properties.set("snapshotPassword",e,()=>{this.validateAndAttachSnapshot()})}get snapshotPassword(){return this._ch5Properties.get("snapshotPassword")}set size(e){this._ch5Properties.set("size",e,()=>{this.handleSize()})}get size(){return this._ch5Properties.get("size")}set receiveStatePlay(e){this._ch5Properties.set("receiveStatePlay",e,null,e=>{this.handleReceiveStatePlay(e)})}get receiveStatePlay(){return this._ch5Properties.get("receiveStatePlay")}set receiveStateSelect(e){this._ch5Properties.set("receiveStateSelect",e,null,e=>{this.selectedVideo!==e&&(this.selectedVideo=e,e>=0&&e<this.maxVideoCount&&(this.sendEvent(this.sendEventSelectionChange,this.selectedVideo),this.handleReceiveStateSelect(e)))})}get receiveStateSelect(){return this._ch5Properties.get("receiveStateSelect")}set receiveStateURL(e){this._ch5Properties.set("receiveStateURL",e,null)}get receiveStateURL(){return this._ch5Properties.get("receiveStateURL")}set receiveStateSourceType(e){this._ch5Properties.set("receiveStateSourceType",e,null)}get receiveStateSourceType(){return this._ch5Properties.get("receiveStateSourceType")}set receiveStateUserId(e){this._ch5Properties.set("receiveStateUserId",e,null)}get receiveStateUserId(){return this._ch5Properties.get("receiveStateUserId")}set receiveStatePassword(e){this._ch5Properties.set("receiveStatePassword",e,null)}get receiveStatePassword(){return this._ch5Properties.get("receiveStatePassword")}set receiveStateSnapshotURL(e){this._ch5Properties.set("receiveStateSnapshotURL",e,null)}get receiveStateSnapshotURL(){return this._ch5Properties.get("receiveStateSnapshotURL")}set receiveStateSnapshotRefreshRate(e){this._ch5Properties.set("receiveStateSnapshotRefreshRate",e,null)}get receiveStateSnapshotRefreshRate(){return this._ch5Properties.get("receiveStateSnapshotRefreshRate")}set receiveStateSnapshotUserId(e){this._ch5Properties.set("receiveStateSnapshotUserId",e,null)}get receiveStateSnapshotUserId(){return this._ch5Properties.get("receiveStateSnapshotUserId")}set receiveStateSnapshotPassword(e){this._ch5Properties.set("receiveStateSnapshotPassword",e,null)}get receiveStateSnapshotPassword(){return this._ch5Properties.get("receiveStateSnapshotPassword")}set receiveStateVideoCount(e){this._ch5Properties.set("receiveStateVideoCount",e,null,e=>{e>=1&&e<=32&&(this.maxVideoCount=e,this.selectedVideo>=0&&this.selectedVideo<this.maxVideoCount&&this.handleReceiveStateSelect(this.selectedVideo))})}get receiveStateVideoCount(){return this._ch5Properties.get("receiveStateVideoCount")}set sendEventOnClick(e){this._ch5Properties.set("sendEventOnClick",e)}get sendEventOnClick(){return this._ch5Properties.get("sendEventOnClick")}set sendEventSelectionChange(e){this._ch5Properties.set("sendEventSelectionChange",e)}get sendEventSelectionChange(){return this._ch5Properties.get("sendEventSelectionChange")}set sendEventSelectionSourceType(e){this._ch5Properties.set("sendEventSelectionSourceType",e)}get sendEventSelectionSourceType(){return this._ch5Properties.get("sendEventSelectionSourceType")}set sendEventSelectionURL(e){this._ch5Properties.set("sendEventSelectionURL",e)}get sendEventSelectionURL(){return this._ch5Properties.get("sendEventSelectionURL")}set sendEventSnapshotURL(e){this._ch5Properties.set("sendEventSnapshotURL",e)}get sendEventSnapshotURL(){return this._ch5Properties.get("sendEventSnapshotURL")}set sendEventState(e){this._ch5Properties.set("sendEventState",e)}get sendEventState(){return this._ch5Properties.get("sendEventState")}set sendEventErrorCode(e){this._ch5Properties.set("sendEventErrorCode",e)}get sendEventErrorCode(){return this._ch5Properties.get("sendEventErrorCode")}set sendEventErrorMessage(e){this._ch5Properties.set("sendEventErrorMessage",e)}get sendEventErrorMessage(){return this._ch5Properties.get("sendEventErrorMessage")}set sendEventRetryCount(e){this._ch5Properties.set("sendEventRetryCount",e)}get sendEventRetryCount(){return this._ch5Properties.get("sendEventRetryCount")}set sendEventResolution(e){this._ch5Properties.set("sendEventResolution",e)}get sendEventResolution(){return this._ch5Properties.get("sendEventResolution")}set sendEventSnapshotStatus(e){this._ch5Properties.set("sendEventSnapshotStatus",e)}get sendEventSnapshotStatus(){return this._ch5Properties.get("sendEventSnapshotStatus")}set sendEventSnapshotLastUpdateTime(e){this._ch5Properties.set("sendEventSnapshotLastUpdateTime",e)}get sendEventSnapshotLastUpdateTime(){return this._ch5Properties.get("sendEventSnapshotLastUpdateTime")}set show(e){this._ch5Properties.set("show",e,()=>{this.handleReceiveStateShow()})}get show(){return this._ch5Properties.get("show")}set receiveStateShow(e){this._ch5Properties.set("receiveStateShow",e,null,e=>{this._ch5Properties.setForSignalResponse("show",e,()=>{this.handleReceiveStateShow()})})}get receiveStateShow(){return this._ch5Properties.get("receiveStateShow")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.ignoreAttributes=["show","receiveStateShow","receivestateshowpulse","receivestatehidepulse","sendeventonshow"],this.logger.start("constructor()",e.ELEMENT_NAME),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass(),this.setErrorMessages(),subscribeState("o","Csig.video.response",this._videoResponse.bind(this),this._errorResponse.bind(this)),subscribeState("b","Csig.Backlight_Off_fb",this.standByOff.bind(this))}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-video attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5Video),this._elContainer.parentElement!==this&&this.appendChild(this._elContainer),this.ch5UId=parseInt(this.getCrId().split("cr-id-")[1],0),this.setAttribute("data-ch5-id",this.getCrId()),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.sendEvent(this.sendEventState,0),this.handleMultiVideo(),customElements.whenDefined("ch5-video").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.getCrId())}),Ch5CoreIntersectionObserver.getInstance().observe(this,this.videoIntersectionObserver.bind(this)),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.clearMultiSignal(),this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP);const e=[];if(!0===this.isVideoPublished){const t=document.querySelectorAll("ch5-background");Array.from(t).forEach(t=>{"ch5-background"===t.nodeName.toLowerCase()&&e.push(t)}),Array.from(e).forEach(e=>e.refillBackground())}this.selectedVideo=0,this.maxVideoCount=1,this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._elContainer.classList.add(this.primaryCssClass),this._fullScreenIcon=document.createElement("a"),this._fullScreenIcon.classList.add("full-screen-icon"),this._fullScreenIcon.classList.add("hide"),this._fullScreenIcon.innerHTML=e.SVG_ICONS.FULLSCREEN_ICON,this._elContainer.appendChild(this._fullScreenIcon),this._elContainer.appendChild(this.snapshotImage.getImage()),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),this._elContainer.addEventListener("click",this._manageControls.bind(this)),this._fullScreenIcon.addEventListener("click",this.toggleFullScreen.bind(this)),window.addEventListener("resize",this.handleOrientation)}removeEventListeners(){super.removeEventListeners(),this._elContainer.removeEventListener("click",this._manageControls.bind(this)),this._fullScreenIcon.removeEventListener("click",this.toggleFullScreen.bind(this)),window.removeEventListener("resize",this.handleOrientation)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}standByOff(e){var t,i;!1===e&&(null==(t=this.responseObj)?void 0:t.id)&&(null==(i=this.responseObj)?void 0:i.id)===this.ch5UId&&this.isFullScreen&&(this.orientationChanged=!0)}handleAspectRatio(){Array.from(e.COMPONENT_DATA.ASPECT_RATIO.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.ASPECT_RATIO.classListPrefix+t.replace(":","-"))}),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.ASPECT_RATIO.classListPrefix+this.aspectRatio.replace(":","-"))}handleStretch(){!0===this.stretch?(this._elContainer.classList.add(this.primaryCssClass+"--stretch-true"),this.style.width="100%",this.style.height="100%"):(this._elContainer.classList.remove(this.primaryCssClass+"--stretch-true"),this.style.removeProperty("width"),this.style.removeProperty("height"))}handleSize(){Array.from(e.COMPONENT_DATA.SIZE.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+t)}),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+this.size)}handleReceiveStatePlay(e){this.playValue=e,!1===this.playValue?(this.snapshotImage.stopLoadingSnapshot(),this.isFullScreen&&(this.orientationChanged=!0),this.sendEvent(this.sendEventSnapshotStatus,0),this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP)):this.isFullScreen?this.publishVideo(CH5VideoUtils.VIDEO_ACTION.START):this.videoIntersectionObserver()}handleReceiveStateSelect(e){const t=this.signalHolder[e].url.value;t&&this.urlCB(t);const i=this.signalHolder[e].userId.value;i&&this.userIdCB(i);const s=this.signalHolder[e].password.value;s&&this.passwordCB(s);const n=this.signalHolder[e].sourceType.value;n&&this.sourceTypeCB(n);const r=this.signalHolder[e].snapshotURL.value;r&&this.snapshotURLCB(r);const a=this.signalHolder[e].snapshotUserId.value;a&&this.snapshotUserIdCB(a);const l=this.signalHolder[e].snapshotPassword.value;l&&this.snapshotPasswordCB(l);const o=this.signalHolder[e].snapshotRefreshRate.value;o&&this.snapshotRefreshRateCB(o)}handleReceiveStateShow(){!0===this.show?this.isFullScreen?this.publishVideo(CH5VideoUtils.VIDEO_ACTION.START):this.videoIntersectionObserver():this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP)}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.ASPECT_RATIO.classListPrefix+this.aspectRatio.replace(":","-")),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}stopAndRefill(){this.ch5BackgroundRequest(CH5VideoUtils.VIDEO_ACTION.REFILL),this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP)}videoIntersectionObserver(){this.elementIntersectionEntry.intersectionRatio>=this.INTERSECTION_RATIO_VALUE&&this.playValue&&this.show?(this.validateAndAttachSnapshot(),this.videoInViewPort()):this.videoNotInViewport(),this.elementIntersectionEntry.intersectionRatio>.1&&this.playValue?this.addTouchEvent():(this.stopAndRefill(),this.removeTouchEvent())}videoInViewPort(){this.snapshotImage.startLoadingSnapshot(),clearTimeout(this.isSwipeDebounce),this.isSwipeDebounce=setTimeout(()=>{this.publishVideo(CH5VideoUtils.VIDEO_ACTION.START)},300)}videoNotInViewport(){this.isFullScreen||(this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP),this.ch5BackgroundRequest(CH5VideoUtils.VIDEO_ACTION.REFILL))}videoStopObjJSON(e,t){const i={action:e,id:t};return this.logger.log("Stop Video Request:",i),this.sendEvent(this.sendEventState,3),i}videoStartObjJSON(e){let{left:t,top:i,width:s,height:n}=this._elContainer.getBoundingClientRect();(e===CH5VideoUtils.VIDEO_ACTION.FULLSCREEN||this.isFullScreen)&&(e===CH5VideoUtils.VIDEO_ACTION.FULLSCREEN&&(e=CH5VideoUtils.VIDEO_ACTION.RESIZE),t=0,i=0,s=window.innerWidth,n=window.innerHeight,window.innerWidth<window.innerHeight?"4:3"===this.aspectRatio?(s=window.innerWidth,n=window.innerWidth/4*3,i=(window.innerHeight-n)/2):(s=window.innerWidth,n=window.innerWidth/16*9,i=(window.innerHeight-n)/2):"4:3"===this.aspectRatio?(n=window.innerHeight,s=window.innerHeight/3*4,s>window.innerWidth&&(s=window.innerWidth),t=(window.innerWidth-s)/2):(n=window.innerHeight,s=window.innerHeight/9*16,s>window.innerWidth&&(s=window.innerWidth),t=(window.innerWidth-s)/2));const r={action:e,id:this.ch5UId,credentials:{userid:this.userId,password:this.password},source:{type:this.sourceType,url:"hdmi"===this.sourceType.toLowerCase()?"http:hdmi":this.url},location:{top:Math.ceil(i),left:Math.ceil(t),width:Math.ceil(s),height:Math.ceil(n),z:0},alphablend:!this.isFullScreen,starttime:(new Date).getMilliseconds(),endtime:(new Date).getMilliseconds()+2e3,timing:"linear"};return this.sendEvent(this.sendEventResolution,s+"x"+n),this.logger.log("Start Video Request:",r),r}validateVideoUrl(e){return e.startsWith("rtsp://")||e.startsWith("http://")||e.startsWith("https://")}publishVideo(e){switch(e){case CH5VideoUtils.VIDEO_ACTION.START:""!==this.url&&!1!==this.validateVideoUrl(this.url)||"network"!==this.sourceType.toLowerCase()?(this.isVideoPublished=!0,publishEvent("o","Csig.video.request",this.videoStartObjJSON(CH5VideoUtils.VIDEO_ACTION.START))):this.checkUrlAndPublishVideo();break;case CH5VideoUtils.VIDEO_ACTION.STOP:if(!1===this.isVideoPublished)return;window.clearTimeout(this.stopDebounce),this.stopDebounce=window.setTimeout(()=>publishEvent("o","Csig.video.request",this.videoStopObjJSON(e,this.ch5UId)),300);break;case CH5VideoUtils.VIDEO_ACTION.RESIZE:case CH5VideoUtils.VIDEO_ACTION.FULLSCREEN:if(!1===this.isVideoPublished)return;publishEvent("o","Csig.video.request",this.videoStartObjJSON(e))}this.lastRequestStatus=e}_videoResponse(e){this.responseObj="string"==typeof e?JSON.parse(e):e;const t=!Object.keys(e).length;if(this.responseObj.id===this.ch5UId&&!t&&-1!==this.responseObj.id&&this.responseObj.id&&this.ch5UId===this.responseObj.id&&"queued"!==this.responseObj.status){switch(this.logger.log("Video Response:",this.responseObj),this.lastResponseStatus=this.responseObj.status.toLowerCase(),this.lastResponseStatus===CH5VideoUtils.VIDEO_ACTION.STARTED||this.lastRequestStatus===CH5VideoUtils.VIDEO_ACTION.RESIZE&&this.lastResponseStatus===CH5VideoUtils.VIDEO_ACTION.RESIZED||this._fullScreenIcon.classList.add("hide"),this.responseObj.status.toLowerCase()){case"started":this.ch5BackgroundRequest("started"),this.sendEvent(this.sendEventState,2);break;case"stopped":this.ch5BackgroundRequest("stop"),this.sendEvent(this.sendEventState,1);break;case"error":this.ch5BackgroundRequest("error"),this.sendEvent(this.sendEventState,7);break;case"connecting":this.sendEvent(this.sendEventState,4);break;case"retrying":this.sendEvent(this.sendEventState,6),this.retryCount=this.retryCount+1,this.sendEvent(this.sendEventRetryCount,this.retryCount);break;case"buffering":this.sendEvent(this.sendEventState,5);break;default:this.logger.log("video is in "+this.responseObj.status.toLowerCase()+" state")}this.sendEvent(this.sendEventErrorCode,Number(this.responseObj.statuscode)),this.sendEvent(this.sendEventErrorMessage,this.videoErrorMessages.get(Number(this.responseObj.statuscode))||"Unknown Error Message")}}_errorResponse(e){this.info("Ch5Video - Error when the video response",e)}sendEvent(e,t){var i,s,n,r;if(0!==(null==e?void 0:e.trim().length)&&null!=e)switch(typeof t){case"boolean":null==(i=Ch5SignalFactory.getInstance().getBooleanSignal(e))||i.publish(!0),null==(s=Ch5SignalFactory.getInstance().getBooleanSignal(e))||s.publish(!1);break;case"string":null==(n=Ch5SignalFactory.getInstance().getStringSignal(e))||n.publish(t);break;case"number":null==(r=Ch5SignalFactory.getInstance().getNumberSignal(e))||r.publish(t)}}ch5BackgroundRequest(e){switch(e){case"nourl":this.clearBackgroundOfVideoWrapper(!1),this.snapshotImage.stopLoadingSnapshot(),this.sendEvent(this.sendEventSnapshotStatus,0),this._elContainer.style.borderBottom="1rem solid #828282";break;case"refill":if(!1===this.isVideoPublished)return;this.ch5BackgroundAction("refill");break;case"resize":this.ch5BackgroundAction("resize");break;case"started":this.clearBackgroundOfVideoWrapper(!0),this._elContainer.style.removeProperty("border-bottom"),this.snapshotImage.stopLoadingSnapshot(),this.sendEvent(this.sendEventSnapshotStatus,0),this.ch5BackgroundAction("started");break;case"stop":this.clearBackgroundOfVideoWrapper(!1),this._elContainer.style.removeProperty("border-bottom"),this.ch5BackgroundAction("stop");break;case"error":this.clearBackgroundOfVideoWrapper(!1),this._elContainer.style.borderBottom="1rem solid #CF142B"}}ch5BackgroundAction(e){const t={action:e,id:this.getCrId(),top:this._elContainer.getBoundingClientRect().top,left:this._elContainer.getBoundingClientRect().left,width:this._elContainer.getBoundingClientRect().width,height:this._elContainer.getBoundingClientRect().height};""!==t.id&&(this.parentCh5Background.length=0,this.getParentBackground(this),Array.from(this.parentCh5Background).forEach(e=>e.videoBGRequest(t)))}clearBackgroundOfVideoWrapper(e){this._elContainer.style.background=e?"transparent":"black"}_manageControls(){if(this.sendEvent(this.sendEventOnClick,!0),this.isFullScreen)return this._elContainer.removeEventListener("touchmove",this.handleTouchEventOnFullScreen,!1),void this._exitFullScreen();(this.lastResponseStatus===CH5VideoUtils.VIDEO_ACTION.STARTED||this.lastRequestStatus===CH5VideoUtils.VIDEO_ACTION.RESIZE&&this.lastResponseStatus===CH5VideoUtils.VIDEO_ACTION.RESIZED)&&this._fullScreenIcon.classList.remove("hide"),clearTimeout(this.controlTimer),this.controlTimer=setTimeout(()=>{this._fullScreenIcon.classList.add("hide")},1e4)}toggleFullScreen(e){this.isFullScreen=!0,this.orientationChanged=!1,this._elContainer.addEventListener("touchmove",this.handleTouchEventOnFullScreen,{passive:!0}),this.classList.add("full-screen"),this._fullScreenIcon.classList.add("hide"),document.body.classList.add("ch5-video-fullscreen"),this.publishVideo(CH5VideoUtils.VIDEO_ACTION.FULLSCREEN),e.stopPropagation()}_exitFullScreen(){this.isFullScreen=!1,this.classList.remove("full-screen"),document.body.classList.remove("ch5-video-fullscreen"),this.orientationChanged?(this.ch5BackgroundRequest("refill"),this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP),this.videoIntersectionObserver()):(this.publishVideo(CH5VideoUtils.VIDEO_ACTION.RESIZE),setTimeout(()=>{this.ch5BackgroundRequest("resize")},100))}handleTouchEventOnFullScreen(e){e.preventDefault(),e.stopImmediatePropagation()}handleMultiVideo(){var e;const t=(null==(e=this.getAttribute("indexid"))?void 0:e.trim())+""||this.indexId;for(let e=0;e<32;e++){const i=this.receiveStateURL.replace(`{{${t}}}`,e.toString()),s=this.receiveStateUserId.replace(`{{${t}}}`,e.toString()),n=this.receiveStatePassword.replace(`{{${t}}}`,e.toString()),r=this.receiveStateSourceType.replace(`{{${t}}}`,e.toString()),a=this.receiveStateSnapshotURL.replace(`{{${t}}}`,e.toString()),l=this.receiveStateSnapshotUserId.replace(`{{${t}}}`,e.toString()),o=this.receiveStateSnapshotPassword.replace(`{{${t}}}`,e.toString()),h=this.receiveStateSnapshotRefreshRate.replace(`{{${t}}}`,e.toString());if(this.signalHolder.push({url:{signalState:"",url:i,value:null},userId:{signalState:"",userId:s,value:null},password:{signalState:"",password:n,value:null},sourceType:{signalState:"",sourceType:r,value:null},snapshotURL:{signalState:"",snapshotURL:a,value:null},snapshotUserId:{signalState:"",snapshotUserId:l,value:null},snapshotPassword:{signalState:"",snapshotPassword:o,value:null},snapshotRefreshRate:{signalState:"",snapshotRefreshRate:h,value:null}}),i){const t=this.setSignalByString(i);_40.isNil(t)||(this.signalHolder[e].url.signalState=t.subscribe(t=>{this.signalHolder[e].url.value=t,this.selectedVideo===e&&this.maxVideoCount>this.selectedVideo&&this.urlCB(t)}))}if(s){const t=this.setSignalByString(s);_40.isNil(t)||(this.signalHolder[e].userId.signalState=t.subscribe(t=>{this.signalHolder[e].userId.value=t,this.selectedVideo===e&&this.maxVideoCount>this.selectedVideo&&this.userIdCB(t)}))}if(n){const t=this.setSignalByString(n);_40.isNil(t)||(this.signalHolder[e].password.signalState=t.subscribe(t=>{this.signalHolder[e].password.value=t,this.selectedVideo===e&&this.maxVideoCount>this.selectedVideo&&this.passwordCB(t)}))}if(r){const t=this.setSignalByString(r);_40.isNil(t)||(this.signalHolder[e].sourceType.signalState=t.subscribe(t=>{this.signalHolder[e].sourceType.value=t,this.selectedVideo===e&&this.maxVideoCount>this.selectedVideo&&this.sourceTypeCB(t)}))}if(a){const t=this.setSignalByString(a);_40.isNil(t)||(this.signalHolder[e].snapshotURL.signalState=t.subscribe(t=>{this.signalHolder[e].snapshotURL.value=t,this.selectedVideo===e&&this.maxVideoCount>this.selectedVideo&&this.snapshotURLCB(t)}))}if(l){const t=this.setSignalByString(l);_40.isNil(t)||(this.signalHolder[e].snapshotUserId.signalState=t.subscribe(t=>{this.signalHolder[e].snapshotUserId.value=t,this.selectedVideo===e&&this.maxVideoCount>this.selectedVideo&&this.snapshotUserIdCB(t)}))}if(o){const t=this.setSignalByString(o);_40.isNil(t)||(this.signalHolder[e].snapshotPassword.signalState=t.subscribe(t=>{this.signalHolder[e].snapshotPassword.value=t,this.selectedVideo===e&&this.maxVideoCount>this.selectedVideo&&this.snapshotPasswordCB(t)}))}if(h){const t=this.setSignalByNumber(h);_40.isNil(t)||(this.signalHolder[e].snapshotRefreshRate.signalState=t.subscribe(t=>{this.signalHolder[e].snapshotRefreshRate.value=t,this.selectedVideo===e&&this.maxVideoCount>this.selectedVideo&&this.snapshotRefreshRateCB(t)}))}}}setSignalByNumber(e){const t=Ch5Signal.getSubscriptionSignalName(e),i=Ch5SignalFactory.getInstance().getNumberSignal(t);return null===i?null:i}setSignalByString(e){const t=Ch5Signal.getSubscriptionSignalName(e),i=Ch5SignalFactory.getInstance().getStringSignal(t);return null===i?null:i}addTouchEvent(){this.videoTouchHandler=new Ch5VideoTouchManager({onTouchStartHandler:this.touchBeginHandler.bind(this),onTouchMoveHandler:this.touchMoveHandler.bind(this),onTouchEndHandler:this.touchEndHandler.bind(this),onTouchCancelHandler:this.touchEndHandler.bind(this),pollingDuration:300,componentID:this.getCrId()})}removeTouchEvent(){this.videoTouchHandler&&null!==this.videoTouchHandler&&void 0!==this.videoTouchHandler&&this.videoTouchHandler.destructor&&this.videoTouchHandler.destructor()}touchBeginHandler(){const e=this._elContainer.getBoundingClientRect();this.touchCoordinates.startX=e.left,this.touchCoordinates.startY=e.top,this.isTouchInProgress=!1}touchMoveHandler(){if(!this.isTouchInProgress){const e=this._elContainer.getBoundingClientRect();this.touchCoordinates.endX=e.left,this.touchCoordinates.endY=e.top,(Math.abs(this.touchCoordinates.startX-this.touchCoordinates.endX)>this.swipeDeltaCheckNum||Math.abs(this.touchCoordinates.startY-this.touchCoordinates.endY)>this.swipeDeltaCheckNum)&&(this.isTouchInProgress=!0,this.clearBackgroundOfVideoWrapper(!1),this.ch5BackgroundRequest(CH5VideoUtils.VIDEO_ACTION.STOP),this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP))}}touchEndHandler(){this.isTouchInProgress?setTimeout(()=>this.videoIntersectionObserver(),100):this.isTouchInProgress=!1}validateAndAttachSnapshot(){""===this.snapshotURL.trim()?this.sendEvent(this.sendEventSnapshotStatus,0):""!==this.snapshotURL.trim()&&""!==this.url&&(this.snapshotImage.url=this.snapshotURL,this.snapshotImage.userId=this.snapshotUserId,this.snapshotImage.password=this.snapshotPassword,this.snapshotImage.refreshRate=this.snapshotRefreshRate,this.snapshotImage.sendEventSnapshotStatus=this.sendEventSnapshotStatus,this.snapshotImage.sendEventSnapshotLastUpdateTime=this.sendEventSnapshotLastUpdateTime,this.lastResponseStatus!==CH5VideoUtils.VIDEO_ACTION.STARTED&&(!0===this.playValue&&this.snapshotImage.startLoadingSnapshot(),!1===this.snapshotImage.getImage().isConnected&&this._elContainer.appendChild(this.snapshotImage.getImage())))}getParentBackground(e){var t;e&&e.parentElement&&(Array.from(null==(t=e.parentElement)?void 0:t.children).forEach(e=>{"ch5-background"===e.nodeName.toLowerCase()&&this.parentCh5Background.push(e)}),this.getParentBackground(e.parentElement))}handleOrientation=()=>{this.isFullScreen?(this.orientationChanged=!0,this.publishVideo(CH5VideoUtils.VIDEO_ACTION.FULLSCREEN)):this.elementIntersectionEntry.intersectionRatio>=this.INTERSECTION_RATIO_VALUE&&this.playValue&&this.show&&setTimeout(()=>{this.publishVideo(CH5VideoUtils.VIDEO_ACTION.RESIZE),setTimeout(()=>{this.ch5BackgroundRequest("resize")},30)},70)};checkUrlAndPublishVideo(){""===this.url&&"network"===this.sourceType.toLowerCase()?(this.ch5BackgroundRequest("nourl"),this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP)):!1!==this.validateVideoUrl(this.url)||"network"!==this.sourceType.toLowerCase()||this.hasAttribute("receiveStateSourceType")?this.videoIntersectionObserver():(this.sendEvent(this.sendEventErrorMessage,"Invalid URL"),this.sendEvent(this.sendEventErrorCode,-9002),this.ch5BackgroundRequest(CH5VideoUtils.VIDEO_ACTION.ERROR),this.publishVideo(CH5VideoUtils.VIDEO_ACTION.STOP))}setErrorMessages(){this.videoErrorMessages.set(0,"success"),this.videoErrorMessages.set(1,"HDMI no sync"),this.videoErrorMessages.set(2,"DM no stream"),this.videoErrorMessages.set(-1,"connection refused / camera offline"),this.videoErrorMessages.set(-2,"no network"),this.videoErrorMessages.set(-1001,"Credentials required or invalid"),this.videoErrorMessages.set(-1002,"Hostname invalid"),this.videoErrorMessages.set(-1003,"Unsupported codec"),this.videoErrorMessages.set(-9001,"Unsupported source type"),this.videoErrorMessages.set(-9002,"Invalid URL"),this.videoErrorMessages.set(-9003,"Request for greater than maximum simultaneous sessions per source type"),this.videoErrorMessages.set(-9004,"Request for greater than maximum simultaneous sessions per device"),this.videoErrorMessages.set(-9007,"Unknown Error Message"),this.videoErrorMessages.set(-9008,"HDCP error when using HDMI input")}urlCB(e){this._ch5Properties.setForSignalResponse("url",e,()=>{this.sendEvent(this.sendEventSelectionURL,this.url),this.checkUrlAndPublishVideo()})}userIdCB(e){this._ch5Properties.setForSignalResponse("userId",e,()=>{this.videoIntersectionObserver()})}passwordCB(e){this._ch5Properties.setForSignalResponse("password",e,()=>{this.videoIntersectionObserver()})}sourceTypeCB(e){this._ch5Properties.setForSignalResponse("sourceType",e,()=>{this.sendEvent(this.sendEventSelectionSourceType,this.sourceType),this.videoIntersectionObserver()})}snapshotURLCB(e){this._ch5Properties.setForSignalResponse("snapshotURL",e,()=>{this.sendEvent(this.sendEventSnapshotURL,this.snapshotURL),this.validateAndAttachSnapshot()})}snapshotUserIdCB(e){this._ch5Properties.setForSignalResponse("snapshotUserId",e,()=>{this.validateAndAttachSnapshot()})}snapshotPasswordCB(e){this._ch5Properties.setForSignalResponse("snapshotPassword",e,()=>{this.validateAndAttachSnapshot()})}snapshotRefreshRateCB(e){this._ch5Properties.setForSignalResponse("snapshotRefreshRate",e,()=>{this.validateAndAttachSnapshot()})}clearOldSubscriptionNumber(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);null!==s&&s.unsubscribe(t)}clearOldSubscriptionString(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getBooleanSignal(i);null!==s&&s.unsubscribe(t)}clearMultiSignal(){this.signalHolder.forEach(e=>{this.clearOldSubscriptionString(e.url.signalValue,e.url.signalState),this.clearOldSubscriptionString(e.userId.signalValue,e.userId.signalState),this.clearOldSubscriptionString(e.password.signalValue,e.password.signalState),this.clearOldSubscriptionString(e.sourceType.signalValue,e.sourceType.signalState),this.clearOldSubscriptionString(e.snapshotURL.signalValue,e.snapshotURL.signalState),this.clearOldSubscriptionString(e.snapshotUserId.signalValue,e.snapshotUserId.signalState),this.clearOldSubscriptionString(e.snapshotPassword.signalValue,e.snapshotPassword.signalState),this.clearOldSubscriptionNumber(e.snapshotRefreshRate.signalValue,e.snapshotRefreshRate.signalState)})}};Ch5Video.registerCustomElement(),Ch5Video.registerSignalAttributeTypes();var DragDropTouch=class e{_imgCustom;_imgOffset;static instance;_lastClick;static _THRESHOLD=5;static _OPACITY=.5;static _DBLCLICK=500;static _CTXMENU=900;static _ISPRESSHOLDMODE=!1;static _PRESSHOLDAWAIT=400;static _PRESSHOLDMARGIN=25;static _PRESSHOLDTHRESHOLD=0;static _rmvAtts="id,class,style,draggable".split(",");static _kbdProps="altKey,ctrlKey,metaKey,shiftKey".split(",");static _ptProps="pageX,pageY,clientX,clientY,screenX,screenY".split(",");_dragSource;_lastTouch;_lastTarget;_ptDown;_isDragEnabled;_isDropZone;_dataTransfer=new DataTransfer;_pressHoldInterval;_img;static getInstance(){return this.instance||(this.instance=new e),this.instance}constructor(){this._lastClick=0;let e=!1;if(document.addEventListener("test",function(){},{get passive(){return e=!0,!0}}),"ontouchstart"in document){const t=!!e&&{passive:!1,capture:!1};document.addEventListener("touchstart",this._touchstart.bind(this),t),document.addEventListener("touchmove",this._touchmove.bind(this),t),document.addEventListener("touchend",this._touchend.bind(this)),document.addEventListener("touchcancel",this._touchend.bind(this))}}_touchstart(t){const i=this;if(this._shouldHandle(t)){if(Date.now()-this._lastClick<e._DBLCLICK&&this._dispatchEvent(t,"dblclick",t.target))return t.cancelable&&t.preventDefault(),void this._reset();this._reset();const s=this._closestDraggable(t.target);s&&(this._dispatchEvent(t,"mousemove",t.target)||this._dispatchEvent(t,"mousedown",t.target)||(this._dragSource=s,this._ptDown=this._getPoint(t),this._lastTouch=t,t.cancelable&&t.preventDefault(),setTimeout(function(){i._dragSource==s&&null==i._img&&i._dispatchEvent(t,"contextmenu",s)&&i._reset()},e._CTXMENU),e._ISPRESSHOLDMODE&&(this._pressHoldInterval=setTimeout(function(){i._isDragEnabled=!0,i._touchmove(t)},e._PRESSHOLDAWAIT))))}}_touchmove(e){if(this._shouldCancelPressHoldMove(e))this._reset();else if(this._shouldHandleMove(e)||this._shouldHandlePressHoldMove(e)){const t=this._getTarget(e);if(this._dispatchEvent(e,"mousemove",t))return this._lastTouch=e,void(e.cancelable&&e.preventDefault());this._dragSource&&!this._img&&this._shouldStartDragging(e)&&(this._dispatchEvent(e,"dragstart",this._dragSource),this._createImage(e),this._dispatchEvent(e,"dragenter",t)),this._img&&(this._lastTouch=e,e.cancelable&&e.preventDefault(),t!=this._lastTarget&&(this._dispatchEvent(this._lastTouch,"dragleave",this._lastTarget),this._dispatchEvent(e,"dragenter",t),this._lastTarget=t),this._moveImage(e),this._isDropZone=this._dispatchEvent(e,"dragover",t))}}_touchend(e){if(this._shouldHandle(e)){if(this._dispatchEvent(this._lastTouch,"mouseup",e.target))return void(e.cancelable&&e.preventDefault());this._img||(this._dragSource=null,this._dispatchEvent(this._lastTouch,"click",e.target),this._lastClick=Date.now()),this._destroyImage(),this._dragSource&&(e.type.indexOf("cancel")<0&&this._isDropZone&&this._dispatchEvent(this._lastTouch,"drop",this._lastTarget),this._dispatchEvent(this._lastTouch,"dragend",this._dragSource),this._reset())}}_shouldHandle(e){return e&&!e.defaultPrevented&&e.touches&&e.touches.length<2}_shouldHandleMove(t){return!e._ISPRESSHOLDMODE&&this._shouldHandle(t)}_shouldHandlePressHoldMove(t){return e._ISPRESSHOLDMODE&&this._isDragEnabled&&t&&t.touches&&t.touches.length}_shouldCancelPressHoldMove(t){return e._ISPRESSHOLDMODE&&!this._isDragEnabled&&this._getDelta(t)>e._PRESSHOLDMARGIN}_shouldStartDragging(t){const i=this._getDelta(t);return i>e._THRESHOLD||e._ISPRESSHOLDMODE&&i>=e._PRESSHOLDTHRESHOLD}_reset(){this._destroyImage(),this._dragSource=null,this._lastTouch=null,this._lastTarget=null,this._ptDown=null,this._isDragEnabled=!1,this._isDropZone=!1,this._dataTransfer=new DataTransfer,clearInterval(this._pressHoldInterval)}_getPoint(e){return e&&e.touches&&(e=e.touches[0]),{x:e.clientX,y:e.clientY}}_getDelta(t){if(e._ISPRESSHOLDMODE&&!this._ptDown)return 0;const i=this._getPoint(t);return Math.abs(i.x-this._ptDown.x)+Math.abs(i.y-this._ptDown.y)}_getTarget(e){const t=this._getPoint(e);let i=document.elementFromPoint(t.x,t.y);for(;i&&"none"==getComputedStyle(i).pointerEvents;)i=i.parentElement;return i}_createImage(t){this._img&&this._destroyImage();const i=this._imgCustom||this._dragSource;if(this._img=i.cloneNode(!0),this._copyStyle(i,this._img),this._img.style.top=this._img.style.left="-9999px",!this._imgCustom){const s=i.getBoundingClientRect(),n=this._getPoint(t);this._imgOffset={x:n.x-s.left,y:n.y-s.top},this._img.style.opacity=e._OPACITY.toString()}this._moveImage(t),document.body.appendChild(this._img)}_destroyImage(){this._img&&this._img.parentElement&&this._img.parentElement.removeChild(this._img),this._img=null,this._imgCustom=null}_moveImage(e){const t=this;requestAnimationFrame(function(){if(t._img){const i=t._getPoint(e),s=t._img.style;s.position="absolute",s.pointerEvents="none",s.zIndex="999999",s.left=Math.round(i.x-t._imgOffset.x)+"px",s.top=Math.round(i.y-t._imgOffset.y)+"px"}})}_copyProps(e,t,i){for(let s=0;s<i.length;s++){const n=i[s];e[n]=t[n]}}_copyStyle(t,i){if(e._rmvAtts.forEach(function(e){i.removeAttribute(e)}),t instanceof HTMLCanvasElement){const e=t,s=i;s.width=e.width,s.height=e.height,s.getContext("2d").drawImage(e,0,0)}const s=getComputedStyle(t);for(let e=0;e<s.length;e++){const t=s[e];t.indexOf("transition")<0&&(i.style[t]=s[t])}i.style.pointerEvents="none";for(let e=0;e<t.children.length;e++)this._copyStyle(t.children[e],i.children[e])}_dispatchEvent(t,i,s){if(t&&s){const n=document.createEvent("Event"),r=t.touches?t.touches[0]:t;return n.initEvent(i,!0,!0),n.button=0,n.which=n.buttons=1,this._copyProps(n,t,e._kbdProps),this._copyProps(n,r,e._ptProps),n.dataTransfer=this._dataTransfer,s.dispatchEvent(n),n.defaultPrevented}return!1}_closestDraggable(e){for(;e;e=e.parentElement)if(e.hasAttribute("draggable")&&e.draggable)return e;return null}};import _41 from"lodash";var Ch5VideoSwitcher=class e extends Ch5Common{static SOURCE_LIST_POSITION=["top","left","right","bottom"];static SCREEN_ASPECT_RATIO=["stretch","16:9","4:3"];static CONTRACT_SOURCE_LABEL_TYPE=["none","textContent","innerHTML"];static CONTRACT_SCREEN_LABEL_TYPE=["none","textContent","innerHTML"];static DEFAULT_SOURCE_ICON="fa-solid fa-video";static COMPONENT_DATA={SOURCE_LIST_POSITION:{default:e.SOURCE_LIST_POSITION[0],values:e.SOURCE_LIST_POSITION,key:"sourceListPosition",attribute:"sourceListPosition",classListPrefix:"--source-list-position-"},SCREEN_ASPECT_RATIO:{default:e.SCREEN_ASPECT_RATIO[0],values:e.SCREEN_ASPECT_RATIO,key:"screenAspectRatio",attribute:"screenAspectRatio",classListPrefix:"--screen-aspect-ratio-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,sendeventondrop:{direction:"event",numericJoin:1,contractName:!0},sendeventonchange:{direction:"event",booleanJoin:1,contractName:!0},receivestatesourcechanged:{direction:"state",numericJoin:1,contractName:!0},receivestatesourcelabel:{direction:"state",stringJoin:1,contractName:!0},receivestateScriptsourcelabelhtml:{direction:"state",stringJoin:1,contractName:!0},receivestatescreenlabel:{direction:"state",stringJoin:1,contractName:!0},receiveStatescriptscreenlabelhtml:{direction:"state",stringJoin:1,contractName:!0},receivestatenumberofscreens:{direction:"state",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:e.SOURCE_LIST_POSITION[0],enumeratedValues:e.SOURCE_LIST_POSITION,name:"sourceListPosition",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SOURCE_LIST_POSITION[0],isObservableProperty:!0},{default:!1,name:"endless",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:1,name:"numberOfSourceListDivisions",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:1,max:10,conditionalMin:1,conditionalMax:10,conditionalMinValue:1,conditionalMaxValue:10},isObservableProperty:!0},{default:!1,name:"scrollbar",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:5,name:"numberOfSources",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:1,max:256,conditionalMin:1,conditionalMax:256,conditionalMinValue:1,conditionalMaxValue:256},isObservableProperty:!0},{default:0,name:"numberOfScreenColumns",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:10,conditionalMin:0,conditionalMax:10,conditionalMinValue:0,conditionalMaxValue:10},isObservableProperty:!0},{default:"",name:"indexId",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!0,name:"displayScreenLabel",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.SCREEN_ASPECT_RATIO[0],enumeratedValues:e.SCREEN_ASPECT_RATIO,name:"screenAspectRatio",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SCREEN_ASPECT_RATIO[0],isObservableProperty:!0},{default:2,name:"numberOfScreens",removeAttributeOnNull:!0,nameForSignal:"receiveStateNumberOfScreens",type:"number",valueOnAttributeEmpty:null,numberProperties:{min:1,max:36,conditionalMin:1,conditionalMax:36,conditionalMinValue:1,conditionalMaxValue:36},isObservableProperty:!0},{default:e.DEFAULT_SOURCE_ICON,name:"sourceIconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:e.DEFAULT_SOURCE_ICON,isObservableProperty:!0},{default:"",name:"sourceIconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"sendEventOnDrop",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"sendEventOnChange",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"receiveStateSourceChanged",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"receiveStateSourceLabel",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"receiveStateScriptSourceLabelHtml",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"receiveStateScreenLabel",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"receiveStateScriptScreenLabelHtml",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateNumberOfScreens",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"contractName",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:!1,name:"useContractForEnable",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:!1,name:"useContractForShow",removeAttributeOnNull:!0,type:"boolean",valueOnAttributeEmpty:!0,isObservableProperty:!0},{default:e.CONTRACT_SOURCE_LABEL_TYPE[0],enumeratedValues:e.CONTRACT_SOURCE_LABEL_TYPE,name:"contractSourceLabelType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.CONTRACT_SOURCE_LABEL_TYPE[0],isObservableProperty:!0},{default:e.CONTRACT_SCREEN_LABEL_TYPE[0],enumeratedValues:e.CONTRACT_SCREEN_LABEL_TYPE,name:"contractScreenLabelType",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.CONTRACT_SCREEN_LABEL_TYPE[0],isObservableProperty:!0}];static ELEMENT_NAME="ch5-video-switcher";primaryCssClass="ch5-video-switcher";sourceListCssClass="--source-list";screenListCssClass="--screen-list";screenListParentCssClass="--screen-list-parent";static SCROLLBAR_CLASSLIST_PREFIX="--source-list-scrollbar-";static DISPLAY_SCREEN_LABEL="--screen-list-display-screen-label-";_ch5Properties;_elContainer={};_sourceListContainer={};_screenListParentContainer={};_screenListContainer={};_scrollbarContainer={};_scrollbar={};isDown=!1;startX=0;startY=0;scrollListLeft=0;scrollListTop=0;scrollbarDimension=0;signalHolder=[];numberOfScreenBackup=1;signalHolderForSourceLabel={receiveStateScriptSourceLabelHtml:[],receiveStateSourceLabel:[]};signalHolderForScreenLabel={receiveStateScriptScreenLabelHtml:[],receiveStateScreenLabel:[]};signalNameOnContract={contractName:"",receiveStateEnable:"",receiveStateShow:"",receiveStateNumberOfScreens:""};validDrop=!1;resizeObserver=null;debounceNumberOfItems=this.debounce(e=>{this.setNumberOfItems(e)},150);set sourceListPosition(e){this._ch5Properties.set("sourceListPosition",e,()=>{this.handleSourceListPosition()})}get sourceListPosition(){return this._ch5Properties.get("sourceListPosition")}set endless(e){this._ch5Properties.set("endless",e,()=>{this.handleEndless()})}get endless(){return this._ch5Properties.get("endless")}set numberOfSourceListDivisions(e){this._ch5Properties.set("numberOfSourceListDivisions",e,()=>{this.handleNumberOfSourceListDivisions()})}get numberOfSourceListDivisions(){return this._ch5Properties.get("numberOfSourceListDivisions")}set scrollbar(e){this._ch5Properties.set("scrollbar",e,()=>{this.handleScrollbar()})}get scrollbar(){return this._ch5Properties.get("scrollbar")}set numberOfSources(e){this._ch5Properties.set("numberOfSources",e,()=>{this.createSource()})}get numberOfSources(){return this._ch5Properties.get("numberOfSources")}set numberOfScreenColumns(e){this._ch5Properties.set("numberOfScreenColumns",e,()=>{this.handleNumberOfScreenColumns()})}get numberOfScreenColumns(){return this._ch5Properties.get("numberOfScreenColumns")}set indexId(e){this._ch5Properties.set("indexId",e)}get indexId(){return this._ch5Properties.get("indexId")}set displayScreenLabel(e){this._ch5Properties.set("displayScreenLabel",e,()=>{this.handleDisplayScreenLabel()})}get displayScreenLabel(){return this._ch5Properties.get("displayScreenLabel")}set screenAspectRatio(e){this._ch5Properties.set("screenAspectRatio",e,()=>{this.handleScreenAspectRatio()})}get screenAspectRatio(){return this._ch5Properties.get("screenAspectRatio")}set numberOfScreens(e){this._ch5Properties.set("numberOfScreens",e,()=>{this.createScreen()})}get numberOfScreens(){return this._ch5Properties.get("numberOfScreens")}set sourceIconClass(e){this._ch5Properties.set("sourceIconClass",e,()=>{this.createSource()})}get sourceIconClass(){return this._ch5Properties.get("sourceIconClass")}set sourceIconUrl(e){this._ch5Properties.set("sourceIconUrl",e,()=>{this.createSource()})}get sourceIconUrl(){return this._ch5Properties.get("sourceIconUrl")}set sendEventOnDrop(e){this._ch5Properties.set("sendEventOnDrop",e)}get sendEventOnDrop(){return this._ch5Properties.get("sendEventOnDrop")}set sendEventOnChange(e){this._ch5Properties.set("sendEventOnChange",e)}get sendEventOnChange(){return this._ch5Properties.get("sendEventOnChange")}set receiveStateSourceChanged(e){this._ch5Properties.set("receiveStateSourceChanged",e,()=>{this.handleReceiveStateSourceChanged()})}get receiveStateSourceChanged(){return this._ch5Properties.get("receiveStateSourceChanged")}set receiveStateSourceLabel(e){this._ch5Properties.set("receiveStateSourceLabel",e,()=>{this.handleSourceLabel()})}get receiveStateSourceLabel(){return this._ch5Properties.get("receiveStateSourceLabel")}set receiveStateScriptSourceLabelHtml(e){this._ch5Properties.set("receiveStateScriptSourceLabelHtml",e,()=>{this.handleSourceLabel()})}get receiveStateScriptSourceLabelHtml(){return this._ch5Properties.get("receiveStateScriptSourceLabelHtml")}set receiveStateScreenLabel(e){this._ch5Properties.set("receiveStateScreenLabel",e,()=>{this.handleScreenLabel()})}get receiveStateScreenLabel(){return this._ch5Properties.get("receiveStateScreenLabel")}set receiveStateScriptScreenLabelHtml(e){this._ch5Properties.set("receiveStateScriptScreenLabelHtml",e,()=>{this.handleScreenLabel()})}get receiveStateScriptScreenLabelHtml(){return this._ch5Properties.get("receiveStateScriptScreenLabelHtml")}set receiveStateNumberOfScreens(e){this._ch5Properties.set("receiveStateNumberOfScreens",e,null,e=>{this.debounceNumberOfItems(e)})}get receiveStateNumberOfScreens(){return this._ch5Properties.get("receiveStateNumberOfScreens")}set contractName(e){this._ch5Properties.set("contractName",e,()=>{this.handleContractName()})}get contractName(){return this._ch5Properties.get("contractName")}set useContractForEnable(e){this._ch5Properties.set("useContractForEnable",e,()=>{this.contractDefaultHelper()})}get useContractForEnable(){return this._ch5Properties.get("useContractForEnable")}set useContractForShow(e){this._ch5Properties.set("useContractForShow",e,()=>{this.contractDefaultHelper()})}get useContractForShow(){return this._ch5Properties.get("useContractForShow")}set contractSourceLabelType(e){this._ch5Properties.set("contractSourceLabelType",e,()=>{this.contractDefaultHelper()})}get contractSourceLabelType(){return this._ch5Properties.get("contractSourceLabelType")}set contractScreenLabelType(e){this._ch5Properties.set("contractScreenLabelType",e,()=>{this.contractDefaultHelper()})}get contractScreenLabelType(){return this._ch5Properties.get("contractScreenLabelType")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),DragDropTouch.getInstance(),this.logger.start("constructor()",e.ELEMENT_NAME),this.ignoreAttributes=["receivestatecustomclass","receivestatecustomstyle","sendeventonshow"],this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.updateCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){if(this.logger.log('ch5-video-switcher attributeChangedCallback("'+t+'","'+i+'","'+s+'")'),"receivestatenumberofscreens"===t.toLowerCase()&&""!==this.contractName&&!1===s.startsWith(this.contractName))return;const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5VideoSwitcher),this.checkInternalHTML(),this.attachEventListeners();const t=this.getElementsByTagName(this.nodeName.toLowerCase()+"-source");Array.from(t).forEach((e,t)=>{e.setAttribute("id",this.getCrId()+"-source-"+t);const i=e.getElementsByTagName(this.nodeName.toLowerCase()+"-source-label");0!==i.length&&i[0].setAttribute("id",this.getCrId()+"-source-label-"+t)});const i=this.getElementsByTagName(this.nodeName.toLowerCase()+"-screen");Array.from(i).forEach((e,t)=>{e.setAttribute("id",this.getCrId()+"-screen-"+t);const i=e.getElementsByTagName(this.nodeName.toLowerCase()+"-screen-label");0!==i.length&&i[0].setAttribute("id",this.getCrId()+"-screen-label-"+t)}),this.initAttributes(),this.initCommonMutationObserver(this),this.createSource(),this.createScreen(),customElements.whenDefined("ch5-video-switcher").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id),this.createSource(),this.createScreen()}),this.logger.stop()}contractDefaultHelper(){""!==this.contractName&&null!==this.contractName&&void 0!==this.contractName&&(!0===this.useContractForEnable?this.receiveStateEnable=this.contractName+".Enable":this.receiveStateEnable=this.signalNameOnContract.receiveStateEnable,!0===this.useContractForShow?this.receiveStateShow=this.contractName+".Visible":this.receiveStateShow=this.signalNameOnContract.receiveStateShow,this.receiveStateNumberOfScreens=this.contractName+".NumberOfScreens"),this.handleSourceLabel(),this.handleScreenLabel()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.disconnectCommonMutationObserver(),this.clearSubscriptions(),this.logger.stop()}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._sourceListContainer=document.createElement("div"),this._screenListParentContainer=document.createElement("div"),this._screenListContainer=document.createElement("div"),this._scrollbarContainer=document.createElement("div"),this._scrollbar=document.createElement("div"),this._screenListParentContainer.classList.add(this.primaryCssClass+this.screenListParentCssClass),this._screenListContainer.classList.add(this.primaryCssClass+this.screenListCssClass),this._sourceListContainer.classList.add(this.primaryCssClass+this.sourceListCssClass),this._screenListParentContainer.appendChild(this._screenListContainer),this._elContainer.appendChild(this._sourceListContainer),this._elContainer.appendChild(this._screenListParentContainer),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}attachEventListeners(){super.attachEventListeners(),this._sourceListContainer.addEventListener("mousedown",this.handleMouseDown),this._sourceListContainer.addEventListener("mouseleave",this.handleMouseUpAndLeave),this._sourceListContainer.addEventListener("mouseup",this.handleMouseUpAndLeave),this._sourceListContainer.addEventListener("mousemove",this.handleMouseMove),this._sourceListContainer.addEventListener("scroll",this.handleScrollEvent),this.resizeObserver=new ResizeObserver(this.resizeObserverHandler),this.resizeObserver.observe(this._elContainer)}handleMouseDown=this.debounce(e=>{this.isDown=!0,this._sourceListContainer.classList.add("active"),this.startX=e.pageX-this._sourceListContainer.offsetLeft,this.startY=e.pageY-this._sourceListContainer.offsetTop,this.scrollListLeft=this._sourceListContainer.scrollLeft,this.scrollListTop=this._sourceListContainer.scrollTop},10);handleMouseUpAndLeave=this.debounce(()=>{this.isDown=!1,this._sourceListContainer.classList.remove("active")},10);handleMouseMove=this.debounce(e=>{if(!this.isDown)return;e.preventDefault();const t=e.pageX-this._sourceListContainer.offsetLeft,i=e.pageY-this._sourceListContainer.offsetTop,s=(t-this.startX)*(this.endless?1:3),n=(i-this.startY)*(this.endless?1:3);this._sourceListContainer.scrollLeft=this.scrollListLeft-s,this._sourceListContainer.scrollTop=this.scrollListTop-n},10);removeEventListeners(){var e;super.removeEventListeners(),this._sourceListContainer.removeEventListener("mouseleave",this.handleMouseUpAndLeave),this._sourceListContainer.removeEventListener("mouseup",this.handleMouseUpAndLeave),this._sourceListContainer.removeEventListener("mousedown",this.handleMouseDown),this._sourceListContainer.removeEventListener("mousemove",this.handleMouseMove),this._sourceListContainer.removeEventListener("scroll",this.handleScrollEvent),null==(e=this.resizeObserver)||e.unobserve(this._elContainer)}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}checkInternalHTML(){this._elContainer.parentElement!==this&&(this._elContainer.classList.add("ch5-video-switcher"),this.appendChild(this._elContainer)),this._scrollbar.parentElement!==this._scrollbarContainer&&(this._scrollbar.classList.add("scrollbar"),this._scrollbarContainer.appendChild(this._scrollbar)),this._scrollbarContainer.parentElement!==this._elContainer&&(this._scrollbarContainer.classList.add("scrollbar-container"),this._elContainer.appendChild(this._scrollbarContainer))}handleSourceListPosition(){Array.from(e.COMPONENT_DATA.SOURCE_LIST_POSITION.values).forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.SOURCE_LIST_POSITION.classListPrefix+t)}),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SOURCE_LIST_POSITION.classListPrefix+this.sourceListPosition),this.initScrollbar(),this.handleNumberOfScreenColumns()}handleEndless(){this.endless&&(this.endless=1===this.numberOfSourceListDivisions),this.endless&&!0===this.scrollbar&&(this.scrollbar=!1)}handleNumberOfSourceListDivisions(){this._sourceListContainer.style.setProperty("--number-of-source-list-divisions",this.numberOfSourceListDivisions+""),this.initScrollbar()}handleScrollbar(){!0===this.endless&&!0===this.scrollbar&&(this.scrollbar=!1),[!0,!1].forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.SCROLLBAR_CLASSLIST_PREFIX+t.toString())}),this._elContainer.classList.add(this.primaryCssClass+e.SCROLLBAR_CLASSLIST_PREFIX+this.scrollbar),this.initScrollbar()}handleDisplayScreenLabel(){[!0,!1].forEach(t=>{this._elContainer.classList.remove(this.primaryCssClass+e.DISPLAY_SCREEN_LABEL+t.toString())}),this._elContainer.classList.add(this.primaryCssClass+e.DISPLAY_SCREEN_LABEL+this.displayScreenLabel)}handleScreenAspectRatio(){Array.from(e.COMPONENT_DATA.SCREEN_ASPECT_RATIO.values).forEach(t=>{this._screenListContainer.classList.remove(this.primaryCssClass+e.COMPONENT_DATA.SCREEN_ASPECT_RATIO.classListPrefix+t.replace(":","-"))}),this._screenListContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SCREEN_ASPECT_RATIO.classListPrefix+this.screenAspectRatio.replace(":","-")),this.handleNumberOfScreenColumns()}handleSendEventOnDrop(e,t){var i,s;if(this.contractName)e=this.contractName+".Source"+(+e+1)+"_Selection",null==(i=Ch5SignalFactory.getInstance().getNumberSignal(e))||i.publish(+t+1);else if(this.sendEventOnDrop){const i=this.getSignalName(this.sendEventOnDrop,+e);null==(s=Ch5SignalFactory.getInstance().getNumberSignal(i))||s.publish(+t+1)}}handleSendEventOnChange(e){var t,i,s,n;if(this.contractName)e=this.contractName+".Screen_"+(+e+1)+"_Changed",null==(t=Ch5SignalFactory.getInstance().getBooleanSignal(e))||t.publish(!0),null==(i=Ch5SignalFactory.getInstance().getBooleanSignal(e))||i.publish(!1);else if(this.sendEventOnChange){const t=this.getSignalName(this.sendEventOnChange,+e);null==(s=Ch5SignalFactory.getInstance().getBooleanSignal(t))||s.publish(!0),null==(n=Ch5SignalFactory.getInstance().getBooleanSignal(t))||n.publish(!1)}}handleReceiveStateSourceChanged(){this.signalHolder.forEach(e=>{this.clearOldSubscriptionNumber(e.signalValue,e.signalState)});for(let e=0;e<this.numberOfScreens;e++){const t=this.contractName?this.contractName+`.Source${e+1}_Feedback`:this.getSignalName(this.receiveStateSourceChanged,e);if(this.signalHolder.push({signalState:"",signalValue:t,value:null}),t){const i=this.setSignalByNumber(t);_41.isNil(i)||(this.signalHolder[e].signalState=i.subscribe(t=>{this.signalHolder[e]&&(this.signalHolder[e].value=t),this.addSourceToScreenOnFB(e,t)}))}}}getSignalName(e,t){var i;const s=(null==(i=this.getAttribute("indexid"))?void 0:i.trim())+""||this.indexId;if(!1===e.includes(`{{${s}}}`))return e;{const i=this.replaceAll(e,`{{${s}}}`,"");return/^[0-9]+$/.test(i)?+i+t+"":this.replaceAll(e,`{{${s}}}`,t+"")}}clearOldSubscriptionNumber(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getNumberSignal(i);null!==s&&s.unsubscribe(t)}clearOldSubscriptionString(e,t){const i=Ch5Signal.getSubscriptionSignalName(e),s=Ch5SignalFactory.getInstance().getStringSignal(i);null!==s&&s.unsubscribe(t)}setSignalByNumber(e){const t=Ch5Signal.getSubscriptionSignalName(e),i=Ch5SignalFactory.getInstance().getNumberSignal(t);return null===i?null:i}setSignalByString(e){const t=Ch5Signal.getSubscriptionSignalName(e),i=Ch5SignalFactory.getInstance().getStringSignal(t);return null===i?null:i}handleSourceLabel(){Object.keys(this.signalHolderForSourceLabel).forEach(e=>{this.signalHolderForSourceLabel[e].forEach(e=>{this.clearOldSubscriptionString(e.signalValue,e.signalState)}),this.signalHolderForSourceLabel[e]=[]});for(let e=0;e<this.numberOfSources;e++)if(this.contractName&&"innerHTML"===this.contractSourceLabelType){const t=this.contractName+`.Source_${e+1}_Label`;this.getSubscription(this.signalHolderForSourceLabel.receiveStateScriptSourceLabelHtml,this.sourcelabelHelper,e,t,!0)}else if(this.contractName&&"textContent"===this.contractSourceLabelType){const t=this.contractName+`.Source_${e+1}_Label`;this.getSubscription(this.signalHolderForSourceLabel.receiveStateSourceLabel,this.sourcelabelHelper,e,t)}else if(this.receiveStateScriptSourceLabelHtml){const t=this.getSignalName(this.receiveStateScriptSourceLabelHtml,e);this.getSubscription(this.signalHolderForSourceLabel.receiveStateScriptSourceLabelHtml,this.sourcelabelHelper,e,t,!0)}else if(this.receiveStateSourceLabel){const t=this.getSignalName(this.receiveStateSourceLabel,e);this.getSubscription(this.signalHolderForSourceLabel.receiveStateSourceLabel,this.sourcelabelHelper,e,t)}else this.sourceLabelHelperCreate(e)}handleScreenLabel(){Object.keys(this.signalHolderForScreenLabel).forEach(e=>{this.signalHolderForScreenLabel[e].forEach(e=>{this.clearOldSubscriptionString(e.signalValue,e.signalState)}),this.signalHolderForScreenLabel[e]=[]});for(let e=0;e<this.numberOfScreens;e++)if(this.contractName&&"innerHTML"===this.contractScreenLabelType){const t=this.contractName+`.Screen${e+1}_Label`;this.getSubscription(this.signalHolderForScreenLabel.receiveStateScriptScreenLabelHtml,this.screenlabelHelper,e,t,!0)}else if(this.contractName&&"textContent"===this.contractScreenLabelType){const t=this.contractName+`.Screen${e+1}_Label`;this.getSubscription(this.signalHolderForScreenLabel.receiveStateScreenLabel,this.screenlabelHelper,e,t)}else if(this.receiveStateScriptScreenLabelHtml){const t=this.getSignalName(this.receiveStateScriptScreenLabelHtml,e);this.getSubscription(this.signalHolderForScreenLabel.receiveStateScriptScreenLabelHtml,this.screenlabelHelper,e,t,!0)}else if(this.receiveStateScreenLabel){const t=this.getSignalName(this.receiveStateScreenLabel,e);this.getSubscription(this.signalHolderForScreenLabel.receiveStateScreenLabel,this.screenlabelHelper,e,t)}else this.screenLabelHelperCreate(e)}getSubscription(e,t,i,s,n=!1){e.push({signalState:"",signalValue:s,value:null});const r=this.setSignalByString(s);_41.isNil(r)||(e[i].signalState=r.subscribe(s=>{e[i].value=s,t.call(this,s,i,n)}))}sourcelabelHelper(e,t,i){const s=this._sourceListContainer.querySelector(`[sourceid="${t}"] > span`);s&&(i?s.innerHTML=e:s.textContent=e);const n=this._screenListContainer.querySelectorAll(`[sourceid="${t}"] > span`);Array.from(n).forEach(t=>{i?t.innerHTML=e:t.textContent=e})}screenlabelHelper(e,t,i){const s=this._screenListContainer.querySelector(`[screenid="${t}"] > span`);s&&(i?s.innerHTML=e:s.textContent=e)}handleContractName(){0===this.contractName.length?(this.signalNameOnContract.contractName="",this.receiveStateShow=this.signalNameOnContract.receiveStateShow,this.receiveStateEnable=this.signalNameOnContract.receiveStateEnable,this.receiveStateNumberOfScreens=this.signalNameOnContract.receiveStateNumberOfScreens):""===this.signalNameOnContract.contractName&&(this.signalNameOnContract.contractName=this.contractName,this.signalNameOnContract.receiveStateShow=this.receiveStateShow,this.signalNameOnContract.receiveStateEnable=this.receiveStateEnable,this.signalNameOnContract.receiveStateNumberOfScreens=this.receiveStateNumberOfScreens),this.contractDefaultHelper()}handleScrollEvent=this.debounce(()=>{if(!this.querySelector(".dragging")&&(this.initScrollbar(),this.endless))return this.endlessHelper()},10);endlessHelper(){const{offsetWidth:e,scrollLeft:t,scrollWidth:i,offsetHeight:s,scrollTop:n,scrollHeight:r}=this._sourceListContainer,{width:a,height:l}=this._sourceListContainer.children[0].getBoundingClientRect(),o="top"===this.sourceListPosition||"bottom"===this.sourceListPosition;if(o?i-e>a:r-s>l)if(o){if(t<a/4){const e=this._sourceListContainer.children.length,t=this._sourceListContainer.children[e-1];this._sourceListContainer.prepend(t),this._sourceListContainer.scrollLeft+=a/2}else if(t+e>i-a/4){const e=this._sourceListContainer.children[0];this._sourceListContainer.appendChild(e),this._sourceListContainer.scrollLeft-=a/2}}else if(n<l/4){const e=this._sourceListContainer.children.length,t=this._sourceListContainer.children[e-1];this._sourceListContainer.prepend(t),this._sourceListContainer.scrollTop+=l/2}else if(n+s>r-l/4){const e=this._sourceListContainer.children[0];this._sourceListContainer.appendChild(e),this._sourceListContainer.scrollTop-=l/2}}initScrollbar(){if("top"===this.sourceListPosition||"bottom"===this.sourceListPosition){const{scrollWidth:e,offsetWidth:t,scrollLeft:i}=this._sourceListContainer;this.scrollbarDimension=Math.floor(t/e*100);const s=Math.ceil(i/e*100);this._scrollbar.style.removeProperty("height"),this._scrollbar.style.removeProperty("top"),this._scrollbar.style.width=this.scrollbarDimension+"%",this._scrollbar.style.left=s+"%"}else{const{scrollHeight:e,offsetHeight:t,scrollTop:i}=this._sourceListContainer;this.scrollbarDimension=Math.floor(t/e*100);const s=Math.ceil(i/e*100);this._scrollbar.style.removeProperty("width"),this._scrollbar.style.removeProperty("left"),this._scrollbar.style.height=this.scrollbarDimension+"%",this._scrollbar.style.top=s+"%"}this.scrollbar&&(100===this.scrollbarDimension?(this._elContainer.classList.remove(this.primaryCssClass+e.SCROLLBAR_CLASSLIST_PREFIX+"true"),this._elContainer.classList.add(this.primaryCssClass+e.SCROLLBAR_CLASSLIST_PREFIX+"false")):(this._elContainer.classList.remove(this.primaryCssClass+e.SCROLLBAR_CLASSLIST_PREFIX+"false"),this._elContainer.classList.add(this.primaryCssClass+e.SCROLLBAR_CLASSLIST_PREFIX+"true")))}updateCssClass(){this.logger.start("UpdateCssClass"),super.updateCssClasses(),this._elContainer.classList.add(this.primaryCssClass),this._elContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SOURCE_LIST_POSITION.classListPrefix+this.sourceListPosition),this._screenListContainer.classList.add(this.primaryCssClass+e.COMPONENT_DATA.SCREEN_ASPECT_RATIO.classListPrefix+this.screenAspectRatio.replace(":","-")),this._elContainer.classList.add(this.primaryCssClass+e.SCROLLBAR_CLASSLIST_PREFIX+this.scrollbar),this._elContainer.classList.add(this.primaryCssClass+e.DISPLAY_SCREEN_LABEL+this.displayScreenLabel),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}createSource(){Array.from(this._sourceListContainer.querySelectorAll(".source-container")).forEach(e=>e.remove());for(let e=0;e<this.numberOfSources;e++){const t=document.createElement("div");t.setAttribute("sourceId",e+"");const i=document.createElement("i"),s=document.createElement("span");t.setAttribute("draggable","true"),t.classList.add("source-container"),t.classList.add("draggable"),i.classList.add("source-icon"),s.classList.add(this.primaryCssClass+this.sourceListCssClass+"-label"),t.appendChild(i),t.appendChild(s),this._sourceListContainer.appendChild(t),this.sourceLabelHelperCreate(e),this.sourceIconHelperCreate(e,i),t.addEventListener("dragstart",this.handleDragStartSource.bind(this,e)),t.addEventListener("dragend",this.handleDragEndSource.bind(this,e))}this.endless&&("top"===this.sourceListPosition||"bottom"===this.sourceListPosition?this._sourceListContainer.scrollLeft+=5:this._sourceListContainer.scrollTop+=5),setTimeout(()=>{this.initScrollbar()},50),this.handleSourceLabel()}createScreen(){Array.from(this._screenListContainer.querySelectorAll(".screen-container")).forEach(e=>e.remove());for(let e=0;e<this.numberOfScreens;e++){const t=document.createElement("div"),i=document.createElement("span");t.setAttribute("screenId",e+""),t.appendChild(i),t.classList.add("screen-container"),i.classList.add(this.primaryCssClass+this.screenListCssClass+"-label"),this._screenListContainer.appendChild(t),this.screenLabelHelperCreate(e),this.screenAlignLabelHelperCreate(e,t),this.signalHolder[e]&&this.signalHolder[e].value&&this.signalHolder[e].value>0&&this.addSourceToScreenOnFB(e,this.signalHolder[e].value),t.addEventListener("dragover",this.handleDragoverScreen.bind(this,e)),t.addEventListener("drop",this.handleDropScreen.bind(this,e))}this.handleNumberOfScreenColumns(),this.handleReceiveStateSourceChanged(),this.handleScreenLabel()}resizeObserverHandler=()=>{0!==this._elContainer.getBoundingClientRect().width&&(this.handleNumberOfScreenColumns(),this.handleResizeComponent())};handleNumberOfScreenColumns(){const e=this._screenListParentContainer.offsetHeight-10,t=this._screenListParentContainer.offsetWidth-10,i=t/82,s=e/62;let n=0,r=0,a=!0,l=!0,o=1,h=0,c=0,u=0;if(this._screenListContainer.style.removeProperty("grid-template-columns"),this._screenListContainer.style.removeProperty("grid-template-rows"),this.numberOfScreenColumns>0){Math.floor(i)>=this.numberOfScreenColumns?(o=this.numberOfScreens/Math.floor(this.numberOfScreenColumns),n=this.numberOfScreenColumns):Math.floor(i)>=this.numberOfScreens?(o=this.numberOfScreens/Math.floor(i),n=Math.floor(i)):(o=this.numberOfScreens/Math.floor(i),n=Math.floor(i),a=!1),Math.floor(s)<=Math.ceil(o)?(h=n*Math.floor(s),r=Math.floor(s)):(h=n*Math.ceil(o),r=Math.ceil(o));let l=a?n:"auto-fit",d="repeat("+r+", minmax(60px, 1fr) )";if(a&&l>this.numberOfScreens+"")u=Math.floor(i)>this.numberOfScreenColumns?t/this.numberOfScreenColumns:t/Math.floor(i),l="repeat("+this.numberOfScreens+","+u+"px)";else if("16:9"===this.screenAspectRatio||"4:3"===this.screenAspectRatio){if(Math.floor(i)>=n&&Math.floor(s)>=r){const i=t/n,s=e/r,a="16:9"===this.screenAspectRatio?i*(9/16):i*(3/4);s>=a?(u=t/n-2,c=a):(c=this.getRowHeightColWidth(!1,e,t,r,n,this.screenAspectRatio),u=this.getRowHeightColWidth(!0,e,t,r,n,this.screenAspectRatio))}else c=this.getRowHeightColWidth(!1,e,t,r,n,this.screenAspectRatio),u=this.getRowHeightColWidth(!0,e,t,r,n,this.screenAspectRatio);l="repeat("+l+","+u+"px)"}else l="repeat("+l+",minmax(80px, 1fr))";c>0&&(d="repeat("+r+","+c+"px)"),this._screenListContainer.style.setProperty("grid-template-columns",l),this._screenListContainer.style.setProperty("grid-template-rows",d)}else{o=this.numberOfScreens/Math.floor(i),"16:9"!==this.screenAspectRatio&&"4:3"!==this.screenAspectRatio||(n=Math.floor(i)>=this.numberOfScreens?this.numberOfScreens:Math.floor(i)),Math.floor(s)<=Math.ceil(o)?(h=Math.floor(s)*Math.floor(i),r=Math.floor(s)):Math.floor(s)>=Math.ceil(o)?(r=Math.ceil(o),h=Math.ceil(o)*Math.floor(i)):l=!1;let a="repeat(auto-fit, minmax(80px, 1fr) )",c=0;if("16:9"===this.screenAspectRatio||"4:3"===this.screenAspectRatio){let l=0;if(Math.floor(i)>=n&&Math.floor(s)>=r){const i=t/n,s=e/r,a="16:9"===this.screenAspectRatio?i*(9/16):i*(3/4);s>=a?(l=t/n-2,c=a):(c=this.getRowHeightColWidth(!1,e,t,r,n,this.screenAspectRatio),l=this.getRowHeightColWidth(!0,e,t,r,n,this.screenAspectRatio))}else c=this.getRowHeightColWidth(!1,e,t,r,n,this.screenAspectRatio),l=this.getRowHeightColWidth(!0,e,t,r,n,this.screenAspectRatio);a="repeat(auto-fit,"+l+"px)"}let u="";u=c>0?"repeat("+r+","+c+"px)":l?"repeat("+r+", minmax(60px, 1fr) )":"minmax(60px, 1fr)",this._screenListContainer.style.setProperty("grid-template-columns",a),this._screenListContainer.style.setProperty("grid-template-rows",u)}for(let a=0;a<this.numberOfScreens;a++){const l=this._screenListContainer.querySelector(`[screenid="${a}"]`);if(l&&(l.style.removeProperty("width"),l.style.removeProperty("height"),l.classList.remove("hideScreen"),a>=h&&!l.classList.contains("hideScreen")&&l.classList.add("hideScreen"),"4:3"===this.screenAspectRatio||"16:9"===this.screenAspectRatio))if(Math.floor(i)>=n&&Math.floor(s)>=r){const i=t/n;e/r>=("16:9"===this.screenAspectRatio?i*(9/16):i*(3/4))?l.style.width=t/n-2+"px":l.style.height=e/r<t/n?e/r-2+"px":t/n-2+"px"}else l.style.height=e/r<t/n?e/r-2+"px":t/n-2+"px"}}getRowHeightColWidth(e=!1,t,i,s,n,r){let a=0,l=0;return t/s<i/n?(l=t/s-2,a="4:3"===r?4/3*(t/s-2):16/9*(t/s-2)):(l=i/n-2,a="4:3"===r?4/3*(i/n-2):16/9*(i/n-2)),e?a:l}screenLabelHelperCreate(e,t=""){var i,s,n,r;if(!this._screenListContainer.children[e])return;const a=this.querySelector(`#${this.getCrId()}-screen-label-${e}`),l=a?a.children[0]:null,o=this.querySelector(`#${this.getCrId()}-screen-${e}`);t=o?o.labelInnerHTML:t,this.contractName&&"innerHTML"===this.contractScreenLabelType?this._screenListContainer.children[e].getElementsByTagName("span")[0].innerHTML=null==(i=this.signalHolderForScreenLabel.receiveStateScriptScreenLabelHtml[e])?void 0:i.value:this.contractName&&"textContent"===this.contractScreenLabelType?this._screenListContainer.children[e].getElementsByTagName("span")[0].textContent=null==(s=this.signalHolderForScreenLabel.receiveStateScreenLabel[e])?void 0:s.value:this.hasAttribute("receiveStateScriptScreenLabelHtml")&&this.receiveStateScriptScreenLabelHtml?this._screenListContainer.children[e].getElementsByTagName("span")[0].innerHTML=null==(n=this.signalHolderForScreenLabel.receiveStateScriptScreenLabelHtml[e])?void 0:n.value:this.hasAttribute("receiveStateScreenLabel")&&this.receiveStateScreenLabel?this._screenListContainer.children[e].getElementsByTagName("span")[0].textContent=null==(r=this.signalHolderForScreenLabel.receiveStateScreenLabel[e])?void 0:r.value:l?(Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(l,e,this.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(l,e,this.indexId),this._screenListContainer.children[e].getElementsByTagName("span")[0].innerHTML=l.innerHTML.trim()):t&&(this._screenListContainer.children[e].getElementsByTagName("span")[0].innerHTML=t.trim())}sourceLabelHelperCreate(e,t=""){var i,s,n,r;if(!this._sourceListContainer.children[e])return;const a=this.querySelector(`#${this.getCrId()}-source-label-${e}`),l=a?a.children[0]:null,o=this.querySelector(`#${this.getCrId()}-source-${e}`);t=o?o.labelInnerHTML:t,this.contractName&&"innerHTML"===this.contractSourceLabelType?this._sourceListContainer.children[e].getElementsByTagName("span")[0].innerHTML=null==(i=this.signalHolderForSourceLabel.receiveStateScriptSourceLabelHtml[e])?void 0:i.value:this.contractName&&"textContent"===this.contractSourceLabelType?this._sourceListContainer.children[e].getElementsByTagName("span")[0].textContent=null==(s=this.signalHolderForSourceLabel.receiveStateSourceLabel[e])?void 0:s.value:this.hasAttribute("receiveStateScriptSourceLabelHtml")&&this.receiveStateScriptSourceLabelHtml?this._sourceListContainer.children[e].getElementsByTagName("span")[0].innerHTML=null==(n=this.signalHolderForSourceLabel.receiveStateScriptSourceLabelHtml[e])?void 0:n.value:this.hasAttribute("receiveStateSourceLabel")&&this.receiveStateSourceLabel?this._sourceListContainer.children[e].getElementsByTagName("span")[0].textContent=null==(r=this.signalHolderForSourceLabel.receiveStateSourceLabel[e])?void 0:r.value:l?(Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsAttrs(l,e,this.indexId),Ch5AugmentVarSignalsNames.replaceIndexIdInTmplElemsContent(l,e,this.indexId),this._sourceListContainer.children[e].getElementsByTagName("span")[0].innerHTML=l.innerHTML.trim()):t&&(this._sourceListContainer.children[e].getElementsByTagName("span")[0].innerHTML=t.trim())}sourceIconHelperCreate(t,i){const s=this.querySelector(`#${this.getCrId()}-source-${t}`);if(s&&s.iconUrl)i.style.removeProperty("backgroundImage"),i.classList.add("source-icon-url"),i.style.backgroundImage=`url(${s.iconUrl})`;else if(this.sourceIconUrl)i.style.removeProperty("backgroundImage"),i.classList.add("source-icon-url"),i.style.backgroundImage=`url(${this.sourceIconUrl})`;else{(s&&s.iconClass?s.iconClass:this.sourceIconClass?this.sourceIconClass:e.DEFAULT_SOURCE_ICON).split(" ").forEach(e=>{""!==(e=e.trim())&&i.classList.add(e)})}}screenAlignLabelHelperCreate(e,t){const i=this.primaryCssClass+"--screen-list-label-",s=["center","left","right"];Array.from(s).forEach(e=>{t.classList.remove(i+e)});const n=this.querySelector(`#${this.getCrId()}-screen-${e}`);n&&n.alignLabel?t.classList.add(i+n.alignLabel):t.classList.add(i+s[0])}handleDragStartSource(e){const t=this._sourceListContainer.querySelector(`[sourceid="${e}"]`);null==t||t.classList.add("dragging")}handleDragEndSource(e){const t=this._sourceListContainer.querySelector(`[sourceid="${e}"]`);null==t||t.classList.remove("dragging")}handleDragoverScreen(e,t){t.preventDefault()}handleDropScreen(e){var t,i,s;this.validDrop=!0;const n=this.querySelector(".dragging");if(e!==+((null==(t=n.parentElement)?void 0:t.getAttribute("screenid"))+""))if(n&&n.classList.contains("source-onscreen")){const t=this.querySelector(`[screenid="${e}"]`),r=2===t.children.length?Number(t.children[1].getAttribute("sourceId")):-1;this.handleSendEventOnDrop((null==(i=n.parentElement)?void 0:i.getAttribute("screenid"))+"",r),this.handleSendEventOnDrop(e+"",n.getAttribute("sourceId")),this.handleSendEventOnChange(e+""),this.handleSendEventOnChange((null==(s=n.parentElement)?void 0:s.getAttribute("screenid"))+"")}else this.handleSendEventOnChange(e+""),n&&n.getAttribute("sourceId")&&this.handleSendEventOnDrop(e+"",n.getAttribute("sourceId")),this.receiveStateSourceChanged||this.contractName||this.addSourceToScreen(n,this._screenListContainer.children[e],e,!1)}addSourceToScreenOnFB(e,t){const i=this._sourceListContainer.querySelector(`[sourceid="${t-1}"]`),s=this._screenListContainer.querySelector(`[screenid="${e}"]`);0===t&&2===(null==s?void 0:s.children.length)&&(null==s||s.removeChild(null==s?void 0:s.children[1])),i&&s&&this.addSourceToScreen(i,s,e,!0)}addSourceToScreen(e,t,i,s){const n=document.createElement("div");n.innerHTML=null==e?void 0:e.innerHTML,n.classList.add("draggable"),n.classList.add("source-onscreen"),n.setAttribute("draggable","true"),e&&(null==e?void 0:e.getAttribute("sourceid"))&&n.setAttribute("sourceId",(null==e?void 0:e.getAttribute("sourceid"))+"");const r=n.children[0];r.classList.contains("source-icon-url")&&(r.style.height=.27*t.offsetHeight+"px",r.style.width="100%"),n.style.fontSize=.27*t.offsetHeight+"px",2===(null==t?void 0:t.children.length)&&(null==t||t.removeChild(null==t?void 0:t.children[1])),s?(n.addEventListener("dragstart",this.handleDragStartForSourceOnScreen.bind(this,i)),n.addEventListener("dragend",this.handleDragEndForSourceOnScreen.bind(this,i)),t.appendChild(n)):(t.appendChild(n),setTimeout(()=>{2===(null==t?void 0:t.children.length)&&(null==t||t.removeChild(null==t?void 0:t.children[1]))},1500))}handleResizeComponent(){for(let e=0;e<this.numberOfScreens;e++)if(this._screenListContainer.children[e].children.length>1){const t=this._screenListContainer.children[e],i=this._screenListContainer.children[e].children[1];i.style.fontSize=.27*t.offsetHeight+"px";const s=i.children[0];s.classList.contains("source-icon-url")&&(s.style.height=.27*t.offsetHeight+"px",s.style.width="100%")}this.endless&&("top"===this.sourceListPosition||"bottom"===this.sourceListPosition?this._sourceListContainer.scrollLeft+=5:this._sourceListContainer.scrollTop+=5),this.initScrollbar()}handleDragStartForSourceOnScreen(e){this.validDrop=!1,this._screenListContainer.children[e].children[1].classList.add("dragging")}handleDragEndForSourceOnScreen(e,t){var i,s,n;null==(n=null==(s=null==(i=this._screenListContainer.children[e])?void 0:i.children[1])?void 0:s.classList)||n.remove("dragging"),"copy"===t.dataTransfer.dropEffect||this.validDrop||(this.handleSendEventOnDrop(e+"",-1),this.handleSendEventOnChange(e+""),t.target.remove())}clearSubscriptions(){this.signalHolder.forEach(e=>{this.clearOldSubscriptionNumber(e.signalValue,e.signalState)}),this.signalHolder.length=0,Object.keys(this.signalHolderForSourceLabel).forEach(e=>{this.signalHolderForSourceLabel[e].forEach(e=>{this.clearOldSubscriptionString(e.signalValue,e.signalState)}),this.signalHolderForSourceLabel[e]=[]}),Object.keys(this.signalHolderForScreenLabel).forEach(e=>{this.signalHolderForScreenLabel[e].forEach(e=>{this.clearOldSubscriptionString(e.signalValue,e.signalState)}),this.signalHolderForScreenLabel[e]=[]})}setNumberOfItems(e){this._ch5Properties.setForSignalResponse("numberOfScreens",e,()=>{if(this.numberOfScreenBackup>this.numberOfScreens)for(let e=this.numberOfScreens;e<this.numberOfScreenBackup;e++)this.handleSendEventOnDrop(e+"",-1),this.handleSendEventOnChange(e+"");this.numberOfScreenBackup=this.numberOfScreens,this.createScreen()})}replaceAll(e,t,i){return e&&""!==String(e).trim()?String(e).split(t).join(i):e}};Ch5VideoSwitcher.registerCustomElement(),Ch5VideoSwitcher.registerSignalAttributeTypes();import _42 from"lodash";var Ch5VideoSwitcherScreen=class e extends Ch5Log{static ELEMENT_NAME="ch5-video-switcher-screen";static ALIGN_LABEL=["center","left","right"];static COMPONENT_PROPERTIES=[{default:e.ALIGN_LABEL[0],enumeratedValues:e.ALIGN_LABEL,name:"alignLabel",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ALIGN_LABEL[0],isObservableProperty:!0},{default:"",name:"labelInnerHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];_ch5Properties;parentComponent=null;set alignLabel(t){this._ch5Properties.set("alignLabel",t,()=>{var t,i;const s=null==(t=this.getAttribute("id"))?void 0:t.split("-").pop(),n=null==(i=this.parentComponent)?void 0:i._screenListContainer.querySelector(`[screenid="${s}"]`);this.parentComponent&&n&&(Array.from(e.ALIGN_LABEL).forEach(e=>{n.classList.remove("ch5-video-switcher--screen-list-label-"+e)}),n.classList.add("ch5-video-switcher--screen-list-label-"+this.alignLabel))})}get alignLabel(){return this._ch5Properties.get("alignLabel")}set labelInnerHTML(e){this._ch5Properties.set("labelInnerHTML",e,()=>{const e=this.getAttribute("id"),t=(null==e?void 0:e.split("-"))?null==e?void 0:e.split("-"):[];this.parentComponent&&this.parentComponent.screenLabelHelperCreate(+t[4],this.labelInnerHTML)})}get labelInnerHTML(){return this._ch5Properties.get("labelInnerHTML")}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()"),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.parentComponent=this.getParentElement()}static get observedAttributes(){const t=Ch5Log.observedAttributes;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&t.push(e.COMPONENT_PROPERTIES[i].name.toLowerCase());return t}attributeChangedCallback(t,i,s){if(i!==s){this.logger.log(this.nodeName+' attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){var e;if(this.logger.start("connectedCallback()"),"ch5-video-switcher"!==(null==(e=this.parentElement)?void 0:e.nodeName.toLowerCase()))throw new Error("Invalid parent element for ch5-video-switcher-screen.");this.setAttribute("role",Ch5RoleAttributeMapping.ch5VideoSwitcherScreen),this.screenLabelHelper(),this.initAttributes(),this.logger.stop()}getParentElement(){const e=t=>_42.isNil(t)||"CH5-VIDEO-SWITCHER"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}screenLabelHelper(){const e=this.getAttribute("id"),t=(null==e?void 0:e.split("-"))?null==e?void 0:e.split("-"):[];this.parentComponent&&this.parentComponent.screenLabelHelperCreate(+t[4])}};Ch5VideoSwitcherScreen.registerCustomElement();var Ch5VideoSwitcherScreenLabel=class e extends Ch5Log{static ELEMENT_NAME="ch5-video-switcher-screen-label";static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()"),this.logger.stop()}connectedCallback(){var e;if(this.logger.start("connectedCallback()"),"ch5-video-switcher-screen"!==(null==(e=this.parentElement)?void 0:e.nodeName.toLowerCase()))throw new Error("Invalid parent element for ch5-video-switcher-screen-label.");this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5VideoSwitcherScreenLabel),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}};Ch5VideoSwitcherScreenLabel.registerCustomElement();import _43 from"lodash";var Ch5VideoSwitcherSource=class e extends Ch5Log{static ELEMENT_NAME="ch5-video-switcher-source";static COMPONENT_PROPERTIES=[{default:"",name:"iconClass",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"iconUrl",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:"",name:"labelInnerHTML",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0}];_ch5Properties;parentComponent=null;set iconClass(e){this._ch5Properties.set("iconClass",e,()=>{this.handleIcon()})}get iconClass(){return this._ch5Properties.get("iconClass")}set iconUrl(e){this._ch5Properties.set("iconUrl",e,()=>{this.handleIcon()})}get iconUrl(){return this._ch5Properties.get("iconUrl")}set labelInnerHTML(e){this._ch5Properties.set("labelInnerHTML",e,()=>{var e;const t=Number(null==(e=this.getAttribute("id"))?void 0:e.split("-").pop());this.parentComponent&&this.parentComponent.sourceLabelHelperCreate(t,this.labelInnerHTML)})}get labelInnerHTML(){return this._ch5Properties.get("labelInnerHTML")}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()"),this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.parentComponent=this.getParentElement()}static get observedAttributes(){const t=Ch5Log.observedAttributes;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&t.push(e.COMPONENT_PROPERTIES[i].name.toLowerCase());return t}attributeChangedCallback(t,i,s){if(i!==s){this.logger.log(this.nodeName+' attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){var e;if(this.logger.start("connectedCallback()"),"ch5-video-switcher"!==(null==(e=this.parentElement)?void 0:e.nodeName.toLowerCase()))throw new Error("Invalid parent element for ch5-video-switcher-source.");this.setAttribute("role",Ch5RoleAttributeMapping.ch5VideoSwitcherSource),this.sourceLabelHelper(),this.initAttributes(),this.logger.stop()}getParentElement(){const e=t=>_43.isNil(t)||"CH5-VIDEO-SWITCHER"===t.nodeName.toString().toUpperCase()?t:e(t.parentNode);return e(this.parentElement)}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}sourceLabelHelper(){const e=this.getAttribute("id"),t=(null==e?void 0:e.split("-"))?null==e?void 0:e.split("-"):[];this.parentComponent&&this.parentComponent.sourceLabelHelperCreate(+t[4])}handleIcon(){var e,t;if(this.iconUrl){const t=Number(null==(e=this.getAttribute("id"))?void 0:e.split("-").pop());if(this.parentComponent&&this.parentComponent._sourceListContainer.children[t]){const e=this.parentComponent._sourceListContainer.children[t].getElementsByTagName("i");e[0].setAttribute("class",""),e[0].classList.add("source-icon"),e[0].classList.add("source-icon-url"),e[0].style.backgroundImage=`url(${this.iconUrl})`}}else{const e=Number(null==(t=this.getAttribute("id"))?void 0:t.split("-").pop());if(this.parentComponent&&this.parentComponent._sourceListContainer.children[e]){const t=this.parentComponent._sourceListContainer.children[e].getElementsByTagName("i");t[0].setAttribute("class",""),t[0].classList.add("source-icon"),this.iconClass.split(" ").forEach(e=>{""!==(e=e.trim())&&t[0].classList.add(e)})}}}};Ch5VideoSwitcherSource.registerCustomElement();var Ch5VideoSwitcherSourceLabel=class e extends Ch5Log{static ELEMENT_NAME="ch5-video-switcher-source-label";static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.logger.start("constructor()"),this.logger.stop()}connectedCallback(){var e;if(this.logger.start("connectedCallback()"),"ch5-video-switcher-source"!==(null==(e=this.parentElement)?void 0:e.nodeName.toLowerCase()))throw new Error("Invalid parent element for ch5-video-switcher-source-label.");this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5VideoSwitcherSourceLabel),this.setAttribute("data-ch5-id",this.getCrId()),this.initAttributes(),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.logger.stop()}};Ch5VideoSwitcherSourceLabel.registerCustomElement();var Ch5WifiSignalLevelGauge=class e extends Ch5Common{static MIN_NUMBER_OF_BARS=0;static MAX_NUMBER_OF_BARS=3;static GAUGE_STYLES=["light","accents","dark"];static ALIGNMENTS=["up","down","left","right"];static SIZES=["regular","small","large","x-large"];static COMPONENT_DATA={GAUGE_STYLE:{default:e.GAUGE_STYLES[0],values:e.GAUGE_STYLES,key:"gaugeStyle",attribute:"gaugeStyle",classListPrefix:"--gauge-style-"},ALIGNMENT:{default:e.ALIGNMENTS[0],values:e.ALIGNMENTS,key:"alignment",attribute:"alignment",classListPrefix:"--alignment-"},SIZE:{default:e.SIZES[0],values:e.SIZES,key:"size",attribute:"size",classListPrefix:"--size-"}};static SIGNAL_ATTRIBUTE_TYPES={...Ch5Common.SIGNAL_ATTRIBUTE_TYPES,receivestatevalue:{direction:"state",numericJoin:1,contractName:!0}};static COMPONENT_PROPERTIES=[{default:0,name:"value",removeAttributeOnNull:!0,nameForSignal:"receiveStateValue",type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:100,conditionalMin:0,conditionalMax:100,conditionalMinValue:0,conditionalMaxValue:100},isObservableProperty:!0},{default:"",isSignal:!0,name:"receiveStateValue",signalType:"number",removeAttributeOnNull:!0,type:"string",valueOnAttributeEmpty:"",isObservableProperty:!0},{default:e.GAUGE_STYLES[0],enumeratedValues:e.GAUGE_STYLES,name:"gaugeStyle",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.GAUGE_STYLES[0],isObservableProperty:!0},{default:e.ALIGNMENTS[0],enumeratedValues:e.ALIGNMENTS,name:"alignment",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.ALIGNMENTS[0],isObservableProperty:!0},{default:0,name:"minValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:0,max:99,conditionalMin:0,conditionalMax:99,conditionalMinValue:0,conditionalMaxValue:99},isObservableProperty:!0},{default:100,name:"maxValue",removeAttributeOnNull:!0,type:"number",valueOnAttributeEmpty:null,numberProperties:{min:1,max:100,conditionalMin:1,conditionalMax:100,conditionalMinValue:1,conditionalMaxValue:100},isObservableProperty:!0},{default:e.SIZES[0],enumeratedValues:e.SIZES,name:"size",removeAttributeOnNull:!0,type:"enum",valueOnAttributeEmpty:e.SIZES[0],isObservableProperty:!0}];static ELEMENT_NAME="ch5-wifi-signal-level-gauge";primaryCssClass="ch5-wifi-signal-level-gauge";_ch5Properties;_elContainer={};_elInnerContainer={};_elTopSignal={};_elMiddleSignal={};_elBottomSignal={};set value(e){this._ch5Properties.set("value",e,()=>{this.value<this.minValue?this.value=this.minValue:this.value>this.maxValue&&(this.value=this.maxValue),this.handleValue()})}get value(){return this._ch5Properties.get("value")}set receiveStateValue(e){this._ch5Properties.set("receiveStateValue",e,null,e=>{this._ch5Properties.setForSignalResponse("value",e,()=>{this.handleValue()})})}get receiveStateValue(){return this._ch5Properties.get("receiveStateValue")}set gaugeStyle(e){this._ch5Properties.set("gaugeStyle",e,()=>{this.handleGaugeStyle()})}get gaugeStyle(){return this._ch5Properties.get("gaugeStyle")}set alignment(e){this._ch5Properties.set("alignment",e,()=>{this.handleAlignment()})}get alignment(){return this._ch5Properties.get("alignment")}set minValue(e){this._ch5Properties.set("minValue",e,()=>{this.minValue>=this.maxValue&&(this.minValue=0),this.handleValue()})}get minValue(){return this._ch5Properties.get("minValue")}set maxValue(e){this._ch5Properties.set("maxValue",e,()=>{this.maxValue<=this.minValue&&(this.maxValue=100),this.handleValue()})}get maxValue(){return this._ch5Properties.get("maxValue")}set size(e){this._ch5Properties.set("size",e,()=>{this.handleSize()})}get size(){return this._ch5Properties.get("size")}static registerSignalAttributeTypes(){Ch5SignalAttributeRegistry.instance.addElementAttributeEntries(e.ELEMENT_NAME,e.SIGNAL_ATTRIBUTE_TYPES)}static registerCustomElement(){"object"==typeof window&&"object"==typeof window.customElements&&"function"==typeof window.customElements.define&&void 0===window.customElements.get(e.ELEMENT_NAME)&&window.customElements.define(e.ELEMENT_NAME,e)}constructor(){super(),this.ignoreAttributes=["receivestatecustomclass","receivestatecustomstyle","receivestatehidepulse","receivestateshowpulse","sendeventonshow"],this.logger.start("constructor()",e.ELEMENT_NAME),this._wasInstatiated||this.createInternalHtml(),this._wasInstatiated=!0,this._ch5Properties=new Ch5Properties(this,e.COMPONENT_PROPERTIES),this.initCssClass()}static get observedAttributes(){const t=Ch5Common.observedAttributes,i=[];for(let t=0;t<e.COMPONENT_PROPERTIES.length;t++)!0===e.COMPONENT_PROPERTIES[t].isObservableProperty&&i.push(e.COMPONENT_PROPERTIES[t].name.toLowerCase());return t.concat(i)}attributeChangedCallback(t,i,s){if(this.logger.start("attributeChangedCallback",this.primaryCssClass),i!==s){this.logger.log('ch5-wifi-signal-level-gauge attributeChangedCallback("'+t+'","'+i+'","'+s+'")');const n=e.COMPONENT_PROPERTIES.find(e=>e.name.toLowerCase()===t.toLowerCase()&&!0===e.isObservableProperty);if(n){this[n.name]=s}else super.attributeChangedCallback(t,i,s)}this.logger.stop()}connectedCallback(){this.logger.start("connectedCallback()",e.ELEMENT_NAME),this.hasAttribute("role")||this.setAttribute("role",Ch5RoleAttributeMapping.ch5WifiSignalLevelGauge),this._elContainer.parentElement!==this&&this.appendChild(this._elContainer),this.attachEventListeners(),this.initAttributes(),this.initCommonMutationObserver(this),this.handleValue(),customElements.whenDefined("ch5-wifi-signal-level-gauge").then(()=>{this.componentLoadedEvent(e.ELEMENT_NAME,this.id)}),resizeObserver(this._elContainer,this.setContainerBorderWidth.bind(this)),subscribeInViewPortChange(this,()=>{this.elementIsInViewPort&&this.setContainerBorderWidth()}),this.logger.stop()}disconnectedCallback(){this.logger.start("disconnectedCallback()"),this.removeEventListeners(),this.unsubscribeFromSignals(),this.logger.stop()}setContainerBorderWidth(){let e=this.offsetWidth,t=this.offsetHeight;"left"!==this.alignment&&"right"!==this.alignment||(e=this.offsetHeight,t=this.offsetWidth),this._elTopSignal.style.borderWidth=Math.floor(e/6)+"px",this._elMiddleSignal.style.borderWidth=Math.floor(e/6)+"px",this._elBottomSignal.style.borderWidth=Math.floor(t/3)+"px"}createInternalHtml(){this.logger.start("createInternalHtml()"),this.clearComponentContent(),this._elContainer=document.createElement("div"),this._elInnerContainer=document.createElement("div"),this._elTopSignal=document.createElement("div"),this._elMiddleSignal=document.createElement("div"),this._elBottomSignal=document.createElement("div"),this._elContainer.classList.add("ch5-wifi-signal-level-gauge"),this._elInnerContainer.classList.add("ch5-wifi-signal-level-gauge--inner-container"),this._elTopSignal.classList.add("ch5-wifi-signal-level-gauge-top-signal"),this._elMiddleSignal.classList.add("ch5-wifi-signal-level-gauge-middle-signal"),this._elBottomSignal.classList.add("ch5-wifi-signal-level-gauge-bottom-signal"),this._elTopSignal.classList.add("ch5-wifi-signal-level-gauge--selected-false"),this._elMiddleSignal.classList.add("ch5-wifi-signal-level-gauge--selected-false"),this._elBottomSignal.classList.add("ch5-wifi-signal-level-gauge--selected-false"),this._elInnerContainer.appendChild(this._elTopSignal),this._elInnerContainer.appendChild(this._elMiddleSignal),this._elInnerContainer.appendChild(this._elBottomSignal),this._elContainer.appendChild(this._elInnerContainer),this.logger.stop()}initAttributes(){super.initAttributes();const t=this;for(let i=0;i<e.COMPONENT_PROPERTIES.length;i++)if(!0===e.COMPONENT_PROPERTIES[i].isObservableProperty&&this.hasAttribute(e.COMPONENT_PROPERTIES[i].name.toLowerCase())){const s=e.COMPONENT_PROPERTIES[i].name;t[s]=this.getAttribute(s)}}unsubscribeFromSignals(){super.unsubscribeFromSignals(),this._ch5Properties.unsubscribe()}clearComponentContent(){const e=this.getElementsByTagName("div");Array.from(e).forEach(e=>{e.remove()})}handleGaugeStyle(){Array.from(e.COMPONENT_DATA.GAUGE_STYLE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.GAUGE_STYLE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.GAUGE_STYLE.classListPrefix+this.gaugeStyle)}handleAlignment(){Array.from(e.COMPONENT_DATA.ALIGNMENT.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.ALIGNMENT.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ALIGNMENT.classListPrefix+this.alignment)}handleValue(){let t=Math.round((this.value-this.minValue)*e.MAX_NUMBER_OF_BARS/(this.maxValue-this.minValue));t>e.MAX_NUMBER_OF_BARS?t=e.MAX_NUMBER_OF_BARS:t<e.MIN_NUMBER_OF_BARS&&(t=e.MIN_NUMBER_OF_BARS),0===t?(this.setClassForWifiBasedOnValue(this._elTopSignal,!1),this.setClassForWifiBasedOnValue(this._elMiddleSignal,!1),this.setClassForWifiBasedOnValue(this._elBottomSignal,!1)):1===t?(this.setClassForWifiBasedOnValue(this._elTopSignal,!1),this.setClassForWifiBasedOnValue(this._elMiddleSignal,!1),this.setClassForWifiBasedOnValue(this._elBottomSignal,!0)):2===t?(this.setClassForWifiBasedOnValue(this._elTopSignal,!1),this.setClassForWifiBasedOnValue(this._elMiddleSignal,!0),this.setClassForWifiBasedOnValue(this._elBottomSignal,!0)):3===t&&(this.setClassForWifiBasedOnValue(this._elTopSignal,!0),this.setClassForWifiBasedOnValue(this._elMiddleSignal,!0),this.setClassForWifiBasedOnValue(this._elBottomSignal,!0))}setClassForWifiBasedOnValue(e,t){e.classList.contains("ch5-wifi-signal-level-gauge--selected-"+String(t))||(e.classList.remove("ch5-wifi-signal-level-gauge--selected-"+String(!t)),e.classList.add("ch5-wifi-signal-level-gauge--selected-"+String(t)))}handleSize(){Array.from(e.COMPONENT_DATA.SIZE.values).forEach(t=>{this._elContainer.classList.remove(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+t)}),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+this.size)}initCssClass(){this.logger.start("initCssClass"),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.GAUGE_STYLE.classListPrefix+this.gaugeStyle),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.ALIGNMENT.classListPrefix+this.alignment),this._elContainer.classList.add(e.ELEMENT_NAME+e.COMPONENT_DATA.SIZE.classListPrefix+this.size),this.logger.stop()}getTargetElementForCssClassesAndStyle(){return this._elContainer}getCssClassDisabled(){return this.primaryCssClass+"--disabled"}};Ch5WifiSignalLevelGauge.registerCustomElement(),Ch5WifiSignalLevelGauge.registerSignalAttributeTypes();export{Ch5Animation,Ch5AttrsAppendclass,Ch5AttrsAppendstyle,Ch5AttrsEnable,Ch5AttrsHidePulse,Ch5AttrsI18n,Ch5AttrsInnerhtml,Ch5AttrsLog,Ch5AttrsShow,Ch5AttrsShowPulse,Ch5AttrsTextContent,Ch5Background,Ch5Button,Ch5ButtonBase,Ch5ButtonLabel,Ch5ButtonList,Ch5ButtonListIndividualButton,Ch5ButtonListLabel,Ch5ButtonListMode,Ch5ButtonListModeState,Ch5ButtonMode,Ch5ButtonModeState,Ch5ColorChip,Ch5ColorPicker,Ch5ComponentLibrary,Ch5Config,Ch5CustomAttributes,Ch5DateTime,Ch5Debug,Ch5Dpad,Ch5Emulator,Ch5Form,Ch5Heartbeats,Ch5Image,Ch5ImageMode,Ch5ImportHtmlSnippet,Ch5JoinToTextBoolean,Ch5JoinToTextNumeric,Ch5JoinToTextString,Ch5Keypad,Ch5Label,Ch5List,Ch5ListItemAxis,Ch5MediaPlayer,Ch5MediaPlayerMyMusic,Ch5MediaPlayerNowPlaying,Ch5ModalDialog,Ch5OverlayPanel,Ch5Platform,Ch5QrCode,Ch5Resync,Ch5RoleAttributeMapping,Ch5SegmentedGauge,Ch5Select,Ch5SelectOption,Ch5Signal,Ch5SignalBehaviorSubject,Ch5SignalBridge,Ch5SignalFactory,Ch5SignalLevelGauge,Ch5Slider,Ch5SliderButton,Ch5Spinner,Ch5SubpageReferenceList,Ch5TabButton,Ch5TabButtonIndividualButton,Ch5TabButtonLabel,Ch5Template,Ch5Text,Ch5TextInput,Ch5Toggle,Ch5TouchActivity,Ch5TouchActivitySignals,Ch5TranslationFactory,Ch5TranslationListeners,Ch5TranslationUtility,Ch5TriggerView,Ch5TriggerViewChild,Ch5Uid,Ch5Video,Ch5VideoSwitcher,Ch5VideoSwitcherScreen,Ch5VideoSwitcherScreenLabel,Ch5VideoSwitcherSource,Ch5VideoSwitcherSourceLabel,Ch5WifiSignalLevelGauge,LogMessage,LogMessagesFilter,Logger,bridgeReceiveBooleanFromNative,bridgeReceiveIntegerFromNative,bridgeReceiveObjectFromNative,bridgeReceiveStringFromNative,buildDate,countNumberOfCh5Components,debounce,duration,easeMode,generateSubSigScriptKey,getBooleanSignalValue,getLogger,getNumericSignalValue,getObjectSignalValue,getRemoteAppender,getState,getStringSignalValue,getSubscriptionsCount,isCrestronTouchscreen,isIosDevice,languageChangedSignalName,publishEvent,refreshCh5Template,refreshCh5subpageReferenceList,registerTranslationInterface,removeTransition,setTransition,signalNameForLibraryBuildDate,signalNameForLibraryVersion,subscribeInViewPortChange,subscribeState,subscribeStateScript,subscribeStateScriptSigSubs,textformat,transitionIneffects,transitionOuteffects,translationFactory,triggerTranslation,unSubscribeInViewPortChange,unsubscribeState,unsubscribeStateScript,uriSchemaValidation,version};
|