@uploadcare/file-uploader 1.28.0-alpha.1 → 1.28.0-alpha.666
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract/loadFileUploaderFrom.d.ts +4 -3
- package/dist/abstract/loadFileUploaderFrom.js +6 -7
- package/dist/env.d.ts +4 -2
- package/dist/env.js +6 -7
- package/dist/index.css +6 -9
- package/dist/index.d.ts +3099 -42
- package/dist/index.js +8 -1796
- package/dist/index.layered.css +7 -9
- package/dist/index.ssr.js +1609 -0
- package/dist/locales/file-uploader/ar.d.ts +2 -1
- package/dist/locales/file-uploader/ar.js +6 -142
- package/dist/locales/file-uploader/az.d.ts +2 -1
- package/dist/locales/file-uploader/az.js +6 -134
- package/dist/locales/file-uploader/ca.d.ts +2 -1
- package/dist/locales/file-uploader/ca.js +6 -136
- package/dist/locales/file-uploader/cs.d.ts +2 -1
- package/dist/locales/file-uploader/cs.js +6 -138
- package/dist/locales/file-uploader/da.d.ts +2 -1
- package/dist/locales/file-uploader/da.js +6 -134
- package/dist/locales/file-uploader/de.d.ts +2 -1
- package/dist/locales/file-uploader/de.js +6 -134
- package/dist/locales/file-uploader/el.d.ts +2 -1
- package/dist/locales/file-uploader/el.js +6 -134
- package/dist/locales/file-uploader/en.d.ts +2 -1
- package/dist/locales/file-uploader/en.js +6 -7
- package/dist/locales/file-uploader/es.d.ts +2 -1
- package/dist/locales/file-uploader/es.js +6 -136
- package/dist/locales/file-uploader/et.d.ts +2 -1
- package/dist/locales/file-uploader/et.js +6 -134
- package/dist/locales/file-uploader/fi.d.ts +2 -1
- package/dist/locales/file-uploader/fi.js +6 -134
- package/dist/locales/file-uploader/fr.d.ts +2 -1
- package/dist/locales/file-uploader/fr.js +6 -136
- package/dist/locales/file-uploader/he.d.ts +2 -1
- package/dist/locales/file-uploader/he.js +6 -136
- package/dist/locales/file-uploader/hy.d.ts +2 -1
- package/dist/locales/file-uploader/hy.js +6 -134
- package/dist/locales/file-uploader/is.d.ts +2 -1
- package/dist/locales/file-uploader/is.js +6 -134
- package/dist/locales/file-uploader/it.d.ts +2 -1
- package/dist/locales/file-uploader/it.js +6 -136
- package/dist/locales/file-uploader/ja.d.ts +2 -1
- package/dist/locales/file-uploader/ja.js +6 -134
- package/dist/locales/file-uploader/ka.d.ts +2 -1
- package/dist/locales/file-uploader/ka.js +6 -134
- package/dist/locales/file-uploader/kk.d.ts +2 -1
- package/dist/locales/file-uploader/kk.js +6 -134
- package/dist/locales/file-uploader/ko.d.ts +2 -1
- package/dist/locales/file-uploader/ko.js +6 -134
- package/dist/locales/file-uploader/lv.d.ts +2 -1
- package/dist/locales/file-uploader/lv.js +6 -136
- package/dist/locales/file-uploader/nb.d.ts +2 -1
- package/dist/locales/file-uploader/nb.js +6 -134
- package/dist/locales/file-uploader/nl.d.ts +2 -1
- package/dist/locales/file-uploader/nl.js +6 -134
- package/dist/locales/file-uploader/pl.d.ts +2 -1
- package/dist/locales/file-uploader/pl.js +6 -138
- package/dist/locales/file-uploader/pt.d.ts +2 -1
- package/dist/locales/file-uploader/pt.js +6 -136
- package/dist/locales/file-uploader/ro.d.ts +2 -1
- package/dist/locales/file-uploader/ro.js +6 -136
- package/dist/locales/file-uploader/ru.d.ts +2 -1
- package/dist/locales/file-uploader/ru.js +6 -138
- package/dist/locales/file-uploader/sk.d.ts +2 -1
- package/dist/locales/file-uploader/sk.js +6 -138
- package/dist/locales/file-uploader/sr.d.ts +2 -1
- package/dist/locales/file-uploader/sr.js +6 -136
- package/dist/locales/file-uploader/sv.d.ts +2 -1
- package/dist/locales/file-uploader/sv.js +6 -134
- package/dist/locales/file-uploader/tr.d.ts +2 -1
- package/dist/locales/file-uploader/tr.js +6 -134
- package/dist/locales/file-uploader/uk.d.ts +2 -1
- package/dist/locales/file-uploader/uk.js +6 -138
- package/dist/locales/file-uploader/vi.d.ts +2 -1
- package/dist/locales/file-uploader/vi.js +6 -134
- package/dist/locales/file-uploader/zh-TW.d.ts +2 -1
- package/dist/locales/file-uploader/zh-TW.js +6 -134
- package/dist/locales/file-uploader/zh.d.ts +2 -1
- package/dist/locales/file-uploader/zh.js +6 -134
- package/package.json +34 -40
- package/web/file-uploader.iife.min.d.ts +3241 -0
- package/web/file-uploader.iife.min.js +8 -697
- package/web/file-uploader.iife.min.js.LEGAL.txt +71 -0
- package/web/file-uploader.min.d.ts +3241 -0
- package/web/file-uploader.min.js +7 -1858
- package/web/file-uploader.min.js.LEGAL.txt +71 -0
- package/web/uc-basic.layered.min.css +7 -6046
- package/web/uc-basic.min.css +6 -5487
- package/web/uc-cloud-image-editor.layered.min.css +7 -1884
- package/web/uc-cloud-image-editor.min.css +6 -1675
- package/web/uc-cloud-image-editor.min.d.ts +3198 -0
- package/web/uc-cloud-image-editor.min.js +7 -456
- package/web/uc-cloud-image-editor.min.js.LEGAL.txt +70 -0
- package/web/uc-file-uploader-inline.layered.min.css +7 -4352
- package/web/uc-file-uploader-inline.min.css +6 -3836
- package/web/uc-file-uploader-inline.min.d.ts +3241 -0
- package/web/uc-file-uploader-inline.min.js +7 -1858
- package/web/uc-file-uploader-inline.min.js.LEGAL.txt +71 -0
- package/web/uc-file-uploader-minimal.layered.min.css +7 -4352
- package/web/uc-file-uploader-minimal.min.css +6 -3836
- package/web/uc-file-uploader-minimal.min.d.ts +3241 -0
- package/web/uc-file-uploader-minimal.min.js +7 -1858
- package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +71 -0
- package/web/uc-file-uploader-regular.layered.min.css +7 -4352
- package/web/uc-file-uploader-regular.min.css +6 -3836
- package/web/uc-file-uploader-regular.min.d.ts +3241 -0
- package/web/uc-file-uploader-regular.min.js +7 -1858
- package/web/uc-file-uploader-regular.min.js.LEGAL.txt +71 -0
- package/web/uc-img.min.d.ts +75 -0
- package/web/uc-img.min.js +7 -894
- package/web/uc-img.min.js.LEGAL.txt +24 -0
- package/dist/ActivityHeader-R6Mlx-dA.js +0 -9
- package/dist/ActivityHeader.css +0 -23
- package/dist/ActivityHeader.layered.css +0 -24
- package/dist/CameraSource-DDwj1jCV.js +0 -511
- package/dist/CameraSource-n1tun2Df.js +0 -10
- package/dist/CameraSource.css +0 -180
- package/dist/CameraSource.layered.css +0 -209
- package/dist/CloudImageEditor-DcVoIRb3.js +0 -2163
- package/dist/CloudImageEditorActivity-Csij4nlC.js +0 -87
- package/dist/CloudImageEditorActivity-DD4NdU0P.js +0 -9
- package/dist/CloudImageEditorActivity.css +0 -14
- package/dist/CloudImageEditorActivity.layered.css +0 -15
- package/dist/Config-DKOromHY.js +0 -433
- package/dist/Config.css +0 -4
- package/dist/Config.layered.css +0 -5
- package/dist/ExternalSource-6MSUgxqy.js +0 -10
- package/dist/ExternalSource-DVEjSkPB.js +0 -253
- package/dist/ExternalSource.css +0 -98
- package/dist/ExternalSource.layered.css +0 -116
- package/dist/Icon-tXRTvEF2.js +0 -1810
- package/dist/Icon.css +0 -14
- package/dist/Icon.layered.css +0 -15
- package/dist/LitUploaderBlock-LxeOZ0ya.js +0 -998
- package/dist/UrlSource-BkyX00I2.js +0 -73
- package/dist/UrlSource-RI8TSD48.js +0 -10
- package/dist/UrlSource.css +0 -17
- package/dist/UrlSource.layered.css +0 -18
- package/dist/abstract/CTX.d.ts +0 -40
- package/dist/abstract/TypedCollection.d.ts +0 -47
- package/dist/abstract/TypedCollection.test.d.ts +0 -1
- package/dist/abstract/TypedData.d.ts +0 -12
- package/dist/abstract/TypedData.test.d.ts +0 -1
- package/dist/abstract/UploaderPublicApi.d.ts +0 -41
- package/dist/abstract/buildOutputCollectionState.d.ts +0 -3
- package/dist/abstract/customConfigOptions.d.ts +0 -65
- package/dist/abstract/defineComponents.d.ts +0 -1
- package/dist/abstract/features/ClipboardLayer.d.ts +0 -12
- package/dist/abstract/localeRegistry.d.ts +0 -5
- package/dist/abstract/managers/LocaleManager.d.ts +0 -10
- package/dist/abstract/managers/ModalManager.d.ts +0 -53
- package/dist/abstract/managers/SecureUploadsManager.d.ts +0 -7
- package/dist/abstract/managers/TelemetryManager.d.ts +0 -41
- package/dist/abstract/managers/ValidationManager.d.ts +0 -34
- package/dist/abstract/managers/__tests__/ModalManager.test.d.ts +0 -13
- package/dist/abstract/managers/__tests__/SecureUploadsManager.test.d.ts +0 -1
- package/dist/abstract/managers/a11y.d.ts +0 -9
- package/dist/abstract/managers/plugin/PluginManager.d.ts +0 -25
- package/dist/abstract/managers/plugin/PluginTypes.d.ts +0 -146
- package/dist/abstract/managers/plugin/index.d.ts +0 -2
- package/dist/abstract/sharedConfigKey.d.ts +0 -2
- package/dist/abstract/uploadEntrySchema.d.ts +0 -34
- package/dist/blocks/ActivityHeader/ActivityHeader.d.ts +0 -8
- package/dist/blocks/CameraSource/CameraSource.d.ts +0 -121
- package/dist/blocks/CameraSource/__tests__/calcCameraModes.test.d.ts +0 -1
- package/dist/blocks/CameraSource/calcCameraModes.d.ts +0 -5
- package/dist/blocks/CameraSource/constants.d.ts +0 -15
- package/dist/blocks/CloudImageEditor/index.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +0 -60
- package/dist/blocks/CloudImageEditor/src/CropFrame.d.ts +0 -56
- package/dist/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +0 -24
- package/dist/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +0 -14
- package/dist/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +0 -13
- package/dist/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +0 -35
- package/dist/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +0 -56
- package/dist/blocks/CloudImageEditor/src/EditorImageFader.d.ts +0 -63
- package/dist/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +0 -15
- package/dist/blocks/CloudImageEditor/src/EditorScroller.d.ts +0 -15
- package/dist/blocks/CloudImageEditor/src/EditorSlider.d.ts +0 -33
- package/dist/blocks/CloudImageEditor/src/EditorToolbar.d.ts +0 -68
- package/dist/blocks/CloudImageEditor/src/crop-utils.d.ts +0 -36
- package/dist/blocks/CloudImageEditor/src/crop-utils.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/cropper-constants.d.ts +0 -10
- package/dist/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +0 -31
- package/dist/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +0 -19
- package/dist/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +0 -27
- package/dist/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +0 -38
- package/dist/blocks/CloudImageEditor/src/index.d.ts +0 -15
- package/dist/blocks/CloudImageEditor/src/lib/classNames.d.ts +0 -5
- package/dist/blocks/CloudImageEditor/src/lib/classNames.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/linspace.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/linspace.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +0 -4
- package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +0 -2
- package/dist/blocks/CloudImageEditor/src/lib/pick.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/pick.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +0 -7
- package/dist/blocks/CloudImageEditor/src/state.d.ts +0 -20
- package/dist/blocks/CloudImageEditor/src/svg-sprite.d.ts +0 -2
- package/dist/blocks/CloudImageEditor/src/toolbar-constants.d.ts +0 -61
- package/dist/blocks/CloudImageEditor/src/types.d.ts +0 -60
- package/dist/blocks/CloudImageEditor/src/util.d.ts +0 -2
- package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +0 -7
- package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.test.d.ts +0 -1
- package/dist/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +0 -25
- package/dist/blocks/Config/Config.d.ts +0 -60
- package/dist/blocks/Config/assertions.d.ts +0 -5
- package/dist/blocks/Config/computed-properties.d.ts +0 -24
- package/dist/blocks/Config/computed-properties.test.d.ts +0 -1
- package/dist/blocks/Config/initialConfig.d.ts +0 -6
- package/dist/blocks/Config/normalizeConfigValue.d.ts +0 -2
- package/dist/blocks/Config/validatorsType.d.ts +0 -18
- package/dist/blocks/Copyright/Copyright.d.ts +0 -10
- package/dist/blocks/DropArea/DropArea.d.ts +0 -47
- package/dist/blocks/DropArea/addDropzone.d.ts +0 -17
- package/dist/blocks/DropArea/getDropItems.d.ts +0 -12
- package/dist/blocks/ExternalSource/ExternalSource.d.ts +0 -45
- package/dist/blocks/ExternalSource/MessageBridge.d.ts +0 -11
- package/dist/blocks/ExternalSource/buildThemeDefinition.d.ts +0 -4
- package/dist/blocks/ExternalSource/query-string.d.ts +0 -1
- package/dist/blocks/ExternalSource/types.d.ts +0 -105
- package/dist/blocks/FileItem/FileItem.d.ts +0 -50
- package/dist/blocks/FileItem/FileItemConfig.d.ts +0 -10
- package/dist/blocks/FormInput/FormInput.d.ts +0 -18
- package/dist/blocks/Icon/Icon.d.ts +0 -19
- package/dist/blocks/Img/Img.d.ts +0 -14
- package/dist/blocks/Img/ImgBase.d.ts +0 -29
- package/dist/blocks/Img/ImgConfig.d.ts +0 -28
- package/dist/blocks/Img/configurations.d.ts +0 -11
- package/dist/blocks/Img/props-map.d.ts +0 -28
- package/dist/blocks/Img/utils/parseObjectToString.d.ts +0 -2
- package/dist/blocks/Modal/Modal.d.ts +0 -34
- package/dist/blocks/PluginActivityRenderer/PluginActivityRenderer.d.ts +0 -32
- package/dist/blocks/PluginActivityRenderer/index.d.ts +0 -1
- package/dist/blocks/ProgressBar/ProgressBar.d.ts +0 -21
- package/dist/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +0 -17
- package/dist/blocks/Select/Select.d.ts +0 -18
- package/dist/blocks/SimpleBtn/SimpleBtn.d.ts +0 -15
- package/dist/blocks/SourceBtn/SourceBtn.d.ts +0 -23
- package/dist/blocks/SourceList/SourceList.d.ts +0 -24
- package/dist/blocks/Spinner/Spinner.d.ts +0 -9
- package/dist/blocks/StartFrom/StartFrom.d.ts +0 -12
- package/dist/blocks/Thumb/Thumb.d.ts +0 -35
- package/dist/blocks/UploadCtxProvider/EventEmitter.d.ts +0 -70
- package/dist/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +0 -44
- package/dist/blocks/UploadList/UploadList.d.ts +0 -39
- package/dist/blocks/UrlSource/UrlSource.d.ts +0 -14
- package/dist/blocks/svg-backgrounds/svg-backgrounds.d.ts +0 -3
- package/dist/blocks/themes/uc-basic/svg-sprite.d.ts +0 -2
- package/dist/cameraPlugin-weRKO7eG.js +0 -8
- package/dist/cloud-image-editor-hhbyNWLG.js +0 -11
- package/dist/cloud-image-editor.css +0 -1380
- package/dist/cloud-image-editor.layered.css +0 -1549
- package/dist/cloudImageEditorPlugin-FjUgbMK3.js +0 -8
- package/dist/core.d.ts +0 -42
- package/dist/en-8OWEmZim.js +0 -135
- package/dist/env-mM-ksNPq.js +0 -8
- package/dist/externalSourcesPlugin-CMBmLT8S.js +0 -8
- package/dist/imageShrinkPlugin-BN6loiP2.js +0 -8
- package/dist/index-base.css +0 -2497
- package/dist/index-base.layered.css +0 -2837
- package/dist/instagramPlugin-CXRm8MGL.js +0 -8
- package/dist/lit/BaseComponent.d.ts +0 -12
- package/dist/lit/Constructor.d.ts +0 -1
- package/dist/lit/CssDataMixin.d.ts +0 -7
- package/dist/lit/LightDomMixin.d.ts +0 -8
- package/dist/lit/LitActivityBlock.d.ts +0 -53
- package/dist/lit/LitBlock.d.ts +0 -83
- package/dist/lit/LitSolutionBlock.d.ts +0 -21
- package/dist/lit/LitUploaderBlock.d.ts +0 -53
- package/dist/lit/PubSubCompat.d.ts +0 -18
- package/dist/lit/RegisterableElementMixin.d.ts +0 -7
- package/dist/lit/SharedState.d.ts +0 -119
- package/dist/lit/SymbioteCompatMixin.d.ts +0 -40
- package/dist/lit/TestModeController.d.ts +0 -16
- package/dist/lit/Uid.d.ts +0 -3
- package/dist/lit/activity-constants.d.ts +0 -11
- package/dist/lit/createDebugPrinter.d.ts +0 -3
- package/dist/lit/findBlockInCtx.d.ts +0 -3
- package/dist/lit/getOutputData.d.ts +0 -2
- package/dist/lit/hasBlockInCtx.d.ts +0 -3
- package/dist/lit/l10n.d.ts +0 -5
- package/dist/lit/parseCssPropertyValue.d.ts +0 -1
- package/dist/lit/shared-instances.d.ts +0 -65
- package/dist/loadFileUploaderFrom-Bfz8L3VB.js +0 -28
- package/dist/plugins/cameraPlugin.d.ts +0 -2
- package/dist/plugins/cloudImageEditorPlugin.d.ts +0 -2
- package/dist/plugins/externalSourcesPlugin.d.ts +0 -2
- package/dist/plugins/imageShrinkPlugin.d.ts +0 -2
- package/dist/plugins/instagramPlugin.d.ts +0 -2
- package/dist/plugins/unsplashPlugin.d.ts +0 -16
- package/dist/plugins/urlSourcePlugin.d.ts +0 -2
- package/dist/plugins-CGUls7EV.js +0 -278
- package/dist/solutions/adaptive-image/index.d.ts +0 -2
- package/dist/solutions/cloud-image-editor/CloudImageEditor.d.ts +0 -11
- package/dist/solutions/cloud-image-editor/index.d.ts +0 -5
- package/dist/solutions/file-uploader/inline/FileUploaderInline.d.ts +0 -20
- package/dist/solutions/file-uploader/inline/index.d.ts +0 -1
- package/dist/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +0 -23
- package/dist/solutions/file-uploader/minimal/index.d.ts +0 -1
- package/dist/solutions/file-uploader/regular/FileUploaderRegular.d.ts +0 -17
- package/dist/solutions/file-uploader/regular/index.d.ts +0 -1
- package/dist/types/dom.d.ts +0 -1
- package/dist/types/events.d.ts +0 -4
- package/dist/types/exported.d.ts +0 -492
- package/dist/types/index.d.ts +0 -5
- package/dist/urlSourcePlugin-_WdbEhq2.js +0 -8
- package/dist/utils/UID.d.ts +0 -5
- package/dist/utils/UID.test.d.ts +0 -1
- package/dist/utils/UploadSource.d.ts +0 -37
- package/dist/utils/WindowHeightTracker.d.ts +0 -9
- package/dist/utils/abilities.d.ts +0 -1
- package/dist/utils/applyStyles.d.ts +0 -1
- package/dist/utils/browser-info.d.ts +0 -12
- package/dist/utils/browser-info.test.d.ts +0 -1
- package/dist/utils/cdn-utils.d.ts +0 -53
- package/dist/utils/cdn-utils.test.d.ts +0 -1
- package/dist/utils/comma-separated.d.ts +0 -2
- package/dist/utils/debounce.d.ts +0 -3
- package/dist/utils/delay.d.ts +0 -1
- package/dist/utils/fileTypes.d.ts +0 -11
- package/dist/utils/fileTypes.test.d.ts +0 -1
- package/dist/utils/get-top-level-origin.d.ts +0 -1
- package/dist/utils/get-top-level-origin.test.d.ts +0 -1
- package/dist/utils/getLocaleDirection.d.ts +0 -1
- package/dist/utils/getPluralForm.d.ts +0 -1
- package/dist/utils/getPluralForm.test.d.ts +0 -1
- package/dist/utils/isPromiseLike.d.ts +0 -1
- package/dist/utils/isPromiseLike.test.d.ts +0 -1
- package/dist/utils/isSecureTokenExpired.d.ts +0 -8
- package/dist/utils/isSecureTokenExpired.test.d.ts +0 -1
- package/dist/utils/memoize.d.ts +0 -1
- package/dist/utils/memoize.test.d.ts +0 -1
- package/dist/utils/mixinClass.d.ts +0 -8
- package/dist/utils/parseCdnUrl.d.ts +0 -11
- package/dist/utils/parseCdnUrl.test.d.ts +0 -1
- package/dist/utils/parseShrink.d.ts +0 -7
- package/dist/utils/parseShrink.test.d.ts +0 -1
- package/dist/utils/preloadImage.d.ts +0 -10
- package/dist/utils/prettyBytes.d.ts +0 -11
- package/dist/utils/prettyBytes.test.d.ts +0 -1
- package/dist/utils/resizeImage.d.ts +0 -1
- package/dist/utils/stringToArray.d.ts +0 -1
- package/dist/utils/stringToArray.test.d.ts +0 -1
- package/dist/utils/template-utils.d.ts +0 -16
- package/dist/utils/template-utils.test.d.ts +0 -1
- package/dist/utils/throttle.d.ts +0 -3
- package/dist/utils/toKebabCase.d.ts +0 -2
- package/dist/utils/toKebabCase.test.d.ts +0 -1
- package/dist/utils/transparentPixelSrc.d.ts +0 -1
- package/dist/utils/uniqueArray.d.ts +0 -1
- package/dist/utils/uniqueArray.test.d.ts +0 -1
- package/dist/utils/userAgent.d.ts +0 -2
- package/dist/utils/validators/collection/index.d.ts +0 -2
- package/dist/utils/validators/collection/validateCollectionUploadError.d.ts +0 -2
- package/dist/utils/validators/collection/validateMultiple.d.ts +0 -2
- package/dist/utils/validators/file/index.d.ts +0 -4
- package/dist/utils/validators/file/validateFileType.d.ts +0 -2
- package/dist/utils/validators/file/validateIsImage.d.ts +0 -2
- package/dist/utils/validators/file/validateMaxSizeLimit.d.ts +0 -2
- package/dist/utils/validators/file/validateUploadError.d.ts +0 -2
- package/dist/utils/warnOnce.d.ts +0 -1
- package/dist/utils/wildcardRegexp.d.ts +0 -1
- package/dist/utils/wildcardRegexp.test.d.ts +0 -1
- package/dist/utils/withResolvers.d.ts +0 -5
- package/dist/utils/withResolvers.test.d.ts +0 -1
- package/web/ActivityHeader-BFdTdVfD.js +0 -9
- package/web/ActivityHeader-DQy6rII1.js +0 -9
- package/web/ActivityHeader-DvzMl0uj.js +0 -9
- package/web/ActivityHeader-i4x6_Fne.js +0 -9
- package/web/CameraSource-BAWIA4Wm.js +0 -508
- package/web/CameraSource-BqZCQcij.js +0 -11
- package/web/CameraSource-Brxr4tz4.js +0 -508
- package/web/CameraSource-BvBJ5Uzy.js +0 -508
- package/web/CameraSource-CkHzIE-h.js +0 -11
- package/web/CameraSource-D964yPLu.js +0 -508
- package/web/CameraSource-DE48Az-f.js +0 -11
- package/web/CameraSource-DyPebtRF.js +0 -478
- package/web/CameraSource-pj7Xo81m.js +0 -11
- package/web/CloudImageEditor-CTgUWB07.js +0 -2192
- package/web/CloudImageEditor-CxqV9Lwm.js +0 -2192
- package/web/CloudImageEditor-DoLWHpqV.js +0 -2192
- package/web/CloudImageEditor-Drywn265.js +0 -2192
- package/web/CloudImageEditor-MXcaDtMx.js +0 -2187
- package/web/CloudImageEditorActivity-BPzmfaJV.js +0 -85
- package/web/CloudImageEditorActivity-Br8pU5gd.js +0 -11
- package/web/CloudImageEditorActivity-Cw8b2CEz.js +0 -11
- package/web/CloudImageEditorActivity-Df1ySGq0.js +0 -86
- package/web/CloudImageEditorActivity-DinG5r0y.js +0 -11
- package/web/CloudImageEditorActivity-DmnLLINR.js +0 -85
- package/web/CloudImageEditorActivity-U90BGCek.js +0 -85
- package/web/CloudImageEditorActivity-dNLQZRZI.js +0 -11
- package/web/CloudImageEditorActivity-ur-hQ-6p.js +0 -85
- package/web/Config-8hlBNhvs.js +0 -455
- package/web/Config-BDZhPIyz.js +0 -455
- package/web/Config-CJVNrrjj.js +0 -455
- package/web/Config-DvkVtlQ7.js +0 -455
- package/web/ExternalSource-B9ycBFiD.js +0 -10
- package/web/ExternalSource-BE7HX47E.js +0 -250
- package/web/ExternalSource-BL5GSlol.js +0 -250
- package/web/ExternalSource-BXQY6Dlc.js +0 -10
- package/web/ExternalSource-BXxH3JCD.js +0 -250
- package/web/ExternalSource-BYSS-PPV.js +0 -245
- package/web/ExternalSource-C57a61QN.js +0 -10
- package/web/ExternalSource-CKfMtOgU.js +0 -250
- package/web/ExternalSource-DP6q8ylB.js +0 -10
- package/web/LitUploaderBlock-AX6jOdAS.js +0 -996
- package/web/LitUploaderBlock-BjAaoLl2.js +0 -996
- package/web/LitUploaderBlock-D8E5HuwH.js +0 -996
- package/web/LitUploaderBlock-Dl3ce0Tc.js +0 -996
- package/web/LitUploaderBlock-Oi33U0uf.js +0 -996
- package/web/UrlSource-B9SX3K0L.js +0 -10
- package/web/UrlSource-C3zB1rCb.js +0 -70
- package/web/UrlSource-C7bEU6Xv.js +0 -10
- package/web/UrlSource-CE389CBz.js +0 -70
- package/web/UrlSource-CnvAJ58Y.js +0 -10
- package/web/UrlSource-CqF0h6B-.js +0 -10
- package/web/UrlSource-D-971Nut.js +0 -70
- package/web/UrlSource-DhI3YCt5.js +0 -70
- package/web/UrlSource-hWV7jtB2.js +0 -70
- package/web/abstract/CTX.d.ts +0 -40
- package/web/abstract/TypedCollection.d.ts +0 -47
- package/web/abstract/TypedCollection.test.d.ts +0 -1
- package/web/abstract/TypedData.d.ts +0 -12
- package/web/abstract/TypedData.test.d.ts +0 -1
- package/web/abstract/UploaderPublicApi.d.ts +0 -41
- package/web/abstract/buildOutputCollectionState.d.ts +0 -3
- package/web/abstract/customConfigOptions.d.ts +0 -65
- package/web/abstract/defineComponents.d.ts +0 -1
- package/web/abstract/features/ClipboardLayer.d.ts +0 -12
- package/web/abstract/loadFileUploaderFrom.d.ts +0 -13
- package/web/abstract/localeRegistry.d.ts +0 -5
- package/web/abstract/managers/LocaleManager.d.ts +0 -10
- package/web/abstract/managers/ModalManager.d.ts +0 -53
- package/web/abstract/managers/SecureUploadsManager.d.ts +0 -7
- package/web/abstract/managers/TelemetryManager.d.ts +0 -41
- package/web/abstract/managers/ValidationManager.d.ts +0 -34
- package/web/abstract/managers/__tests__/ModalManager.test.d.ts +0 -13
- package/web/abstract/managers/__tests__/SecureUploadsManager.test.d.ts +0 -1
- package/web/abstract/managers/a11y.d.ts +0 -9
- package/web/abstract/managers/plugin/PluginManager.d.ts +0 -25
- package/web/abstract/managers/plugin/PluginTypes.d.ts +0 -146
- package/web/abstract/managers/plugin/index.d.ts +0 -2
- package/web/abstract/sharedConfigKey.d.ts +0 -2
- package/web/abstract/uploadEntrySchema.d.ts +0 -34
- package/web/blocks/ActivityHeader/ActivityHeader.d.ts +0 -8
- package/web/blocks/CameraSource/CameraSource.d.ts +0 -121
- package/web/blocks/CameraSource/__tests__/calcCameraModes.test.d.ts +0 -1
- package/web/blocks/CameraSource/calcCameraModes.d.ts +0 -5
- package/web/blocks/CameraSource/constants.d.ts +0 -15
- package/web/blocks/CloudImageEditor/index.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +0 -60
- package/web/blocks/CloudImageEditor/src/CropFrame.d.ts +0 -56
- package/web/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +0 -24
- package/web/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +0 -14
- package/web/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +0 -13
- package/web/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +0 -35
- package/web/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +0 -56
- package/web/blocks/CloudImageEditor/src/EditorImageFader.d.ts +0 -63
- package/web/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +0 -15
- package/web/blocks/CloudImageEditor/src/EditorScroller.d.ts +0 -15
- package/web/blocks/CloudImageEditor/src/EditorSlider.d.ts +0 -33
- package/web/blocks/CloudImageEditor/src/EditorToolbar.d.ts +0 -68
- package/web/blocks/CloudImageEditor/src/crop-utils.d.ts +0 -36
- package/web/blocks/CloudImageEditor/src/crop-utils.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/cropper-constants.d.ts +0 -10
- package/web/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +0 -31
- package/web/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +0 -19
- package/web/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +0 -27
- package/web/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +0 -38
- package/web/blocks/CloudImageEditor/src/index.d.ts +0 -15
- package/web/blocks/CloudImageEditor/src/lib/classNames.d.ts +0 -5
- package/web/blocks/CloudImageEditor/src/lib/classNames.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/linspace.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/linspace.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +0 -4
- package/web/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +0 -2
- package/web/blocks/CloudImageEditor/src/lib/pick.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/pick.test.d.ts +0 -1
- package/web/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +0 -7
- package/web/blocks/CloudImageEditor/src/state.d.ts +0 -20
- package/web/blocks/CloudImageEditor/src/svg-sprite.d.ts +0 -2
- package/web/blocks/CloudImageEditor/src/toolbar-constants.d.ts +0 -61
- package/web/blocks/CloudImageEditor/src/types.d.ts +0 -60
- package/web/blocks/CloudImageEditor/src/util.d.ts +0 -2
- package/web/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +0 -7
- package/web/blocks/CloudImageEditor/src/utils/parseFilterValue.test.d.ts +0 -1
- package/web/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +0 -25
- package/web/blocks/Config/Config.d.ts +0 -60
- package/web/blocks/Config/assertions.d.ts +0 -5
- package/web/blocks/Config/computed-properties.d.ts +0 -24
- package/web/blocks/Config/computed-properties.test.d.ts +0 -1
- package/web/blocks/Config/initialConfig.d.ts +0 -6
- package/web/blocks/Config/normalizeConfigValue.d.ts +0 -2
- package/web/blocks/Config/validatorsType.d.ts +0 -18
- package/web/blocks/Copyright/Copyright.d.ts +0 -10
- package/web/blocks/DropArea/DropArea.d.ts +0 -47
- package/web/blocks/DropArea/addDropzone.d.ts +0 -17
- package/web/blocks/DropArea/getDropItems.d.ts +0 -12
- package/web/blocks/ExternalSource/ExternalSource.d.ts +0 -45
- package/web/blocks/ExternalSource/MessageBridge.d.ts +0 -11
- package/web/blocks/ExternalSource/buildThemeDefinition.d.ts +0 -4
- package/web/blocks/ExternalSource/query-string.d.ts +0 -1
- package/web/blocks/ExternalSource/types.d.ts +0 -105
- package/web/blocks/FileItem/FileItem.d.ts +0 -50
- package/web/blocks/FileItem/FileItemConfig.d.ts +0 -10
- package/web/blocks/FormInput/FormInput.d.ts +0 -18
- package/web/blocks/Icon/Icon.d.ts +0 -19
- package/web/blocks/Img/Img.d.ts +0 -14
- package/web/blocks/Img/ImgBase.d.ts +0 -29
- package/web/blocks/Img/ImgConfig.d.ts +0 -28
- package/web/blocks/Img/configurations.d.ts +0 -11
- package/web/blocks/Img/props-map.d.ts +0 -28
- package/web/blocks/Img/utils/parseObjectToString.d.ts +0 -2
- package/web/blocks/Modal/Modal.d.ts +0 -34
- package/web/blocks/PluginActivityRenderer/PluginActivityRenderer.d.ts +0 -32
- package/web/blocks/PluginActivityRenderer/index.d.ts +0 -1
- package/web/blocks/ProgressBar/ProgressBar.d.ts +0 -21
- package/web/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +0 -17
- package/web/blocks/Select/Select.d.ts +0 -18
- package/web/blocks/SimpleBtn/SimpleBtn.d.ts +0 -15
- package/web/blocks/SourceBtn/SourceBtn.d.ts +0 -23
- package/web/blocks/SourceList/SourceList.d.ts +0 -24
- package/web/blocks/Spinner/Spinner.d.ts +0 -9
- package/web/blocks/StartFrom/StartFrom.d.ts +0 -12
- package/web/blocks/Thumb/Thumb.d.ts +0 -35
- package/web/blocks/UploadCtxProvider/EventEmitter.d.ts +0 -70
- package/web/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +0 -44
- package/web/blocks/UploadList/UploadList.d.ts +0 -39
- package/web/blocks/UrlSource/UrlSource.d.ts +0 -14
- package/web/blocks/svg-backgrounds/svg-backgrounds.d.ts +0 -3
- package/web/blocks/themes/uc-basic/svg-sprite.d.ts +0 -2
- package/web/cameraPlugin-DeedXMWV.js +0 -8
- package/web/cameraPlugin-Duy1QwjB.js +0 -8
- package/web/cameraPlugin-QS9SUOtO.js +0 -8
- package/web/cameraPlugin-bq8ggY04.js +0 -8
- package/web/cameraPlugin-cel9YgP_.js +0 -8
- package/web/cloud-image-editor-8DrVRZ7E.js +0 -12
- package/web/cloud-image-editor-BX50EK1U.js +0 -12
- package/web/cloud-image-editor-DSW3oWq-.js +0 -12
- package/web/cloud-image-editor-DuI2Lx4M.js +0 -12
- package/web/cloudImageEditorPlugin-5my6aD36.js +0 -8
- package/web/cloudImageEditorPlugin-Bk19DmJv.js +0 -8
- package/web/cloudImageEditorPlugin-CcdnmtBW.js +0 -8
- package/web/cloudImageEditorPlugin-DQJmDl03.js +0 -8
- package/web/cloudImageEditorPlugin-kojghfqw.js +0 -8
- package/web/constants-BCfCF0cJ.js +0 -4025
- package/web/core.d.ts +0 -42
- package/web/env.d.ts +0 -2
- package/web/externalSourcesPlugin-BTeRm5C0.js +0 -8
- package/web/externalSourcesPlugin-BXgVeojg.js +0 -8
- package/web/externalSourcesPlugin-BgLpuIK9.js +0 -8
- package/web/externalSourcesPlugin-DMc9zs4T.js +0 -8
- package/web/externalSourcesPlugin-Dm9vnTBv.js +0 -8
- package/web/imageShrinkPlugin-BdHgEGZH.js +0 -8
- package/web/imageShrinkPlugin-BjkMGfvT.js +0 -8
- package/web/imageShrinkPlugin-CCkGHL2w.js +0 -8
- package/web/imageShrinkPlugin-D4WjaRGo.js +0 -8
- package/web/imageShrinkPlugin-DqYGutVx.js +0 -8
- package/web/index.d.ts +0 -42
- package/web/instagramPlugin-BTMz0K2a.js +0 -8
- package/web/instagramPlugin-BbIKgTH7.js +0 -8
- package/web/instagramPlugin-CQQhsEJa.js +0 -8
- package/web/instagramPlugin-Cm7lWKae.js +0 -8
- package/web/instagramPlugin-DcclxM_d.js +0 -8
- package/web/lit/BaseComponent.d.ts +0 -12
- package/web/lit/Constructor.d.ts +0 -1
- package/web/lit/CssDataMixin.d.ts +0 -7
- package/web/lit/LightDomMixin.d.ts +0 -8
- package/web/lit/LitActivityBlock.d.ts +0 -53
- package/web/lit/LitBlock.d.ts +0 -83
- package/web/lit/LitSolutionBlock.d.ts +0 -21
- package/web/lit/LitUploaderBlock.d.ts +0 -53
- package/web/lit/PubSubCompat.d.ts +0 -18
- package/web/lit/RegisterableElementMixin.d.ts +0 -7
- package/web/lit/SharedState.d.ts +0 -119
- package/web/lit/SymbioteCompatMixin.d.ts +0 -40
- package/web/lit/TestModeController.d.ts +0 -16
- package/web/lit/Uid.d.ts +0 -3
- package/web/lit/activity-constants.d.ts +0 -11
- package/web/lit/createDebugPrinter.d.ts +0 -3
- package/web/lit/findBlockInCtx.d.ts +0 -3
- package/web/lit/getOutputData.d.ts +0 -2
- package/web/lit/hasBlockInCtx.d.ts +0 -3
- package/web/lit/l10n.d.ts +0 -5
- package/web/lit/parseCssPropertyValue.d.ts +0 -1
- package/web/lit/shared-instances.d.ts +0 -65
- package/web/locales/file-uploader/ar.d.ts +0 -137
- package/web/locales/file-uploader/az.d.ts +0 -129
- package/web/locales/file-uploader/ca.d.ts +0 -131
- package/web/locales/file-uploader/cs.d.ts +0 -133
- package/web/locales/file-uploader/da.d.ts +0 -129
- package/web/locales/file-uploader/de.d.ts +0 -129
- package/web/locales/file-uploader/el.d.ts +0 -129
- package/web/locales/file-uploader/en.d.ts +0 -129
- package/web/locales/file-uploader/es.d.ts +0 -131
- package/web/locales/file-uploader/et.d.ts +0 -129
- package/web/locales/file-uploader/fi.d.ts +0 -129
- package/web/locales/file-uploader/fr.d.ts +0 -131
- package/web/locales/file-uploader/he.d.ts +0 -131
- package/web/locales/file-uploader/hy.d.ts +0 -129
- package/web/locales/file-uploader/is.d.ts +0 -129
- package/web/locales/file-uploader/it.d.ts +0 -131
- package/web/locales/file-uploader/ja.d.ts +0 -129
- package/web/locales/file-uploader/ka.d.ts +0 -129
- package/web/locales/file-uploader/kk.d.ts +0 -129
- package/web/locales/file-uploader/ko.d.ts +0 -129
- package/web/locales/file-uploader/lv.d.ts +0 -131
- package/web/locales/file-uploader/nb.d.ts +0 -129
- package/web/locales/file-uploader/nl.d.ts +0 -129
- package/web/locales/file-uploader/pl.d.ts +0 -133
- package/web/locales/file-uploader/pt.d.ts +0 -131
- package/web/locales/file-uploader/ro.d.ts +0 -131
- package/web/locales/file-uploader/ru.d.ts +0 -133
- package/web/locales/file-uploader/sk.d.ts +0 -133
- package/web/locales/file-uploader/sr.d.ts +0 -131
- package/web/locales/file-uploader/sv.d.ts +0 -129
- package/web/locales/file-uploader/tr.d.ts +0 -129
- package/web/locales/file-uploader/uk.d.ts +0 -133
- package/web/locales/file-uploader/vi.d.ts +0 -129
- package/web/locales/file-uploader/zh-TW.d.ts +0 -129
- package/web/locales/file-uploader/zh.d.ts +0 -129
- package/web/plugins/cameraPlugin.d.ts +0 -2
- package/web/plugins/cloudImageEditorPlugin.d.ts +0 -2
- package/web/plugins/externalSourcesPlugin.d.ts +0 -2
- package/web/plugins/imageShrinkPlugin.d.ts +0 -2
- package/web/plugins/instagramPlugin.d.ts +0 -2
- package/web/plugins/unsplashPlugin.d.ts +0 -16
- package/web/plugins/urlSourcePlugin.d.ts +0 -2
- package/web/plugins-Bt7FXHKx.js +0 -562
- package/web/plugins-CaaolyMk.js +0 -562
- package/web/plugins-Cjgw5oWg.js +0 -562
- package/web/plugins-CzNtrVQB.js +0 -562
- package/web/plugins-DS0hIs2V.js +0 -563
- package/web/ref-BOnG19ns.js +0 -4040
- package/web/ref-BejJFG7m.js +0 -4040
- package/web/ref-DcRg7zo9.js +0 -4040
- package/web/ref-ZWPcLQB9.js +0 -4040
- package/web/solutions/adaptive-image/index.d.ts +0 -2
- package/web/solutions/cloud-image-editor/CloudImageEditor.d.ts +0 -11
- package/web/solutions/cloud-image-editor/index.d.ts +0 -5
- package/web/solutions/file-uploader/inline/FileUploaderInline.d.ts +0 -20
- package/web/solutions/file-uploader/inline/index.d.ts +0 -1
- package/web/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +0 -23
- package/web/solutions/file-uploader/minimal/index.d.ts +0 -1
- package/web/solutions/file-uploader/regular/FileUploaderRegular.d.ts +0 -17
- package/web/solutions/file-uploader/regular/index.d.ts +0 -1
- package/web/style-map-BmZdux7T.js +0 -37
- package/web/style-map-CZ6fSV6e.js +0 -37
- package/web/style-map-Dk7mLCrB.js +0 -37
- package/web/style-map-HkHnu9oA.js +0 -37
- package/web/style-map-tw1yUEaj.js +0 -37
- package/web/types/dom.d.ts +0 -1
- package/web/types/events.d.ts +0 -4
- package/web/types/exported.d.ts +0 -492
- package/web/types/index.d.ts +0 -5
- package/web/urlSourcePlugin-9lhcr02f.js +0 -8
- package/web/urlSourcePlugin-C-sLGhGb.js +0 -8
- package/web/urlSourcePlugin-DNXDpnRD.js +0 -8
- package/web/urlSourcePlugin-JnD0cnxb.js +0 -8
- package/web/urlSourcePlugin-hcMU2K6T.js +0 -8
- package/web/utils/UID.d.ts +0 -5
- package/web/utils/UID.test.d.ts +0 -1
- package/web/utils/UploadSource.d.ts +0 -37
- package/web/utils/WindowHeightTracker.d.ts +0 -9
- package/web/utils/abilities.d.ts +0 -1
- package/web/utils/applyStyles.d.ts +0 -1
- package/web/utils/browser-info.d.ts +0 -12
- package/web/utils/browser-info.test.d.ts +0 -1
- package/web/utils/cdn-utils.d.ts +0 -53
- package/web/utils/cdn-utils.test.d.ts +0 -1
- package/web/utils/comma-separated.d.ts +0 -2
- package/web/utils/debounce.d.ts +0 -3
- package/web/utils/delay.d.ts +0 -1
- package/web/utils/fileTypes.d.ts +0 -11
- package/web/utils/fileTypes.test.d.ts +0 -1
- package/web/utils/get-top-level-origin.d.ts +0 -1
- package/web/utils/get-top-level-origin.test.d.ts +0 -1
- package/web/utils/getLocaleDirection.d.ts +0 -1
- package/web/utils/getPluralForm.d.ts +0 -1
- package/web/utils/getPluralForm.test.d.ts +0 -1
- package/web/utils/isPromiseLike.d.ts +0 -1
- package/web/utils/isPromiseLike.test.d.ts +0 -1
- package/web/utils/isSecureTokenExpired.d.ts +0 -8
- package/web/utils/isSecureTokenExpired.test.d.ts +0 -1
- package/web/utils/memoize.d.ts +0 -1
- package/web/utils/memoize.test.d.ts +0 -1
- package/web/utils/mixinClass.d.ts +0 -8
- package/web/utils/parseCdnUrl.d.ts +0 -11
- package/web/utils/parseCdnUrl.test.d.ts +0 -1
- package/web/utils/parseShrink.d.ts +0 -7
- package/web/utils/parseShrink.test.d.ts +0 -1
- package/web/utils/preloadImage.d.ts +0 -10
- package/web/utils/prettyBytes.d.ts +0 -11
- package/web/utils/prettyBytes.test.d.ts +0 -1
- package/web/utils/resizeImage.d.ts +0 -1
- package/web/utils/stringToArray.d.ts +0 -1
- package/web/utils/stringToArray.test.d.ts +0 -1
- package/web/utils/template-utils.d.ts +0 -16
- package/web/utils/template-utils.test.d.ts +0 -1
- package/web/utils/throttle.d.ts +0 -3
- package/web/utils/toKebabCase.d.ts +0 -2
- package/web/utils/toKebabCase.test.d.ts +0 -1
- package/web/utils/transparentPixelSrc.d.ts +0 -1
- package/web/utils/uniqueArray.d.ts +0 -1
- package/web/utils/uniqueArray.test.d.ts +0 -1
- package/web/utils/userAgent.d.ts +0 -2
- package/web/utils/validators/collection/index.d.ts +0 -2
- package/web/utils/validators/collection/validateCollectionUploadError.d.ts +0 -2
- package/web/utils/validators/collection/validateMultiple.d.ts +0 -2
- package/web/utils/validators/file/index.d.ts +0 -4
- package/web/utils/validators/file/validateFileType.d.ts +0 -2
- package/web/utils/validators/file/validateIsImage.d.ts +0 -2
- package/web/utils/validators/file/validateMaxSizeLimit.d.ts +0 -2
- package/web/utils/validators/file/validateUploadError.d.ts +0 -2
- package/web/utils/warnOnce.d.ts +0 -1
- package/web/utils/wildcardRegexp.d.ts +0 -1
- package/web/utils/wildcardRegexp.test.d.ts +0 -1
- package/web/utils/withResolvers.d.ts +0 -5
- package/web/utils/withResolvers.test.d.ts +0 -1
|
@@ -1,457 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Package: @uploadcare/file-uploader@1.28.0-alpha.
|
|
4
|
-
* License: https://github.com/uploadcare/blob/main/LICENSE
|
|
5
|
-
* Built: 2026-03-
|
|
6
|
-
*/
|
|
7
|
-
import { F as debounce, O as Icon, U as DEFAULT_CDN_CNAME, W as initialConfig, j as LitBlock, n as CameraSourceTypes, ot as sharedConfigKey, r as warnOnce } from "./constants-BCfCF0cJ.js";
|
|
8
|
-
|
|
9
|
-
import { d as defineComponents, f as deserializeCsv, l as ExternalUploadSource, p as serializeCsv } from "./plugins-DS0hIs2V.js";
|
|
10
|
-
import "./style-map-tw1yUEaj.js";
|
|
11
|
-
const toKebabCase = (b) => b.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map((b) => b.toLowerCase()).join("-");
|
|
12
|
-
var ASSERTIONS = [
|
|
13
|
-
{
|
|
14
|
-
test: (b) => !!b.accept && !!b.imgOnly,
|
|
15
|
-
message: "There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list."
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
test: (b) => b.enableVideoRecording !== null,
|
|
19
|
-
message: "The `enableVideoRecording` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
test: (b) => b.defaultCameraMode !== null,
|
|
23
|
-
message: "The `defaultCameraMode` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."
|
|
24
|
-
}
|
|
25
|
-
];
|
|
26
|
-
const runAssertions = debounce((b) => {
|
|
27
|
-
for (let { test: K, message: q } of ASSERTIONS) K(b) && warnOnce(q);
|
|
28
|
-
}, 0);
|
|
29
|
-
var o = (b, K) => {
|
|
30
|
-
let q = new URL(K);
|
|
31
|
-
return q.hostname = `${b}.${q.hostname}`, q.toString().replace(/\/$/, "");
|
|
32
|
-
}, s = "0123456789abcdefghijklmnopqrstuvwxyz", a = (b) => {
|
|
33
|
-
if (b <= 0n) return "0";
|
|
34
|
-
let K = "";
|
|
35
|
-
for (; b > 0n;) {
|
|
36
|
-
let q = b % 36n;
|
|
37
|
-
K = s[Number(q)] + K, b /= 36n;
|
|
38
|
-
}
|
|
39
|
-
return K;
|
|
40
|
-
}, c = (b, K) => {
|
|
41
|
-
try {
|
|
42
|
-
let q = new URL(b), J = new URL(K);
|
|
43
|
-
return q.hostname.endsWith(J.hostname);
|
|
44
|
-
} catch {
|
|
45
|
-
return !1;
|
|
46
|
-
}
|
|
47
|
-
}, c$1 = async (b) => {
|
|
48
|
-
let K = new TextEncoder().encode(b), q = await window.crypto.subtle.digest("SHA-256", K), J = Array.from(new Uint8Array(q)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
49
|
-
return BigInt(`0x${J}`);
|
|
50
|
-
}, i = 10, d = async (b) => a(await c$1(b)).slice(0, i), f = async (b, K) => o(await d(b), K);
|
|
51
|
-
const isPromiseLike = (b) => b instanceof Promise || !!(b && typeof b == "object" && "then" in b && typeof b.then == "function");
|
|
52
|
-
var defineComputedProperty = (b) => b, withLazyPlugins = async ({ plugins: b, entries: K, signal: q }) => {
|
|
53
|
-
let J = b(), Y = new Set(K.map((b) => b.pluginId)), X = J.filter((b) => !Y.has(b?.id)), Z = await Promise.all(K.map(async (b) => {
|
|
54
|
-
if (!b.isEnabled()) return null;
|
|
55
|
-
let K = J.find((K) => K?.id === b.pluginId);
|
|
56
|
-
if (K) return K;
|
|
57
|
-
try {
|
|
58
|
-
let K = await b.load();
|
|
59
|
-
return q.aborted || !b.isEnabled() ? null : K ?? null;
|
|
60
|
-
} catch (K) {
|
|
61
|
-
return q.aborted || console.warn(`[${b.pluginId}] Failed to load plugin`, K), null;
|
|
62
|
-
}
|
|
63
|
-
}));
|
|
64
|
-
if (q.aborted) return J;
|
|
65
|
-
let Q = Z.filter((b) => b !== null), $ = [...X, ...Q];
|
|
66
|
-
return $.length === J.length && $.every((b, K) => b === J[K]) ? J : $;
|
|
67
|
-
}, COMPUTED_PROPERTIES = [
|
|
68
|
-
defineComputedProperty({
|
|
69
|
-
key: "cameraModes",
|
|
70
|
-
deps: ["enableVideoRecording"],
|
|
71
|
-
fn: ({ cameraModes: b, enableVideoRecording: K }) => {
|
|
72
|
-
let q = K();
|
|
73
|
-
if (q === null) return b();
|
|
74
|
-
let J = deserializeCsv(b());
|
|
75
|
-
return q && !J.includes("video") ? J = J.concat("video") : q || (J = J.filter((b) => b !== "video")), serializeCsv(J);
|
|
76
|
-
}
|
|
77
|
-
}),
|
|
78
|
-
defineComputedProperty({
|
|
79
|
-
key: "cameraModes",
|
|
80
|
-
deps: ["defaultCameraMode"],
|
|
81
|
-
fn: ({ cameraModes: b, defaultCameraMode: K }) => {
|
|
82
|
-
let q = K();
|
|
83
|
-
if (q === null) return b();
|
|
84
|
-
let J = deserializeCsv(b());
|
|
85
|
-
return J = J.sort((b, K) => b === q ? -1 : K === q ? 1 : 0), serializeCsv(J);
|
|
86
|
-
}
|
|
87
|
-
}),
|
|
88
|
-
defineComputedProperty({
|
|
89
|
-
key: "cdnCname",
|
|
90
|
-
deps: ["pubkey", "cdnCnamePrefixed"],
|
|
91
|
-
fn: ({ pubkey: b, cdnCname: K, cdnCnamePrefixed: q }) => {
|
|
92
|
-
let J = b(), Y = K(), X = q();
|
|
93
|
-
return J && (Y === "https://ucarecdn.com" || c(Y, X)) ? f(J, X) : Y;
|
|
94
|
-
}
|
|
95
|
-
}),
|
|
96
|
-
defineComputedProperty({
|
|
97
|
-
key: "plugins",
|
|
98
|
-
deps: [
|
|
99
|
-
"useCloudImageEditor",
|
|
100
|
-
"imageShrink",
|
|
101
|
-
"sourceList"
|
|
102
|
-
],
|
|
103
|
-
fn: ({ plugins: b, useCloudImageEditor: K, imageShrink: q, sourceList: J }, { signal: Y }) => withLazyPlugins({
|
|
104
|
-
plugins: b,
|
|
105
|
-
entries: [
|
|
106
|
-
{
|
|
107
|
-
pluginId: "cloud-image-editor",
|
|
108
|
-
isEnabled: () => !!K(),
|
|
109
|
-
load: async () => {
|
|
110
|
-
let { cloudImageEditorPlugin: b } = await import("./cloudImageEditorPlugin-kojghfqw.js");
|
|
111
|
-
return b;
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
pluginId: "image-shrink",
|
|
116
|
-
isEnabled: () => !!q(),
|
|
117
|
-
load: async () => {
|
|
118
|
-
let { imageShrinkPlugin: b } = await import("./imageShrinkPlugin-DqYGutVx.js");
|
|
119
|
-
return b;
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
pluginId: "camera",
|
|
124
|
-
isEnabled: () => deserializeCsv(J()).includes("camera"),
|
|
125
|
-
load: async () => {
|
|
126
|
-
let { cameraPlugin: b } = await import("./cameraPlugin-DeedXMWV.js");
|
|
127
|
-
return b;
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
pluginId: "instagram",
|
|
132
|
-
isEnabled: () => deserializeCsv(J()).includes("instagram"),
|
|
133
|
-
load: async () => {
|
|
134
|
-
let { instagramPlugin: b } = await import("./instagramPlugin-CQQhsEJa.js");
|
|
135
|
-
return b;
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
pluginId: "external-sources",
|
|
140
|
-
isEnabled: () => Object.values(ExternalUploadSource).some((b) => deserializeCsv(J()).includes(b)),
|
|
141
|
-
load: async () => {
|
|
142
|
-
let { externalSourcesPlugin: b } = await import("./externalSourcesPlugin-DMc9zs4T.js");
|
|
143
|
-
return b;
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
pluginId: "url-source",
|
|
148
|
-
isEnabled: () => deserializeCsv(J()).includes("url"),
|
|
149
|
-
load: async () => {
|
|
150
|
-
let { urlSourcePlugin: b } = await import("./urlSourcePlugin-C-sLGhGb.js");
|
|
151
|
-
return b;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
],
|
|
155
|
-
signal: Y
|
|
156
|
-
})
|
|
157
|
-
})
|
|
158
|
-
];
|
|
159
|
-
const computeProperty = ({ key: b, setValue: K, getValue: q, computationControllers: J }) => {
|
|
160
|
-
for (let Y of COMPUTED_PROPERTIES) if (Y.deps.includes(b)) {
|
|
161
|
-
let b = { [Y.key]: () => q(Y.key) };
|
|
162
|
-
for (let K of Y.deps) b[K] = () => q(K);
|
|
163
|
-
let X = new AbortController();
|
|
164
|
-
J.get(Y.fn)?.abort(), J.set(Y.fn, X);
|
|
165
|
-
let Z;
|
|
166
|
-
try {
|
|
167
|
-
Z = Y.fn(b, { signal: X.signal });
|
|
168
|
-
} catch (b) {
|
|
169
|
-
J.get(Y.fn) === X && J.delete(Y.fn), console.error(`Failed to compute value for "${Y.key}"`, b);
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
isPromiseLike(Z) ? Z.then((b) => {
|
|
173
|
-
X.signal.aborted || K(Y.key, b);
|
|
174
|
-
}).catch((b) => {
|
|
175
|
-
X.signal.aborted || console.error(`Failed to compute value for "${Y.key}"`, b);
|
|
176
|
-
}).finally(() => {
|
|
177
|
-
J.get(Y.fn) === X && J.delete(Y.fn);
|
|
178
|
-
}) : K(Y.key, Z);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
var asString = (b) => String(b), asNumber = (b) => {
|
|
182
|
-
let K = Number(b);
|
|
183
|
-
if (Number.isNaN(K)) throw Error(`Invalid number: "${b}"`);
|
|
184
|
-
return K;
|
|
185
|
-
}, asBoolean = (b) => {
|
|
186
|
-
if (b == null) return !1;
|
|
187
|
-
if (typeof b == "boolean") return b;
|
|
188
|
-
if (b === "true" || b === "") return !0;
|
|
189
|
-
if (b === "false") return !1;
|
|
190
|
-
throw Error(`Invalid boolean: "${b}"`);
|
|
191
|
-
}, asStore = (b) => b === "auto" ? b : asBoolean(b), asCameraCapture = (b) => {
|
|
192
|
-
let K = asString(b);
|
|
193
|
-
if (K !== "user" && K !== "environment" && K !== "") throw Error(`Invalid value: "${K}"`);
|
|
194
|
-
return K;
|
|
195
|
-
}, asCameraMode = (b) => {
|
|
196
|
-
let K = asString(b);
|
|
197
|
-
if (!Object.values(CameraSourceTypes).includes(K)) throw Error(`Invalid value: "${K}"`);
|
|
198
|
-
return K;
|
|
199
|
-
}, asCameraModes = (b) => {
|
|
200
|
-
let K = asString(b), q = deserializeCsv(K);
|
|
201
|
-
if (q.some((b) => !Object.values(CameraSourceTypes).includes(b))) throw Error(`Invalid value: "${JSON.stringify(q)}"`);
|
|
202
|
-
return K;
|
|
203
|
-
}, asPasteScope = (b) => {
|
|
204
|
-
let K = asString(b);
|
|
205
|
-
if (K === "local" || K === "global") return K;
|
|
206
|
-
if (asBoolean(b) === !1) return !1;
|
|
207
|
-
throw Error(`Invalid value: "${K}"`);
|
|
208
|
-
}, asMetadata = (b) => {
|
|
209
|
-
if (typeof b == "object" && !Array.isArray(b) || typeof b == "function") return b;
|
|
210
|
-
throw Error("Invalid metadata value. Must be an object or function.");
|
|
211
|
-
}, asObject = (b) => {
|
|
212
|
-
if (typeof b == "object") return b;
|
|
213
|
-
throw Error("Invalid value. Must be an object.");
|
|
214
|
-
}, asFunction = (b) => {
|
|
215
|
-
if (typeof b == "function") return b;
|
|
216
|
-
throw Error("Invalid value. Must be a function.");
|
|
217
|
-
}, asArray = (b) => {
|
|
218
|
-
if (Array.isArray(b)) return b;
|
|
219
|
-
throw Error("Must be an array.");
|
|
220
|
-
}, mapping = {
|
|
221
|
-
pubkey: asString,
|
|
222
|
-
multiple: asBoolean,
|
|
223
|
-
multipleMin: asNumber,
|
|
224
|
-
multipleMax: asNumber,
|
|
225
|
-
confirmUpload: asBoolean,
|
|
226
|
-
imgOnly: asBoolean,
|
|
227
|
-
accept: asString,
|
|
228
|
-
externalSourcesPreferredTypes: asString,
|
|
229
|
-
externalSourcesEmbedCss: asString,
|
|
230
|
-
store: asStore,
|
|
231
|
-
cameraMirror: asBoolean,
|
|
232
|
-
cameraCapture: asCameraCapture,
|
|
233
|
-
sourceList: asString,
|
|
234
|
-
topLevelOrigin: asString,
|
|
235
|
-
maxLocalFileSizeBytes: asNumber,
|
|
236
|
-
thumbSize: asNumber,
|
|
237
|
-
showEmptyList: asBoolean,
|
|
238
|
-
useLocalImageEditor: asBoolean,
|
|
239
|
-
useCloudImageEditor: asBoolean,
|
|
240
|
-
cloudImageEditorTabs: asString,
|
|
241
|
-
removeCopyright: asBoolean,
|
|
242
|
-
cropPreset: asString,
|
|
243
|
-
imageShrink: asString,
|
|
244
|
-
modalScrollLock: asBoolean,
|
|
245
|
-
modalBackdropStrokes: asBoolean,
|
|
246
|
-
sourceListWrap: asBoolean,
|
|
247
|
-
remoteTabSessionKey: asString,
|
|
248
|
-
cdnCname: asString,
|
|
249
|
-
cdnCnamePrefixed: asString,
|
|
250
|
-
baseUrl: asString,
|
|
251
|
-
socialBaseUrl: asString,
|
|
252
|
-
secureSignature: asString,
|
|
253
|
-
secureExpire: asString,
|
|
254
|
-
secureDeliveryProxy: asString,
|
|
255
|
-
retryThrottledRequestMaxTimes: asNumber,
|
|
256
|
-
retryNetworkErrorMaxTimes: asNumber,
|
|
257
|
-
multipartMinFileSize: asNumber,
|
|
258
|
-
multipartChunkSize: asNumber,
|
|
259
|
-
maxConcurrentRequests: asNumber,
|
|
260
|
-
multipartMaxConcurrentRequests: asNumber,
|
|
261
|
-
multipartMaxAttempts: asNumber,
|
|
262
|
-
checkForUrlDuplicates: asBoolean,
|
|
263
|
-
saveUrlForRecurrentUploads: asBoolean,
|
|
264
|
-
groupOutput: asBoolean,
|
|
265
|
-
userAgentIntegration: asString,
|
|
266
|
-
debug: asBoolean,
|
|
267
|
-
localeName: asString,
|
|
268
|
-
metadata: asMetadata,
|
|
269
|
-
secureUploadsExpireThreshold: asNumber,
|
|
270
|
-
localeDefinitionOverride: (b) => asObject(b),
|
|
271
|
-
secureUploadsSignatureResolver: (b) => asFunction(b),
|
|
272
|
-
secureDeliveryProxyUrlResolver: (b) => asFunction(b),
|
|
273
|
-
iconHrefResolver: (b) => asFunction(b),
|
|
274
|
-
plugins: (b) => asArray(b),
|
|
275
|
-
fileValidators: asArray,
|
|
276
|
-
collectionValidators: asArray,
|
|
277
|
-
validationTimeout: asNumber,
|
|
278
|
-
validationConcurrency: asNumber,
|
|
279
|
-
cameraModes: asCameraModes,
|
|
280
|
-
defaultCameraMode: asCameraMode,
|
|
281
|
-
enableAudioRecording: asBoolean,
|
|
282
|
-
enableVideoRecording: asBoolean,
|
|
283
|
-
mediaRecorderOptions: asObject,
|
|
284
|
-
maxVideoRecordingDuration: asNumber,
|
|
285
|
-
filesViewMode: (b) => {
|
|
286
|
-
let K = asString(b);
|
|
287
|
-
if (["grid", "list"].includes(K)) return K;
|
|
288
|
-
throw Error(`Invalid value: "${K}"`);
|
|
289
|
-
},
|
|
290
|
-
gridShowFileNames: asBoolean,
|
|
291
|
-
cloudImageEditorAutoOpen: asBoolean,
|
|
292
|
-
cloudImageEditorMaskHref: asString,
|
|
293
|
-
testMode: asBoolean,
|
|
294
|
-
qualityInsights: asBoolean,
|
|
295
|
-
pasteScope: asPasteScope
|
|
296
|
-
};
|
|
297
|
-
const normalizeConfigValue = (b, K) => {
|
|
298
|
-
if (K != null) try {
|
|
299
|
-
return mapping[b](K);
|
|
300
|
-
} catch (K) {
|
|
301
|
-
return console.error(`Invalid value for config key "${b}".`, K), initialConfig[b];
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
var allConfigKeys = [...new Set(["debug", ...Object.keys(initialConfig)])];
|
|
305
|
-
const complexConfigKeys = [
|
|
306
|
-
"metadata",
|
|
307
|
-
"plugins",
|
|
308
|
-
"localeDefinitionOverride",
|
|
309
|
-
"secureUploadsSignatureResolver",
|
|
310
|
-
"secureDeliveryProxyUrlResolver",
|
|
311
|
-
"iconHrefResolver",
|
|
312
|
-
"fileValidators",
|
|
313
|
-
"collectionValidators",
|
|
314
|
-
"mediaRecorderOptions"
|
|
315
|
-
];
|
|
316
|
-
var isComplexKey = (b) => complexConfigKeys.includes(b), plainConfigKeys = allConfigKeys.filter((b) => !isComplexKey(b)), builtinAttrKeyMapping = {
|
|
317
|
-
...Object.fromEntries(plainConfigKeys.map((b) => [toKebabCase(b), b])),
|
|
318
|
-
...Object.fromEntries(plainConfigKeys.map((b) => [b.toLowerCase(), b]))
|
|
319
|
-
}, getLocalPropName = (b) => `__${b}`, Config = class extends LitBlock {
|
|
320
|
-
constructor(...b) {
|
|
321
|
-
super(...b), this.init$ = {
|
|
322
|
-
...this.init$,
|
|
323
|
-
...Object.fromEntries(Object.entries(initialConfig).map(([b, K]) => [sharedConfigKey(b), K]))
|
|
324
|
-
}, this._computationControllers = /* @__PURE__ */ new Map(), this._customAttrKeyMapping = {}, this._customConfigKeys = /* @__PURE__ */ new Set(), this._customConfigSubscriptions = /* @__PURE__ */ new Map();
|
|
325
|
-
}
|
|
326
|
-
_isCustomConfig(b) {
|
|
327
|
-
return this._customConfigKeys.has(b);
|
|
328
|
-
}
|
|
329
|
-
_getCustomConfigDefinition(b) {
|
|
330
|
-
let K = this._sharedInstancesBag.pluginManager;
|
|
331
|
-
if (K) return K.configRegistry.get(b);
|
|
332
|
-
}
|
|
333
|
-
_getAttributeNames(b) {
|
|
334
|
-
return [...new Set([toKebabCase(b), b.toLowerCase()])];
|
|
335
|
-
}
|
|
336
|
-
_flushValueToAttribute(b, K) {
|
|
337
|
-
if (isComplexKey(b) || this._isCustomConfig(b) && this._getCustomConfigDefinition(b)?.attribute === !1) return;
|
|
338
|
-
let q = this._getAttributeNames(b);
|
|
339
|
-
for (let b of q) K == null ? this.removeAttribute(b) : this.getAttribute(b) !== K.toString() && this.setAttribute(b, K.toString());
|
|
340
|
-
}
|
|
341
|
-
_flushValueToState(b, K) {
|
|
342
|
-
let q = sharedConfigKey(b);
|
|
343
|
-
if (this.$[q] !== K) if (K == null) {
|
|
344
|
-
let Y = initialConfig[b];
|
|
345
|
-
this.$[q] = Y === void 0 ? K : Y;
|
|
346
|
-
} else this.$[q] = K;
|
|
347
|
-
}
|
|
348
|
-
_setValue(b, K) {
|
|
349
|
-
let q;
|
|
350
|
-
q = this._isCustomConfig(b) ? this._getCustomConfigDefinition(b)?.normalize?.(K) ?? K : normalizeConfigValue(b, K);
|
|
351
|
-
let J = this, Y = getLocalPropName(b);
|
|
352
|
-
J[Y] !== q && (this._assertSameValueDifferentReference(b, J[Y], q), J[Y] = q, this._flushValueToAttribute(b, q), this._flushValueToState(b, q), this.debugPrint(`"${b}"`, q), this._isCustomConfig(b) || runAssertions(this.cfg));
|
|
353
|
-
}
|
|
354
|
-
_getValue(b) {
|
|
355
|
-
return this[getLocalPropName(b)] ?? this.$[sharedConfigKey(b)];
|
|
356
|
-
}
|
|
357
|
-
_assertSameValueDifferentReference(b, K, q) {
|
|
358
|
-
this.cfg.debug && q !== K && typeof q == "object" && typeof K == "object" && JSON.stringify(q) === JSON.stringify(K) && (console.warn(`[uc-config] Option "${b}" value is the same as the previous one but the reference is different`), console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"), console.warn(`[uc-config] "${b}" previous value:`, K), console.warn(`[uc-config] "${b}" new value:`, q));
|
|
359
|
-
}
|
|
360
|
-
_processCustomConfigs(b) {
|
|
361
|
-
let K = b.configRegistry.getAll();
|
|
362
|
-
this._customAttrKeyMapping = {}, this._customConfigKeys = new Set(K.keys());
|
|
363
|
-
for (let [b, q] of this._customConfigSubscriptions) K.has(b) || (q(), this._customConfigSubscriptions.delete(b));
|
|
364
|
-
for (let [b, q] of K) {
|
|
365
|
-
let K = sharedConfigKey(b);
|
|
366
|
-
if (q.attribute) {
|
|
367
|
-
let K = this._getAttributeNames(b);
|
|
368
|
-
for (let q of K) this._customAttrKeyMapping[q] = b;
|
|
369
|
-
}
|
|
370
|
-
this.sharedCtx.has(K) || this.sharedCtx.add(K, q.defaultValue);
|
|
371
|
-
let J = Object.getOwnPropertyDescriptor(this, b);
|
|
372
|
-
if ((!J || !J.set || !J.get) && Object.defineProperty(this, b, {
|
|
373
|
-
set: (K) => {
|
|
374
|
-
this._setValue(b, K);
|
|
375
|
-
},
|
|
376
|
-
get: () => this._getValue(b),
|
|
377
|
-
enumerable: !0,
|
|
378
|
-
configurable: !0
|
|
379
|
-
}), !this._customConfigSubscriptions.has(b)) {
|
|
380
|
-
let q = this.sub(K, (K) => {
|
|
381
|
-
this._setValue(b, K);
|
|
382
|
-
}, !1);
|
|
383
|
-
this._customConfigSubscriptions.set(b, q);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
_setupCustomConfigs() {
|
|
388
|
-
this._sharedInstancesBag.when("pluginManager", (b) => {
|
|
389
|
-
this._processCustomConfigs(b), this._pluginChangeUnsubscribe = b.onPluginsChange(() => {
|
|
390
|
-
this._processCustomConfigs(b);
|
|
391
|
-
});
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
_setupMutationObserver() {
|
|
395
|
-
this._mutationObserver = new MutationObserver((b) => {
|
|
396
|
-
for (let K of b) if (K.type === "attributes" && K.attributeName) {
|
|
397
|
-
let b = K.attributeName, q = K.oldValue, J = this.getAttribute(b);
|
|
398
|
-
if (q === J || b in builtinAttrKeyMapping) continue;
|
|
399
|
-
b in this._customAttrKeyMapping && this.attributeChangedCallback(b, q ?? "", J ?? "");
|
|
400
|
-
}
|
|
401
|
-
}), this._mutationObserver.observe(this, {
|
|
402
|
-
attributes: !0,
|
|
403
|
-
attributeOldValue: !0
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
initCallback() {
|
|
407
|
-
super.initCallback();
|
|
408
|
-
let b = this;
|
|
409
|
-
this._setupCustomConfigs(), this._setupMutationObserver();
|
|
410
|
-
for (let b of plainConfigKeys) this.sub(sharedConfigKey(b), (K) => {
|
|
411
|
-
this._setValue(b, K);
|
|
412
|
-
}, !1);
|
|
413
|
-
for (let K of allConfigKeys) {
|
|
414
|
-
let q = b[K] ?? this.$[sharedConfigKey(K)];
|
|
415
|
-
q !== initialConfig[K] && this._setValue(K, q);
|
|
416
|
-
let Y = Object.getOwnPropertyDescriptor(this, K);
|
|
417
|
-
(!Y || !Y.set || !Y.get) && Object.defineProperty(this, K, {
|
|
418
|
-
set: (b) => {
|
|
419
|
-
this._setValue(K, b);
|
|
420
|
-
},
|
|
421
|
-
get: () => this._getValue(K)
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
for (let b of allConfigKeys) this.sub(sharedConfigKey(b), () => {
|
|
425
|
-
computeProperty({
|
|
426
|
-
key: b,
|
|
427
|
-
setValue: this._setValue.bind(this),
|
|
428
|
-
getValue: this._getValue.bind(this),
|
|
429
|
-
computationControllers: this._computationControllers
|
|
430
|
-
});
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
attributeChangedCallback(b, K, q) {
|
|
434
|
-
if (super.attributeChangedCallback(b, K, q), K === q) return;
|
|
435
|
-
let J = this, Y = builtinAttrKeyMapping[b];
|
|
436
|
-
Y ? J[Y] = q : this._sharedInstancesBag.when("pluginManager", (K) => {
|
|
437
|
-
if (this.getAttribute(b) !== q) return;
|
|
438
|
-
let J = this._customAttrKeyMapping[b], Y = J ? K.configRegistry.get(J) : void 0;
|
|
439
|
-
if (J && Y) {
|
|
440
|
-
let b = Y.fromAttribute ? Y.fromAttribute(q) : q;
|
|
441
|
-
if (this._getValue(J) === b) return;
|
|
442
|
-
this._setValue(J, b);
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
disconnectedCallback() {
|
|
447
|
-
super.disconnectedCallback(), this._pluginChangeUnsubscribe &&= (this._pluginChangeUnsubscribe(), void 0), this._mutationObserver &&= (this._mutationObserver.disconnect(), void 0);
|
|
448
|
-
for (let b of this._customConfigSubscriptions.values()) b();
|
|
449
|
-
this._customConfigSubscriptions.clear();
|
|
450
|
-
}
|
|
451
|
-
static get observedAttributes() {
|
|
452
|
-
let b = super.observedAttributes, K = Object.keys(builtinAttrKeyMapping);
|
|
453
|
-
return [...b, ...K];
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
for (let b of allConfigKeys) Config.prototype[b] = void 0;
|
|
457
|
-
export { BtnUi, CloudImageEditor, CloudImageEditorBlock, Config, CropFrame, EditorAspectRatioButtonControl, EditorCropButtonControl, EditorFilterControl, EditorFreeformButtonControl, EditorImageCropper, EditorImageFader, EditorOperationControl, EditorScroller, EditorSlider, EditorToolbar, Icon, LineLoaderUi, PresenceToggle, SliderUi, defineComponents };
|
|
2
|
+
* @license
|
|
3
|
+
* Package: @uploadcare/file-uploader@1.28.0-alpha.666 (MIT)
|
|
4
|
+
* License: https://github.com/uploadcare/blob/main/LICENSE
|
|
5
|
+
* Built: 2026-03-12T12:26:04.370Z
|
|
6
|
+
*/
|
|
7
|
+
var Ds=Object.defineProperty;var Fs=Object.getOwnPropertyDescriptor;var p=(s,i,t,e)=>{for(var r=e>1?void 0:e?Fs(i,t):i,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(e?n(i,t,r):n(r))||r);return e&&r&&Ds(i,t,r),r};var ce=globalThis,de=ce.ShadowRoot&&(ce.ShadyCSS===void 0||ce.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hi=Symbol(),ji=new WeakMap,ue=class{constructor(i,t,e){if(this.Ws=true,e!==Hi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i,this.t=t;}get styleSheet(){let i=this.o,t=this.t;if(de&&i===void 0){let e=t!==void 0&&t.length===1;e&&(i=ji.get(t)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),e&&ji.set(t,i));}return i}toString(){return this.cssText}},Bi=s=>new ue(typeof s=="string"?s:s+"",void 0,Hi);var Gi=(s,i)=>{if(de)s.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of i){let e=document.createElement("style"),r=ce.litNonce;r!==void 0&&e.setAttribute("nonce",r),e.textContent=t.cssText,s.appendChild(e);}},ai=de?s=>s:s=>s instanceof CSSStyleSheet?(i=>{let t="";for(let e of i.cssRules)t+=e.cssText;return Bi(t)})(s):s;var{is:Ks,defineProperty:Vs,getOwnPropertyDescriptor:zs,getOwnPropertyNames:js,getOwnPropertySymbols:Hs,getPrototypeOf:Bs}=Object,pe=globalThis,qi=pe.trustedTypes,Gs=qi?qi.emptyScript:"",qs=pe.reactiveElementPolyfillSupport,jt=(s,i)=>s,Ht={toAttribute(s,i){switch(i){case Boolean:s=s?Gs:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s);}return s},fromAttribute(s,i){let t=s;switch(i){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s);}catch{t=null;}}return t}},he=(s,i)=>!Ks(s,i),Wi={attribute:true,type:String,converter:Ht,reflect:false,useDefault:false,hasChanged:he};Symbol.metadata??=Symbol("metadata"),pe.litPropertyMetadata??=new WeakMap;var Z=class extends HTMLElement{static addInitializer(i){this.qt(),(this.l??=[]).push(i);}static get observedAttributes(){return this.finalize(),this.tt&&[...this.tt.keys()]}static createProperty(i,t=Wi){if(t.state&&(t.attribute=false),this.qt(),this.prototype.hasOwnProperty(i)&&((t=Object.create(t)).wrapped=true),this.elementProperties.set(i,t),!t.noAccessor){let e=Symbol(),r=this.getPropertyDescriptor(i,e,t);r!==void 0&&Vs(this.prototype,i,r);}}static getPropertyDescriptor(i,t,e){let{get:r,set:o}=zs(this.prototype,i)??{get(){return this[t]},set(n){this[t]=n;}};return {get:r,set(n){let a=r?.call(this);o?.call(this,n),this.requestUpdate(i,a,e);},configurable:true,enumerable:true}}static getPropertyOptions(i){return this.elementProperties.get(i)??Wi}static qt(){if(this.hasOwnProperty(jt("elementProperties")))return;let i=Bs(this);i.finalize(),i.l!==void 0&&(this.l=[...i.l]),this.elementProperties=new Map(i.elementProperties);}static finalize(){if(this.hasOwnProperty(jt("finalized")))return;if(this.finalized=true,this.qt(),this.hasOwnProperty(jt("properties"))){let t=this.properties,e=[...js(t),...Hs(t)];for(let r of e)this.createProperty(r,t[r]);}let i=this[Symbol.metadata];if(i!==null){let t=litPropertyMetadata.get(i);if(t!==void 0)for(let[e,r]of t)this.elementProperties.set(e,r);}this.tt=new Map;for(let[t,e]of this.elementProperties){let r=this.Wt(t,e);r!==void 0&&this.tt.set(r,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(i){let t=[];if(Array.isArray(i)){let e=new Set(i.flat(1/0).reverse());for(let r of e)t.unshift(ai(r));}else i!==void 0&&t.push(ai(i));return t}static Wt(i,t){let e=t.attribute;return e===false?void 0:typeof e=="string"?e:typeof i=="string"?i.toLowerCase():void 0}constructor(){super(),this.ot=void 0,this.isUpdatePending=false,this.hasUpdated=false,this.Ce=null,this.Xs();}Xs(){this.Xt=new Promise(i=>this.enableUpdating=i),this.oe=new Map,this.Ys(),this.requestUpdate(),this.constructor.l?.forEach(i=>i(this));}addController(i){(this.Ue??=new Set).add(i),this.renderRoot!==void 0&&this.isConnected&&i.hostConnected?.();}removeController(i){this.Ue?.delete(i);}Ys(){let i=new Map,t=this.constructor.elementProperties;for(let e of t.keys())this.hasOwnProperty(e)&&(i.set(e,this[e]),delete this[e]);i.size>0&&(this.ot=i);}createRenderRoot(){let i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gi(i,this.constructor.elementStyles),i}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this.Ue?.forEach(i=>i.hostConnected?.());}enableUpdating(i){}disconnectedCallback(){this.Ue?.forEach(i=>i.hostDisconnected?.());}attributeChangedCallback(i,t,e){this.Yt(i,e);}Zs(i,t){let e=this.constructor.elementProperties.get(i),r=this.constructor.Wt(i,e);if(r!==void 0&&e.reflect===true){let o=(e.converter?.toAttribute!==void 0?e.converter:Ht).toAttribute(t,e.type);this.Ce=i,o==null?this.removeAttribute(r):this.setAttribute(r,o),this.Ce=null;}}Yt(i,t){let e=this.constructor,r=e.tt.get(i);if(r!==void 0&&this.Ce!==r){let o=e.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:Ht;this.Ce=r;let a=n.fromAttribute(t,o.type);this[r]=a??this.Zt?.get(r)??a,this.Ce=null;}}requestUpdate(i,t,e,r=false,o){if(i!==void 0){let n=this.constructor;if(r===false&&(o=this[i]),e??=n.getPropertyOptions(i),!((e.hasChanged??he)(o,t)||e.useDefault&&e.reflect&&o===this.Zt?.get(i)&&!this.hasAttribute(n.Wt(i,e))))return;this.C(i,t,e);}this.isUpdatePending===false&&(this.Xt=this.Qs());}C(i,t,{useDefault:e,reflect:r,wrapped:o},n){e&&!(this.Zt??=new Map).has(i)&&(this.Zt.set(i,n??t??this[i]),o!==true||n!==void 0)||(this.oe.has(i)||(this.hasUpdated||e||(t=void 0),this.oe.set(i,t)),r===true&&this.Ce!==i&&(this.Ji??=new Set).add(i));}async Qs(){this.isUpdatePending=true;try{await this.Xt;}catch(t){Promise.reject(t);}let i=this.scheduleUpdate();return i!=null&&await i,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this.ot){for(let[r,o]of this.ot)this[r]=o;this.ot=void 0;}let e=this.constructor.elementProperties;if(e.size>0)for(let[r,o]of e){let{wrapped:n}=o,a=this[r];n!==true||this.oe.has(r)||a===void 0||this.C(r,void 0,o,a);}}let i=false,t=this.oe;try{i=this.shouldUpdate(t),i?(this.willUpdate(t),this.Ue?.forEach(e=>e.hostUpdate?.()),this.update(t)):this.Qt();}catch(e){throw i=false,this.Qt(),e}i&&this.Js(t);}willUpdate(i){}Js(i){this.Ue?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(i)),this.updated(i);}Qt(){this.oe=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Xt}shouldUpdate(i){return true}update(i){this.Ji&&=this.Ji.forEach(t=>this.Zs(t,this[t])),this.Qt();}updated(i){}firstUpdated(i){}};Z.elementStyles=[],Z.shadowRootOptions={mode:"open"},Z[jt("elementProperties")]=new Map,Z[jt("finalized")]=new Map,qs?.({ReactiveElement:Z}),(pe.reactiveElementVersions??=[]).push("2.1.2");var ci=globalThis,Xi=s=>s,fe=ci.trustedTypes,Yi=fe?fe.createPolicy("lit-html",{createHTML:s=>s}):void 0,ui="$lit$",Q=`lit$${Math.random().toFixed(9).slice(2)}$`,di="?"+Q,Ws=`<${di}>`,wt=document,Gt=()=>wt.createComment(""),qt=s=>s===null||typeof s!="object"&&typeof s!="function",pi=Array.isArray,ir=s=>pi(s)||typeof s?.[Symbol.iterator]=="function",li=`[ \f\r]`,Bt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Zi=/-->/g,Qi=/>/g,vt=RegExp(`>|${li}(?:([^\\s"'>=/]+)(${li}*=${li}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ji=/'/g,tr=/"/g,rr=/^(?:script|style|textarea|title)$/i,hi=s=>(i,...t)=>({ne:s,strings:i,values:t}),m=hi(1),F=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),er=new WeakMap,Tt=wt.createTreeWalker(wt,129);function sr(s,i){if(!pi(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yi!==void 0?Yi.createHTML(i):i}var or=(s,i)=>{let t=s.length-1,e=[],r,o=i===2?"<svg>":i===3?"<math>":"",n=Bt;for(let a=0;a<t;a++){let l=s[a],c,d,u=-1,h=0;for(;h<l.length&&(n.lastIndex=h,d=n.exec(l),d!==null);)h=n.lastIndex,n===Bt?d[1]==="!--"?n=Zi:d[1]!==void 0?n=Qi:d[2]!==void 0?(rr.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=vt):d[3]!==void 0&&(n=vt):n===vt?d[0]===">"?(n=r??Bt,u=-1):d[1]===void 0?u=-2:(u=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?vt:d[3]==='"'?tr:Ji):n===tr||n===Ji?n=vt:n===Zi||n===Qi?n=Bt:(n=vt,r=void 0);let f=n===vt&&s[a+1].startsWith("/>")?" ":"";o+=n===Bt?l+Ws:u>=0?(e.push(c),l.slice(0,u)+ui+l.slice(u)+Q+f):l+Q+(u===-2?a:f);}return [sr(s,o+(s[t]||"<?>")+(i===2?"</svg>":i===3?"</math>":"")),e]},Wt=class s{constructor({strings:i,ne:t},e){let r;this.parts=[];let o=0,n=0,a=i.length-1,l=this.parts,[c,d]=or(i,t);if(this.el=s.createElement(c,e),Tt.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes);}for(;(r=Tt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let u of r.getAttributeNames())if(u.endsWith(ui)){let h=d[n++],f=r.getAttribute(u).split(Q),b=/([.?@])?(.*)/.exec(h);l.push({type:1,index:o,name:b[2],strings:f,ctor:b[1]==="."?ge:b[1]==="?"?ye:b[1]==="@"?be:xt}),r.removeAttribute(u);}else u.startsWith(Q)&&(l.push({type:6,index:o}),r.removeAttribute(u));if(rr.test(r.tagName)){let u=r.textContent.split(Q),h=u.length-1;if(h>0){r.textContent=fe?fe.emptyScript:"";for(let f=0;f<h;f++)r.append(u[f],Gt()),Tt.nextNode(),l.push({type:2,index:++o});r.append(u[h],Gt());}}}else if(r.nodeType===8)if(r.data===di)l.push({type:2,index:o});else {let u=-1;for(;(u=r.data.indexOf(Q,u+1))!==-1;)l.push({type:7,index:o}),u+=Q.length-1;}o++;}}static createElement(i,t){let e=wt.createElement("template");return e.innerHTML=i,e}};function Ct(s,i,t=s,e){if(i===F)return i;let r=e!==void 0?t.eo?.[e]:t.to,o=qt(i)?void 0:i.Jt;return r?.constructor!==o&&(r?.er?.(false),o===void 0?r=void 0:(r=new o(s),r.ei(s,t,e)),e!==void 0?(t.eo??=[])[e]=r:t.to=r),r!==void 0&&(i=Ct(s,r.io(s,i.values),r,e)),i}var me=class{constructor(i,t){this.tr=[],this.z=void 0,this.ir=i,this.a=t;}get parentNode(){return this.a.parentNode}get v(){return this.a.v}u(i){let{el:{content:t},parts:e}=this.ir,r=(i?.creationScope??wt).importNode(t,true);Tt.currentNode=r;let o=Tt.nextNode(),n=0,a=0,l=e[0];for(;l!==void 0;){if(n===l.index){let c;l.type===2?c=new Rt(o,o.nextSibling,this,i):l.type===1?c=new l.ctor(o,l.name,l.strings,this,i):l.type===6&&(c=new ve(o,this,i)),this.tr.push(c),l=e[++a];}n!==l?.index&&(o=Tt.nextNode(),n++);}return Tt.currentNode=wt,r}p(i){let t=0;for(let e of this.tr)e!==void 0&&(e.strings!==void 0?(e.q(i,e,t),t+=e.strings.length-2):e.q(i[t])),t++;}},Rt=class s{get v(){return this.a?.v??this.rr}constructor(i,t,e,r){this.type=2,this.e=w,this.z=void 0,this.Y=i,this.we=t,this.a=e,this.options=r,this.rr=r?.isConnected??true;}get parentNode(){let i=this.Y.parentNode,t=this.a;return t!==void 0&&i?.nodeType===11&&(i=t.parentNode),i}get startNode(){return this.Y}get endNode(){return this.we}q(i,t=this){i=Ct(this,i,t),qt(i)?i===w||i==null||i===""?(this.e!==w&&this.xe(),this.e=w):i!==this.e&&i!==F&&this.sr(i):i.ne!==void 0?this.$(i):i.nodeType!==void 0?this.T(i):ir(i)?this.k(i):this.sr(i);}O(i){return this.Y.parentNode.insertBefore(i,this.we)}T(i){this.e!==i&&(this.xe(),this.e=this.O(i));}sr(i){this.e!==w&&qt(this.e)?this.Y.nextSibling.data=i:this.T(wt.createTextNode(i)),this.e=i;}$(i){let{values:t,ne:e}=i,r=typeof e=="number"?this.ro(i):(e.el===void 0&&(e.el=Wt.createElement(sr(e.h,e.h[0]),this.options)),e);if(this.e?.ir===r)this.e.p(t);else {let o=new me(r,this),n=o.u(this.options);o.p(t),this.T(n),this.e=o;}}ro(i){let t=er.get(i.strings);return t===void 0&&er.set(i.strings,t=new Wt(i)),t}k(i){pi(this.e)||(this.e=[],this.xe());let t=this.e,e,r=0;for(let o of i)r===t.length?t.push(e=new s(this.O(Gt()),this.O(Gt()),this,this.options)):e=t[r],e.q(o),r++;r<t.length&&(this.xe(e&&e.we.nextSibling,r),t.length=r);}xe(i=this.Y.nextSibling,t){for(this.at?.(false,true,t);i!==this.we;){let e=Xi(i).nextSibling;Xi(i).remove(),i=e;}}setConnected(i){this.a===void 0&&(this.rr=i,this.at?.(i));}},xt=class{get tagName(){return this.element.tagName}get v(){return this.a.v}constructor(i,t,e,r,o){this.type=1,this.e=w,this.z=void 0,this.element=i,this.name=t,this.a=r,this.options=o,e.length>2||e[0]!==""||e[1]!==""?(this.e=Array(e.length-1).fill(new String),this.strings=e):this.e=w;}q(i,t=this,e,r){let o=this.strings,n=false;if(o===void 0)i=Ct(this,i,t,0),n=!qt(i)||i!==this.e&&i!==F,n&&(this.e=i);else {let a=i,l,c;for(i=o[0],l=0;l<o.length-1;l++)c=Ct(this,a[e+l],t,l),c===F&&(c=this.e[l]),n||=!qt(c)||c!==this.e[l],c===w?i=w:i!==w&&(i+=(c??"")+o[l+1]),this.e[l]=c;}n&&!r&&this.j(i);}j(i){i===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,i??"");}},ge=class extends xt{constructor(){super(...arguments),this.type=3;}j(i){this.element[this.name]=i===w?void 0:i;}},ye=class extends xt{constructor(){super(...arguments),this.type=4;}j(i){this.element.toggleAttribute(this.name,!!i&&i!==w);}},be=class extends xt{constructor(i,t,e,r,o){super(i,t,e,r,o),this.type=5;}q(i,t=this){if((i=Ct(this,i,t,0)??w)===F)return;let e=this.e,r=i===w&&e!==w||i.capture!==e.capture||i.once!==e.once||i.passive!==e.passive,o=i!==w&&(e===w||r);r&&this.element.removeEventListener(this.name,this,e),o&&this.element.addEventListener(this.name,this,i),this.e=i;}handleEvent(i){typeof this.e=="function"?this.e.call(this.options?.host??this.element,i):this.e.handleEvent(i);}},ve=class{constructor(i,t,e){this.element=i,this.type=6,this.z=void 0,this.a=t,this.options=e;}get v(){return this.a.v}q(i){Ct(this,i);}},Xs=ci.litHtmlPolyfillSupport;Xs?.(Wt,Rt),(ci.litHtmlVersions??=[]).push("3.3.2");var ar=(s,i,t)=>{let e=t?.renderBefore??i,r=e.so;if(r===void 0){let o=t?.renderBefore??null;e.so=r=new Rt(i.insertBefore(Gt(),o),o,void 0,t??{});}return r.q(s),r};var fi=globalThis,at=class extends Z{constructor(){super(...arguments),this.renderOptions={host:this},this.ti=void 0;}createRenderRoot(){let i=super.createRenderRoot();return this.renderOptions.renderBefore??=i.firstChild,i}update(i){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(i),this.ti=ar(t,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this.ti?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this.ti?.setConnected(false);}render(){return F}};at.Gn=true,at.finalized=true,fi.litElementHydrateSupport?.({LitElement:at});var Ys=fi.litElementPolyfillSupport;Ys?.({LitElement:at});(fi.litElementVersions??=[]).push("4.2.2");var Zs={attribute:true,type:String,converter:Ht,reflect:false,hasChanged:he},Qs=(s=Zs,i,t)=>{let{kind:e,metadata:r}=t,o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),e==="setter"&&((s=Object.create(s)).wrapped=true),o.set(t.name,s),e==="accessor"){let{name:n}=t;return {set(a){let l=i.get.call(this);i.set.call(this,a),this.requestUpdate(n,l,s,true,a);},init(a){return a!==void 0&&this.C(n,void 0,s,a),a}}}if(e==="setter"){let{name:n}=t;return function(a){let l=this[n];i.call(this,a),this.requestUpdate(n,l,s,true,a);}}throw Error("Unsupported decorator location: "+e)};function y(s){return (i,t)=>typeof t=="object"?Qs(s,i,t):((e,r,o)=>{let n=r.hasOwnProperty(o);return r.constructor.createProperty(o,e),n?Object.getOwnPropertyDescriptor(r,o):void 0})(s,i,t)}function g(s){return y({...s,state:true,attribute:false})}var lr=s=>s.strings===void 0;var lt={ATTRIBUTE:1,CHILD:2},j=s=>(...i)=>({Jt:s,values:i}),W=class{constructor(i){}get v(){return this.a.v}ei(i,t,e){this.ut=i,this.a=t,this.ao=e;}io(i,t){return this.update(i,t)}update(i,t){return this.render(...t)}};var Xt=(s,i)=>{let t=s.z;if(t===void 0)return false;for(let e of t)e.er?.(i,false),Xt(e,i);return true},we=s=>{let i,t;do{if((i=s.a)===void 0)break;t=i.z,t.delete(s),s=i;}while(t?.size===0)},cr=s=>{for(let i;i=s.a;s=i){let t=i.z;if(t===void 0)i.z=t=new Set;else if(t.has(s))break;t.add(s),eo(i);}};function Js(s){this.z!==void 0?(we(this),this.a=s,cr(this)):this.a=s;}function to(s,i=false,t=0){let e=this.e,r=this.z;if(r!==void 0&&r.size!==0)if(i)if(Array.isArray(e))for(let o=t;o<e.length;o++)Xt(e[o],false),we(e[o]);else e!=null&&(Xt(e,false),we(e));else Xt(this,s);}var eo=s=>{s.type==lt.CHILD&&(s.at??=to,s.oo??=Js);},Ce=class extends W{constructor(){super(...arguments),this.z=void 0;}ei(i,t,e){super.ei(i,t,e),cr(this),this.isConnected=i.v;}er(i,t=true){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(Xt(this,i),we(this));}setValue(i){if(lr(this.ut))this.ut.q(i,this);else {let t=[...this.ut.e];t[this.ao]=i,this.ut.q(t,this,0);}}disconnected(){}reconnected(){}};var E=()=>new gi,gi=class{},mi=new WeakMap,k=j(class extends Ce{render(s){return w}update(s,[i]){let t=i!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=i,this.ht=s.options?.host,this.rt(this.ct=s.element)),w}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){let i=this.ht??globalThis,t=mi.get(i);t===void 0&&(t=new WeakMap,mi.set(i,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,s),s!==void 0&&this.G.call(this.ht,s);}else this.G.value=s;}get lt(){return typeof this.G=="function"?mi.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0);}reconnected(){this.rt(this.ct);}});var Et=class extends W{constructor(i){if(super(i),this.it=w,i.type!==lt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(i){if(i===w||i==null)return this.or=void 0,this.it=i;if(i===F)return i;if(typeof i!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(i===this.it)return this.or;this.it=i;let t=[i];return t.raw=t,this.or={ne:this.constructor.resultType,strings:t,values:[]}}};Et.directiveName="unsafeHTML",Et.resultType=1;var Yt=class extends Et{};Yt.directiveName="unsafeSVG",Yt.resultType=2;var xe=j(Yt);function Zt(s,i,t){return s?i(s):t?.(s)}var ur;(function(s){s.Token="token",s.FileInfo="file_info";})(ur||(ur={}));var dr;(function(s){s.Unknown="unknown",s.Waiting="waiting",s.Progress="progress",s.Error="error",s.Success="success";})(dr||(dr={}));var Ee=class{pt=1;ii=[];dt=0;ri=new Map;si=new Map;constructor(i){this.pt=i;}run(){let i=this.pt-this.dt;for(let t=0;t<i;t++){let e=this.ii.shift();if(!e)return;let r=this.ri.get(e),o=this.si.get(e);if(!r||!o)throw new Error("Unexpected behavior: resolver or rejector is undefined");this.dt+=1,e().finally(()=>{this.ri.delete(e),this.si.delete(e),this.dt-=1,this.run();}).then(n=>r(n)).catch(n=>o(n));}}add(i,{autoRun:t}={autoRun:true}){return new Promise((e,r)=>{this.ri.set(i,e),this.si.set(i,r),this.ii.push(i),t&&this.run();})}get pending(){return this.ii.length}get running(){return this.dt}set concurrency(i){this.pt=i,this.run();}get concurrency(){return this.pt}};var pr=()=>({});var hr=Object.freeze({START_FROM:"start-from",CAMERA:"camera",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external"});var T=s=>`*cfg/${s}`;var St=s=>s?s.split(",").map(i=>i.trim()).filter(Boolean):[],kt=s=>s.join(",");var fr=s=>{if(typeof s!="string"||!s)return "";let i=s.trim();return i.startsWith("-/")?i=i.slice(2):i.startsWith("/")&&(i=i.slice(1)),i.endsWith("/")&&(i=i.slice(0,i.length-1)),i},Se=(...s)=>s.filter(i=>typeof i=="string"&&!!i).map(i=>fr(i)).join("/-/"),J=(...s)=>{let i=Se(...s);return i?`-/${i}/`:""};function ke(s){let i=new URL(s),t=i.pathname+i.search+i.hash,e=t.lastIndexOf("http"),r=t.lastIndexOf("/"),o="";return e>=0?o=t.slice(e):r>=0&&(o=t.slice(r+1)),o}function Oe(s){let i=new URL(s),{pathname:t}=i,e=t.indexOf("/"),r=t.indexOf("/",e+1);return t.substring(e+1,r)}function yi(s){let i=mr(s),t=new URL(i),e=t.pathname.indexOf("/-/");return e===-1?"":t.pathname.substring(e).slice(1)}function bi(s){return yi(s).split("/-/").filter(Boolean).map(t=>fr(t))}function mr(s){let i=new URL(s),t=ke(s),e=gr(t)?yr(t).pathname:t;return i.pathname=i.pathname.replace(e,""),i.search="",i.hash="",i.toString()}function gr(s){return s.startsWith("http")}function yr(s){let i=new URL(s);return {pathname:`${i.origin}${i.pathname??""}`,search:i.search??"",hash:i.hash??""}}var tt=(s,i,t)=>{let e=new URL(mr(s)),r=ke(s),o=i??"";if(e.pathname.startsWith("//")&&(e.pathname=e.pathname.replace("//","/")),r&&gr(r)){let n=yr(r);e.pathname=`${e.pathname}${o}${n.pathname||""}`,e.search=n.search,e.hash=n.hash;}else e.pathname=`${e.pathname}${o}${r||""}`;return e.toString()},vi=(s,i)=>{let t=new URL(s);return t.pathname=`${i}/`,t.toString()};var Qt=(s,i=",")=>s.trim().split(i).map(t=>t.trim()).filter(t=>t.length>0);var Jt=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:false,flip:false,crop:void 0}),vr=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function io(s,i){if(typeof i=="number"){let t=i;return Jt[s]!==t?`${s}/${t}`:""}if(typeof i=="boolean"){let t=i;return Jt[s]!==t?`${s}`:""}if(s==="filter"&&i){let{name:t,amount:e}=i;return Jt.filter===e?"":`${s}/${t}/${e}`}if(s==="crop"&&i){let{dimensions:t,coords:e}=i;return `${s}/${t.join("x")}/${e.join(",")}`}return ""}function ct(s){return Se(...vr.filter(i=>typeof s[i]<"u"&&s[i]!==null).map(i=>{let t=s[i];return io(i,t)}).filter(i=>!!i))}var Ae=Se("format/auto","progressive/yes"),et=([s])=>typeof s<"u"?Number(s):void 0,br=()=>true,ro=([s,i])=>({name:s,amount:typeof i<"u"?Number(i):100}),so=([s,i])=>{if(!/\d+x\d+/.test(s)||!/\d+,\d+/.test(i))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return {dimensions:Qt(s,"x").map(Number),coords:Qt(i).map(Number)}},oo=Object.freeze({enhance:et,brightness:et,exposure:et,gamma:et,contrast:et,saturation:et,vibrance:et,warmth:et,filter:ro,mirror:br,flip:br,rotate:et,crop:s=>{let[i,t]=s,{dimensions:e,coords:r}=so([i,t]);return {dimensions:e,coords:r}}});function Ti(s){let i={};for(let t of s){let[e,...r]=t.split("/");if(!e||!vr.includes(e))continue;let o=e,n=oo[o];try{let a=n(r);i[o]=a;}catch(a){console.warn([`Failed to parse URL operation "${t}". It will be ignored.`,a instanceof Error?`Error message: "${a.message}"`:a,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join(` `));}}return i}var O=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),$=Object.freeze([O.CROP,O.TUNING,O.FILTERS]),Tr=Object.freeze(["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"]),wr=Object.freeze(["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"]),Cr=Object.freeze(["rotate","mirror","flip"]),it=Jt,H=Object.freeze({brightness:{zero:it.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:it.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:it.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:it.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:it.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:it.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:it.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:it.enhance,range:[0,100],keypointsNumber:1},filter:{zero:it.filter,range:[0,100],keypointsNumber:1}});var wi="https://ucarecdn.com",no="https://upload.uploadcare.com",ao="https://social.uploadcare.com",lo="https://ucarecd.net",co={pubkey:"",multiple:true,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:false,imgOnly:false,accept:"",externalSourcesPreferredTypes:"",externalSourcesEmbedCss:"",store:"auto",cameraMirror:false,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",topLevelOrigin:"",maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:false,useLocalImageEditor:false,removeCopyright:false,cropPreset:"",imageShrink:"",modalScrollLock:true,modalBackdropStrokes:false,sourceListWrap:true,remoteTabSessionKey:"",cdnCname:wi,cdnCnamePrefixed:lo,baseUrl:no,socialBaseUrl:ao,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:3,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:false,saveUrlForRecurrentUploads:false,groupOutput:false,userAgentIntegration:"",debug:false,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:600*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[],validationTimeout:15*1e3,validationConcurrency:100,cameraModes:"photo, video",defaultCameraMode:null,enableAudioRecording:true,enableVideoRecording:null,maxVideoRecordingDuration:null,mediaRecorderOptions:null,filesViewMode:"list",gridShowFileNames:false,useCloudImageEditor:true,cloudImageEditorAutoOpen:false,cloudImageEditorTabs:kt($),cloudImageEditorMaskHref:null,testMode:false,qualityInsights:true,pasteScope:"local",plugins:[]},R=Object.freeze(co);var Pe=(s,i)=>(...t)=>{let e=s();if(!e.read(T("debug")))return;let r=t;if(typeof t?.[0]=="function"){let n=t[0];r=n();}let o=[e.id,i].filter(Boolean);console.log(`[${o.join("][")}]`,...r);};var D=class{constructor(i){this.oi=new Set;this.ae=null;this.b=Pe(()=>this.n.ctx,this.constructor.name);this.n=i,this.i=i.ctx;}addSub(i){this.oi.add(i);}get nr(){if(!this.ae){let i={};this.ae=new Proxy(i,{set:()=>{throw new Error("SharedInstance cfg proxy is read-only")},get:(t,e)=>{if(typeof e!="string")return;let r=T(e);return this.n.ctx.has(r)?this.n.ctx.read(r):R[e]}});}return this.ae}destroy(){for(let i of this.oi)try{i();}catch{}this.oi.clear();}},uo={modalManager:"*modalManager",pluginManager:"*pluginManager",telemetryManager:"*telemetryManager",localeManager:"*localeManager",a11y:"*a11y",clipboard:"*clipboard",blocksRegistry:"*blocksRegistry",eventEmitter:"*eventEmitter",uploadCollection:"*uploadCollection",secureUploadsManager:"*secureUploadsManager",api:"*publicApi",validationManager:"*validationManager"},B=(s,i,t=true)=>{let e=s.has(i),r=e?s.read(i):null;if(e&&r||!t)return r;throw new Error(`Unexpected error: shared instance for key "${String(i)}" is not available`)},xr=s=>({get ctx(){return s()},get modalManager(){return B(s(),"*modalManager",false)},get pluginManager(){return B(s(),"*pluginManager")},get telemetryManager(){return B(s(),"*telemetryManager")},get localeManager(){return B(s(),"*localeManager")},get a11y(){return B(s(),"*a11y")},get blocksRegistry(){return B(s(),"*blocksRegistry")},get eventEmitter(){return B(s(),"*eventEmitter")},get uploadCollection(){return B(s(),"*uploadCollection")},get secureUploadsManager(){return B(s(),"*secureUploadsManager",false)},get api(){return B(s(),"*publicApi")},get validationManager(){return B(s(),"*validationManager")},when(i,t){let e=uo[i],r=s(),o=r.has(e)?r.read(e):void 0;if(o)return t(o),()=>{};let n=r.sub(e,a=>{a&&(t(a),n());});return n},wait(i){return new Promise(t=>{let e=this.when(i,r=>{t(r),e();});})}});var Re=class extends D{constructor(t){super(t);this.scopes=new Set;this.listener=this.lo.bind(this),window.addEventListener("paste",this.listener);}openUploadList(){this.n.api.setCurrentActivity(hr.UPLOAD_LIST),this.n.api.setModalState(true);}async lo(t){if(t.clipboardData){for(let e of this.scopes)if(e.isConnected)switch(this.nr.pasteScope){case "global":await this.handlePaste(t);break;case "local":if(!e.contains(t.target))continue;await this.handlePaste(t);break;default:continue}}}async handlePaste(t){if(!t.clipboardData)return;let e=Array.from(t.clipboardData.items),r=e.map(n=>n.getAsFile()).filter(n=>n!==null),o=e.filter(n=>n.kind==="string"&&n.type==="text/plain").map(n=>new Promise(a=>{n.getAsString(l=>{a(l);});}));r.length>0&&(r.forEach(n=>{this.n.api.addFileFromObject(n,{source:"clipboard"});}),this.openUploadList()),o.length>0&&((await Promise.all(o)).forEach(a=>{this.n.api.addFileFromUrl(a,{source:"clipboard"});}),this.openUploadList());}registerBlock(t){return this.scopes.add(t),()=>{this.scopes.delete(t);}}destroy(){super.destroy(),window.removeEventListener("paste",this.listener),this.scopes.clear();}};var po={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function te(s,i){i.tabIndex=0,i.focus(),s.tabIndex=-1;}function Ci(s){let i=s.role||s.type||s.tagName;if(!i)return null;let t=po[i.toLowerCase()];if(!t)return null;for(let e of t){let r=s.closest(`[role=${e}]`);if(r)return r}}function xi(s,i){return i.role==="toolbar"?ho(i):i.querySelectorAll(`[role=${s.role}]`)}function ho(s){return [...s.querySelectorAll("*")].filter(t=>t.role==="button"||t.type==="button"||t.role==="checkbox"||t.type==="checkbox")}function fo(s){let i=s.getAttribute("aria-orientation");if(i==="vertical")return false;if(i==="horizontal")return true;let t=s.role;return t==="menubar"||t==="tablist"||t==="toolbar"}function Er(s){return i=>{let t=false,e=300,r=0,o="";function n(u){let h=Ci(u.target);if(!h){a();return}let f=xi(u.target,h),b=Array.from(f).indexOf(u.target),L="ArrowDown",P="ArrowUp";if(fo(h)&&(i.document.dir==="rtl"?(L="ArrowLeft",P="ArrowRight"):(L="ArrowRight",P="ArrowLeft")),u.key===L)u.preventDefault(),te(u.target,f[b+1]||f[0]);else if(u.key===P)u.preventDefault(),te(u.target,f[b-1]||f[f.length-1]);else if(u.key==="Home")u.preventDefault(),te(u.target,f[0]);else if(u.key==="End")u.preventDefault(),te(u.target,f[f.length-1]);else if(u.key.length===1&&h.role!=="tablist"){let I=Date.now();I-r<=e?o+=u.key.toLowerCase():o=u.key.toLowerCase(),r=I;let bt=Array.from(f).find(_s=>_s.textContent?.trim()?.toLowerCase()?.startsWith(o));bt&&(u.preventDefault(),te(u.target,bt));}}function a(){t=false,i.removeEventListener("keydown",n);}function l(u){let h=Ci(u.target);if(h){t||(t=true,i.addEventListener("keydown",n));let f=xi(u.target,h);for(let b of f)b!==u.target&&b.setAttribute("tabindex",-1);}else t&&a();}function c(u){(!u.relatedTarget||u.relatedTarget===i.document)&&a();}function d(u){let h=Ci(u.target);if(h){let f=xi(u.target,h);for(let b of f)b!==u.target&&b.setAttribute("tabindex",-1);u.target.setAttribute("tabindex",0);}}return i.addEventListener("click",d),i.addEventListener("focusin",l),i.addEventListener("focusout",c),()=>{a(),i.removeEventListener("click",d),i.removeEventListener("focusin",l),i.removeEventListener("focusout",c);}}}function Sr(){return s=>{let i,t;function e(o){if(o.target.getAttribute("aria-hidden")==="true"){i=o.target,i.setAttribute("aria-hidden","false"),t=i.hidden,t&&(i.hidden=false);let n=o.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');n&&(n.tabIndex=0);}}function r(o){i&&i.contains(o.target)&&(!o.relatedTarget||!i.contains(o.relatedTarget))&&(o.target.tabIndex=-1,i.setAttribute("aria-hidden","true"),t&&(i.hidden=true),i=null);}return s.addEventListener("keyuxJump",e),s.addEventListener("focusout",r),()=>{s.removeEventListener("keyuxJump",e),s.removeEventListener("focusout",r);}}}function kr(){return s=>{let i=[];function t(l){let c=s.document.activeElement;c&&c!==s.document.body&&i.push(new WeakRef(c)),l.focus({focusVisible:true});}function e(){let l=i.pop();if(!l){s.document.activeElement.blur();return}let c=l.deref();c&&c.isConnected?c.focus():e();}let r=0,o;function n(l){clearInterval(o);let c=l.getAttribute("aria-controls");o=setInterval(()=>{if(r++>50){clearInterval(o);return}let d=s.document.getElementById(c);if(d){let u=d.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');u&&(clearInterval(o),d.dispatchEvent(new s.CustomEvent("keyuxJump",{bubbles:true})),t(u));}},50);}function a(l){l.target.getAttribute("aria-controls")&&l.key==="Enter"&&n(l.target),l.key==="Escape"&&e();}return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a);}}}function Or(s){let i,t=s.split(" "),e;function r(a){a.key==="Enter"&&(a.target.tagName==="BUTTON"||a.target.tagName==="A")&&(o(),a.target.classList.add(...t),i=a.target,e=a.target);}function o(){i&&i.classList.remove(...t),e=null;}function n(a){a.clientX===0&&a.clientY===0&&e!==a.target&&(o(),a.target.classList.add(...t),i=a.target);}return a=>(a.addEventListener("click",n),a.addEventListener("keydown",r),a.addEventListener("keyup",o),()=>{a.removeEventListener("click",n),a.removeEventListener("keydown",r),a.removeEventListener("keyup",o);})}function Ar(s,i){let t=i.map(e=>e(s));return ()=>{t.forEach(e=>e());}}var Ei=class{constructor(){this.S=new Map;this.ni=[];}addEventListener(i,t){let e=r=>{let o=r.target;o instanceof Node&&this.ni.some(n=>n===o||n.contains(o))&&t(r);};this.S.set(t,e),window.addEventListener(i,e);}removeEventListener(i,t){let e=this.S.get(t);e&&window.removeEventListener(i,e),this.S.delete(t);}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(i){this.ni.push(i);}destroy(){this.ni=[];for(let i of this.S.values())window.removeEventListener("keydown",i),window.removeEventListener("keyup",i);this.S.clear();}},Me=class{constructor(){this.mt=new Ei,this.ar=Ar(this.mt,[Er(),Or("is-pressed"),kr(),Sr()]);}registerBlock(i){this.mt.registerScope(i);}destroy(){this.ar?.(),this.mt.destroy();}};var ee={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"{{count}} of {{total}} selected","select-all":"Select all","deselect-all":"Deselect all","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-mobile-video-camera":"Video","src-type-mobile-photo-camera":"Photo","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-ngdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"OneDrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You\u2019ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You\u2019ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error occurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit","file-item-remove-button":"Remove","a11y-editor-tab-filters":"Filters","a11y-editor-tab-tuning":"Tuning","a11y-editor-tab-crop":"Crop","a11y-activity-header-button-close":"Close",flip:"Flip",mirror:"Mirror","a11y-cloud-editor-apply-filter":"Apply {{name}} filter","a11y-cloud-editor-apply-crop":"Apply {{name}} operation","a11y-cloud-editor-apply-tuning":"Apply {{name}} tuning","a11y-cloud-editor-apply-aspect-ratio":"Apply operation {{name}} {{value}}",finished:"Finished",failed:"Failed",uploading:"Uploading",idle:"Idle","a11y-file-item-status":"File {{fileName}} in status {{status}}","waiting-for":"Waiting for {{source}}","queued-uploading":"Queued for upload","queued-validation":"Queued for validation",validation:"Validating","crop-to-shape":"Crop to {{value}}",custom:"Freeform","freeform-crop":"Freeform crop"};var Si=new Map,Pr=new Map,Rr=(s,i)=>{Si.has(s)&&console.log(`Locale ${s} is already defined. Overwriting...`);let t={...ee,...i};return Si.set(s,t),t},mo=(s,i)=>{Pr.set(s,i);},go=(s,i)=>{typeof i=="function"?mo(s,i):Rr(s,i);},Mr=async s=>{let i=Si.get(s);if(!i){let t=Pr.get(s);if(!t)throw new Error(`Locale ${s} is not defined`);let e=await t();i=Rr(s,e);}return i};go("en",ee);var rt=s=>`*l10n/${s}`,yo="en",Le=class extends D{constructor(t){super(t);this.Ee="";for(let[r,o]of Object.entries(ee)){let n=this.i.has(rt(r))?!this.i.read(rt(r)):true;this.i.add(rt(r),o,n);}let e=t.pluginManager;e?.onPluginsChange&&this.addSub(e.onPluginsChange(()=>{this.Ee&&this.lr(this.Ee);})),this.addSub(this.i.sub(T("localeName"),async r=>{if(!r)return;this.Ee=r;let o=await Mr(r);r!==yo&&this.Ee!==r||(this.lr(r),this.cr(r,o));})),this.addSub(this.i.sub(T("localeDefinitionOverride"),r=>{if(!r)return;let o=r[this.Ee];o&&this.cr(this.Ee,o);}));}cr(t,e){let r=this.nr.localeDefinitionOverride?.[t];for(let[o,n]of Object.entries(e)){let a=r?.[o];this.i.add(rt(o),a??n,true);}}lr(t){let e=this.n.pluginManager;if(!e)return;let r=e.snapshot();for(let o of r.i18n){let{pluginId:n,...a}=o,l=a[t];if(l)for(let[c,d]of Object.entries(l))d!==void 0&&this.i.add(rt(c),d,true);}}};var Mt=Object.freeze({ADD:"modal:add",DELETE:"modal:delete",OPEN:"modal:open",CLOSE:"modal:close",CLOSE_ALL:"modal:closeAll",DESTROY:"modal:destroy"}),Ie=class extends D{constructor(){super(...arguments);this.le=new Map;this.W=new Set;this.w=new Map;}registerModal(t,e){this.le.set(t,e),this.Se(Mt.ADD,{id:t,modal:e});}deleteModal(t){let e=this.le.get(t);return e?(this.le.delete(t),this.W.delete(t),this.Se(Mt.DELETE,{id:t,modal:e}),true):false}open(t){let e=this.le.get(t);return e?(this.W.add(t),this.Se(Mt.OPEN,{modal:e,id:t}),true):(this.b(`Modal with ID "${t}" not found`),false)}close(t){let e=this.le.get(t);return !e||!this.W.has(t)?(this.b(`Modal with ID "${t}" not found or not active`),false):(this.W.delete(t),this.Se(Mt.CLOSE,{id:t,modal:e}),true)}toggle(t){return this.le.has(t)?this.W.has(t)?this.close(t):this.open(t):(this.b(`Modal with ID "${t}" not found`),false)}get hasActiveModals(){return this.W.size>0}back(){if(this.W.size===0)return this.b("No active modals to go back from"),false;let t=Array.from(this.W).pop();return t?this.close(t):false}closeAll(){let t=this.W.size;return this.W.clear(),this.Se(Mt.CLOSE_ALL,{}),t}subscribe(t,e){return this.w.has(t)||this.w.set(t,new Set),this.w.get(t)?.add(e),()=>this.unsubscribe(t,e)}unsubscribe(t,e){this.w.has(t)&&this.w.get(t)?.delete(e);}Se(t,e){if(this.w.has(t))for(let r of this.w.get(t)??new Set)try{r(e);}catch(o){this.n.telemetryManager.sendEventError(o,"modal subscriber"),this.b("Error in modal subscriber:",o);}}destroy(){super.destroy(),this.closeAll(),this.le.clear(),this.w.clear(),this.Se(Mt.DESTROY,{});}};var bo=()=>{let s=navigator.userAgent;return /Macintosh|Windows/.test(s)&&/Version\/[\d.]+.*Safari/.test(s)&&!/Chrome|Chromium|Edg|OPR/.test(s)},vo=()=>"capture"in document.createElement("input"),To=()=>({safariDesktop:bo()}),wo=()=>({htmlMediaCapture:vo()}),Lr=To();wo();var Ir="image/*";var Co=["image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"],xo=()=>Lr.safariDesktop?[Ir]:[Ir,...Co],Eo=xo();var So=(s,i)=>i.some(t=>{if(t.endsWith("*")){let e=t.replace("*","");return s.startsWith(e)}return s===t});var $r=s=>{let i=s?.type;return i?So(i,Eo):false};function Ur(s,i,t,e,r){return {registry:{registerSource:c=>s.addSource(e,c),registerActivity:c=>s.addActivity(e,c),registerFileAction:c=>s.addFileAction(e,c),registerFileHook:c=>s.addFileHook(e,c),registerIcon:c=>s.addIcon(e,c),registerI18n:c=>s.addI18n(e,c),registerConfig:c=>s.addConfig(e,c)},config:{get:c=>{let d=T(c);return i.read(d)},subscribe:(c,d)=>{let u=T(c),h=i.sub(u,f=>{d(f);});return r.push(h),h}},activity:{getParams:()=>i.read("*currentActivityParams"),subscribeToParams:c=>{let d=i.sub("*currentActivityParams",u=>{c(u);});return r.push(d),d}},files:{update:(c,d)=>{let u=t.uploadCollection?.read(c);u&&(d.file!==void 0&&(u.setValue("file",d.file),u.setValue("fileSize",d.file.size)),d.cdnUrl!==void 0&&u.setValue("cdnUrl",d.cdnUrl),d.cdnUrlModifiers!==void 0&&u.setValue("cdnUrlModifiers",d.cdnUrlModifiers),d.mimeType!==void 0&&u.setValue("mimeType",d.mimeType));}}}}var ko=async({entries:s,signal:i})=>(await Promise.all(s.map(async e=>{if(e.isEnabled())try{let r=await e.load();return i.aborted||!e.isEnabled()?void 0:r??void 0}catch(r){i.aborted||console.warn("Failed to load lazy plugin",r);return}}))).filter(e=>e!==void 0),$e=class{constructor(i,t){this.i=i;this.uo=t;this.Ne=new Set;this.ur=this.i.sub("*lazyPlugins",e=>{this.co(e??[]);});}co(i){for(let r of this.Ne)r();if(this.Ne.clear(),i.length===0)return;let t=new Set([T("plugins")]);for(let r of i)for(let o of r.configDeps)t.add(T(o));let e=()=>this.pr(i);for(let r of t)this.Ne.add(this.i.sub(r,e,false));this.pr(i);}pr(i){this.ai?.abort();let t=new AbortController;this.ai=t;let e=n=>this.i.read(T(n)),r=e("plugins"),o=ko({entries:i.map(n=>({isEnabled:()=>n.isEnabled(e),load:n.load})),signal:t.signal}).then(n=>{if(!t.signal.aborted)return [...r,...n]});this.uo(o);}destroy(){this.ur();for(let i of this.Ne)i();this.Ne.clear(),this.ai?.abort();}};var Ue=class{constructor(){this.ce=new Map;}register(i,t){if(this.ce.has(t.name)){console.warn(`[CustomConfig] Config option "${t.name}" is already registered`);return}let e={attribute:true,...t,pluginId:i};this.ce.set(t.name,e);}unregister(i){this.ce.delete(i);}unregisterByPlugin(i){for(let[t,e]of this.ce)e.pluginId===i&&this.ce.delete(t);}get(i){return this.ce.get(i)}getAll(){return new Map(this.ce)}};var Ne=class{constructor(){this.gt=[];this.yt=[];this.vt=[];this.bt=[];this.Tt=[];this.Ct=[];this.config=new Ue;}ke(i,t){return {...t,pluginId:i}}addSource(i,t){return this.gt.push(this.ke(i,t)),t}addActivity(i,t){return this.yt.push(this.ke(i,t)),t}addFileAction(i,t){return this.vt.push(this.ke(i,t)),t}addFileHook(i,t){return this.bt.push(this.ke(i,t)),t}addIcon(i,t){return this.Tt.push(this.ke(i,t)),t}addI18n(i,t){return this.Ct.push(this.ke(i,t)),t}addConfig(i,t){this.config.register(i,t);}purge(i){this.gt=this.gt.filter(t=>t.pluginId!==i),this.yt=this.yt.filter(t=>t.pluginId!==i),this.vt=this.vt.filter(t=>t.pluginId!==i),this.bt=this.bt.filter(t=>t.pluginId!==i),this.Tt=this.Tt.filter(t=>t.pluginId!==i),this.Ct=this.Ct.filter(t=>t.pluginId!==i),this.config.unregisterByPlugin(i);}snapshot(){return {sources:[...this.gt],activities:[...this.yt],fileActions:[...this.vt],fileHooks:[...this.bt],icons:[...this.Tt],i18n:[...this.Ct]}}};var _e=class extends D{constructor(t){super(t);this.ue=new Map;this.w=new Set;this.li=Promise.resolve();this.registry=new Ne;this.dr=new $e(this.i,e=>{this.li=this.li.then(()=>e).then(r=>{if(r)return this.po(r)});});}get configRegistry(){return this.registry.config}pluginsReady(){return this.li}onPluginsChange(t){return this.w.add(t),()=>{this.w.delete(t);}}async po(t){let e=new Set(this.ue.keys()),r=new Set;for(let o of t){if(r.has(o.id)){this.b(`Plugin "${o.id}" is already in the list, skipping duplicate`);continue}if(r.add(o.id),!this.ue.has(o.id))try{await this.ho(o);}catch(n){this.registry.purge(o.id),this.ci(),this.b(`Plugin "${o.id}" setup failed`,n);}e.delete(o.id);}for(let o of e)this.ui(o);}async ho(t){this.ue.has(t.id)&&this.ui(t.id);let e=[],r=Ur(this.registry,this.i,this.n,t.id,e),o=this.n.api,n;try{n=await t.setup({pluginApi:r,uploaderApi:o})??void 0;}catch(a){for(let l of e)try{l();}catch(c){this.b("Failed to unsubscribe config listener",c);}throw a}this.ue.set(t.id,{plugin:t,dispose:n,configSubscriptions:e}),this.ci();}ui(t){let e=this.ue.get(t);if(e){this.registry.purge(t);for(let r of e.configSubscriptions)try{r();}catch(o){this.b("Failed to unsubscribe config listener",o);}e.dispose?.(),this.ue.delete(t),this.ci();}}snapshot(){return this.registry.snapshot()}async runOnAddHooks(t){let e=t.getValue("file");if(!e)return;let r=this.registry.snapshot().fileHooks.filter(n=>n.type==="onAdd");if(r.length===0)return;let o=e;for(let n of r)try{({file:o}=await n.handler({file:o}));}catch(a){this.b(`File hook "onAdd" from plugin "${n.pluginId}" failed`,a);}o!==e&&(t.setValue("file",o),t.setValue("fileSize",o.size),t.setValue("mimeType",o.type||null),t.setValue("isImage",$r(o)),o instanceof File&&t.setValue("fileName",o.name));}destroy(){for(let t of Array.from(this.ue.keys()))this.ui(t);this.dr.destroy(),super.destroy();}ci(){for(let t of this.w)try{t();}catch{}}};function Oo(s){return s.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`).replace(/__/g,"_")}function Oi(s){return Array.isArray(s)?s.map(i=>typeof i=="object"&&i!==null?Oi(i):i):typeof s!="object"||s===null?s:Object.fromEntries(Object.entries(s).map(([i,t])=>{let e=Oo(i);return typeof t=="object"&&t!==null?[e,Oi(t)]:[e,t]}))}function Ao(s){return {ok:true,value:s}}function ki(s){return {ok:false,error:s}}var Po="https://tlm.uploadcare.com/api/",Ai=class{constructor(i=Po){this.baseUrl=i;}async base(i,t={}){let e=`${this.baseUrl}${i}`;try{let r=await fetch(e,t);if(!r.ok)return ki(new Error(`Got non-200 response from "${e}". Status: ${r.status.toString()}`));try{let o=await r.json();return Ao(o)}catch(o){return ki(new Error(`Error parsing JSON from "${e}". Error: ${o}`))}}catch(r){return ki(new Error(`Error fetching data from "${e}". Error: ${r}`))}}async post(i,t,e={}){return await this.base(i,{...e,method:"POST",body:JSON.stringify(Oi(t)),headers:{"Content-Type":"application/json",...e.headers||{}}})}async get(i,t={}){return await this.base(i,{method:"GET",...t})}},Ro=async(s,i)=>({success:true,data:i}),Mo=async s=>Ro(void 0,s),De=class extends Ai{constructor(){super();}async sendEvent(i,t){let e=await Mo(i);if(!e.success)throw console.error("TelemetryAPIService: events: body is invalid",e.error),new Error("TelemetryAPIService: events: body is invalid");return this.post("v1/events",i,t)}};var Lo=20,st=Object.freeze({INIT_SOLUTION:"init-solution",CHANGE_CONFIG:"change-config",ACTION_EVENT:"action-event",ERROR_EVENT:"error-event"}),ot=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),Fe=class extends D{constructor(){super(...arguments);this.$e=new Map;this.wt=new Set;this.S=new Map;}bindTarget(t){return this.wt.add(t),()=>{this.wt.delete(t);}}on(t,e){let r=this.S.get(t);return r||(r=new Set,this.S.set(t,r)),r.add(e),()=>this.S.get(t)?.delete(e)}hr(t,e){for(let o of this.wt)o.dispatchEvent(new CustomEvent(t,{detail:e}));let r=this.S.get(t);if(r)for(let o of r)o(e);this.b?.(()=>{let o=e&&typeof e=="object"?{...e}:e;return [`event "${t}"`,o]});}emit(t,e,r={}){let{debounce:o}=r;if(typeof o!="number"&&!o){this.hr(t,typeof e=="function"?e():e);return}this.$e.has(t)&&window.clearTimeout(this.$e.get(t));let n=typeof o=="number"?o:Lo,a=window.setTimeout(()=>{try{let l=typeof e=="function"?e():e;this.hr(t,l),this.$e.delete(t);}catch(l){this.b?.(()=>`Error while getting payload for event "${t}"`,l);}},n);this.$e.set(t,a);}destroy(){for(let t of this.$e.values())window.clearTimeout(t);this.wt.clear(),this.S.clear();}};var Nr="1.28.0-alpha.666";var Lt="blocks",It=Nr;var ut=class s{static generateFastUid(){return `uid-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}static generateRandomUUID(){let i=globalThis.crypto;return i&&typeof i.randomUUID=="function"?i.randomUUID():s.generateFastUid()}};var Ke=class extends D{constructor(t){super(t);this.fo=ut.generateRandomUUID();this.Ae=structuredClone(R);this.pi=false;this.di=null;this.hi=false;this.fr=new De,this.mr=new Ee(10),this.addSub(this.i.sub(T("qualityInsights"),e=>{this.hi=!!e;}));for(let e of Object.keys(this.Ae))this.addSub(this.i.sub(T(e),r=>{this.hi&&(this.pi&&this.Ae[e]!==r&&this.sendEvent({eventType:st.CHANGE_CONFIG}),this.mo(e,r));}));}go(t){t===st.INIT_SOLUTION&&!this.pi&&(this.pi=true);}mo(t,e){this.Ae[t]!==e&&(this.Ae[t]=e);}yo(t){let e=t.payload?{...t.payload}:{};e.activity&&(e.activity=void 0);let r={...t};return (t.eventType===st.INIT_SOLUTION||t.eventType===st.CHANGE_CONFIG)&&(r.config=this.Ae),{...r,appVersion:It,appName:Lt,sessionId:this.fo,component:this.vo,activity:this.bo,projectPubkey:this.Ae.pubkey,userAgent:navigator.userAgent,eventType:r.eventType??"",eventTimestamp:this.To,payload:{location:this.Co,...e}}}wo(t){return !!(t&&[ot.CHANGE,ot.COMMON_UPLOAD_PROGRESS,ot.FILE_ADDED,ot.FILE_REMOVED,ot.FILE_UPLOAD_START,ot.FILE_UPLOAD_PROGRESS,ot.FILE_UPLOAD_SUCCESS,ot.FILE_UPLOAD_FAILED].includes(t))}sendEvent(t){if(!this.hi)return;let e=this.yo({eventType:t.eventType,payload:t.payload,config:t.config});this.go(t.eventType),!(this.wo(t.eventType)||this.di&&this.gr(this.di,e))&&this.mr.add(async()=>{this.di=e,await this.fr.sendEvent(e);});}sendEventError(t,e="unknown"){this.sendEvent({eventType:st.ERROR_EVENT,payload:{metadata:{event:"error",text:`Error in ${e}`,error:t.message}}});}sendEventCloudImageEditor(t,e,r={}){this.sendEvent({eventType:st.ACTION_EVENT,payload:{metadata:{tabId:e,node:t.currentTarget?.tagName,event:t.type,...r}}});}gr(t,e){if(JSON.stringify(t)===JSON.stringify(e))return true;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return false;let r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return false;for(let n of r)if(!Object.hasOwn(e,n)||!this.gr(t[n],e[n]))return false;return true}get To(){return Date.now()}get vo(){if(!this.i.has("*solution"))return null;let t=this.i.read("*solution");return t?t.toLowerCase():null}get bo(){return this.i.has("*currentActivity")?this.i.read("*currentActivity"):null}get Co(){return location.origin}};var G=[],dt=0,Ve=4,_r=s=>{let i=[],t={get(){return t.lc||t.listen(()=>{})(),t.value},lc:0,listen(e){return t.lc=i.push(e),()=>{for(let o=dt+Ve;o<G.length;)G[o]===e?G.splice(o,Ve):o+=Ve;let r=i.indexOf(e);~r&&(i.splice(r,1),--t.lc||t.off());}},notify(e,r){let o=!G.length;for(let n of i)G.push(n,t.value,e,r);if(o){for(dt=0;dt<G.length;dt+=Ve)G[dt](G[dt+1],G[dt+2],G[dt+3]);G.length=0;}},off(){},set(e){let r=t.value;r!==e&&(t.value=e,t.notify(r));},subscribe(e){let r=t.listen(e);return e(t.value),r},value:s};return t};function ze(s,i,t){let e=new Set(i).add(void 0);return s.listen((r,o,n)=>{e.has(n)&&t(r,o,n);})}function Pi(s,i,t){let e=ze(s,i,t);return t(s.value),e}var Ri=(s={})=>{let i=_r(s);return i.setKey=function(t,e){let r=i.value;typeof e>"u"&&t in i.value?(i.value={...i.value},delete i.value[t],i.notify(r,t)):i.value[t]!==e&&(i.value={...i.value,[t]:e},i.notify(r,t));},i};var Ot=class s{static{this._e=new Map;}constructor(i,t){this.yr=i,this.X=t;}get id(){return this.yr}pub(i,t){i in this.X.get()||console.warn(`PubSub#pub: Key "${String(i)}" not found`),this.X.setKey(i,t);}sub(i,t,e=true){return (e?Pi:ze)(this.X,[i],o=>{t(o[i]);})}read(i){return i in this.X.get()||console.warn(`PubSub#read: Key "${String(i)}" not found`),this.X.get()[i]}add(i,t,e=false){(!(i in this.X.get())||e)&&this.X.setKey(i,t);}has(i){return i in this.X.get()}get store(){return this.X.get()}static registerCtx(i,t){if(s._e.has(t))throw new Error(`PubSub: Context with id "${t}" already exists`);let e=Ri(i);return s._e.set(t,e),new s(t,e)}static deleteCtx(i){s._e.delete(i);}static getCtx(i){let t=s._e.get(i);return t?new s(i,t):null}static hasCtx(i){return s._e.has(i)}};var Dr=s=>{let i=new Intl.Locale(s),t="ltr",e=i.getTextInfo?.().direction;return e?t=e:i.textInfo?.direction&&(t=i.textInfo.direction),t};var Uo=s=>s;var Fr="plural:";function je(s,i={},t={}){let{openToken:e="{{",closeToken:r="}}",transform:o=Uo}=t;for(let n in i){let a=i[n],l=a?.toString(),c=typeof l=="string"?o(l):String(l);s=s.replaceAll(e+n+r,c);}return s}function Kr(s){let i=[],t=s.indexOf("{{");for(;t!==-1;){let e=s.indexOf("}}",t);if(e===-1)break;let r=s.substring(t+2,e);if(r.startsWith(Fr)){let o=s.substring(t+2,e).replace(Fr,""),n=o.substring(0,o.indexOf("(")),a=o.substring(o.indexOf("(")+1,o.indexOf(")"));i.push({variable:r,pluralKey:n,countVariable:a});}t=s.indexOf("{{",e);}return i}function U(s,i){let t,e=((...r)=>{t&&clearTimeout(t),t=setTimeout(()=>s(...r),i);});return e.cancel=()=>{t&&clearTimeout(t);},e}var Vr="--uploadcare-blocks-window-height",ie=class s{static{this.clientsRegistry=new Set;}static{this.flush=U(()=>{document.documentElement.style.setProperty(Vr,`${window.innerHeight}px`);},100);}static registerClient(i){s.clientsRegistry.size===0&&s.attachTracker(),s.clientsRegistry.add(i);}static unregisterClient(i){s.clientsRegistry.delete(i),s.clientsRegistry.size===0&&s.detachTracker();}static attachTracker(){window.addEventListener("resize",s.flush,{passive:true,capture:true}),s.flush();}static detachTracker(){window.removeEventListener("resize",s.flush,{capture:true}),document.documentElement.style.removeProperty(Vr);}};var No=/\\([0-9a-fA-F]{1,6} ?)/g;function _o(s){return s.length<2?false:(s[0]==='"'||s[0]==="'")&&(s[s.length-1]==='"'||s[s.length-1]==="'")}function Do(s){let i=s;return (i[0]==='"'||i[0]==="'")&&(i=i.slice(1)),(i[i.length-1]==='"'||i[i.length-1]==="'")&&(i=i.slice(0,-1)),i}function Fo(s){let i="",t="";for(let e=0;e<s.length;e++){let r=s[e+1];s[e]==="\\"&&r==='"'?(i+='\\"',e++):s[e]==='"'&&t!=="\\"?i+='\\"':i+=s[e],t=s[e]??"";}return i}function zr(s){let i=s;_o(s)&&(i=Do(i),i=i.replace(No,(t,e)=>String.fromCodePoint(parseInt(e.trim(),16))),i=i.replaceAll(`\\ `,"\\n"),i=Fo(i),i='"'+i+'"');try{return JSON.parse(i)}catch{return}}function jr(s){class i extends s{constructor(){super(...arguments);this.vr=null;this.fi=null;}getCssData(r,o=false){let n=this.vr??Object.create(null);if(!Object.keys(n).includes(r)||!n[r]){this.fi||(this.fi=window.getComputedStyle(this));let a=this.fi.getPropertyValue(r).trim();try{n[r]=zr(a);}catch(l){o||console.warn(`CSS Data error: ${r}`,l),n[r]=null;}}return this.vr=n,n[r]}}return i}function Hr(s){class i extends s{constructor(){super(...arguments);this.willYield=true;this.pe={};this.de=null;this.xt=false;}createRenderRoot(){return this}connectedCallback(){this.de||(this.de=Array.from(this.childNodes)),super.connectedCallback();}xo(){if(this.xt)return;this.xt=true,this.pe={};let r=Array.from(this.childNodes),o=r.length?r:this.de??[];for(let n of o){let a=this.br(n),l=this.pe[a]??[];n instanceof Element&&(n.removeAttribute("slot"),n.removeAttribute("content-for")),l.push(n),this.pe[a]=l;}this.de=null;}br(r){return r instanceof Comment&&r.nextSibling instanceof Element?this.br(r.nextSibling):"contentFor"in r?r.contentFor||"":r instanceof Element&&r.hasAttribute("content-for")&&r.getAttribute("content-for")||""}Eo(r){return !r.textContent||!r.textContent.trim()}So(r){let o=this.pe[r];return !o||o.every(n=>n instanceof Comment||n instanceof Text&&this.Eo(n))}update(r){!this.hasUpdated&&this.willYield&&this.xo(),super.update(r);}yield(r,o){if(r===""&&!this.pe[r]&&!this.xt&&this.de?.length){let a=[];for(let l of this.de)l instanceof Element&&(l.removeAttribute("slot"),l.removeAttribute("content-for")),a.push(l);this.pe[r]=a,this.xt=true,this.de=null;}let n=this.pe[r];return m` ${n} ${this.So(r)?o:void 0} `}}return i}var Br=(s,i)=>new Intl.PluralRules(s).select(i);var Ko=s=>(i,t)=>{let e=s(),r=e("locale-id")||"en",o=Br(r,t);return e(`${i}__${o}`)},Gr=s=>{let i=Ko(()=>t),t=(e,r={})=>{if(!e)return "";let n=s().read(rt(e))||e,a=Kr(n);for(let c of a)r[c.variable]=i(c.pluralKey,Number(r[c.countVariable]));return je(n,r)};return t};function qr(s){class i extends s{static reg(e){let r=this,o=window.customElements.get(e);if(o){o!==r&&console.warn([`Element with tag name "${e}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join(` `));return}window.customElements.define(e,r);}}return i}var pt=class extends Event{constructor(i,t,e,r){super("context-request",{bubbles:true,composed:true}),this.context=i,this.contextTarget=t,this.callback=e,this.subscribe=r??false;}};var $t=class{constructor(i,t,e,r){if(this.subscribe=false,this.provided=false,this.value=void 0,this.t=(o,n)=>{this.unsubscribe&&(this.unsubscribe!==n&&(this.provided=false,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=true,this.callback&&this.callback(o,n)),this.unsubscribe=n;},this.host=i,t.context!==void 0){let o=t;this.context=o.context,this.callback=o.callback,this.subscribe=o.subscribe??false;}else this.context=t,this.callback=e,this.subscribe=r??false;this.host.addController(this);}hostConnected(){this.dispatchRequest();}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0);}dispatchRequest(){this.host.dispatchEvent(new pt(this.context,this.host,this.t,this.subscribe));}};var He=class{get value(){return this.o}set value(i){this.setValue(i);}setValue(i,t=false){let e=t||!Object.is(i,this.o);this.o=i,e&&this.updateObservers();}constructor(i){this.subscriptions=new Map,this.updateObservers=()=>{for(let[t,{disposer:e}]of this.subscriptions)t(this.o,e);},i!==void 0&&(this.value=i);}addCallback(i,t,e){if(!e)return void i(this.value);this.subscriptions.has(i)||this.subscriptions.set(i,{disposer:()=>{this.subscriptions.delete(i);},consumerHost:t});let{disposer:r}=this.subscriptions.get(i);i(this.value,r);}clearCallbacks(){this.subscriptions.clear();}};var Mi=class extends Event{constructor(i,t){super("context-provider",{bubbles:true,composed:true}),this.context=i,this.contextTarget=t;}},Ut=class extends He{constructor(i,t,e){super(t.context!==void 0?t.initialValue:e),this.onContextRequest=r=>{if(r.context!==this.context)return;let o=r.contextTarget??r.composedPath()[0];o!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,o,r.subscribe));},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;let o=new Set;for(let[n,{consumerHost:a}]of this.subscriptions)o.has(n)||(o.add(n),a.dispatchEvent(new pt(this.context,a,n,true)));r.stopPropagation();},this.host=i,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),this.host.addController?.(this);}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest);}hostConnected(){this.host.dispatchEvent(new Mi(this.context,this.host));}};var Wr="ctx-name-context";function Xr(){return function(s){class i extends s{constructor(...r){super(...r);this._=null;this.De=false;this.mi=false;this.gi=void 0;this.Pe=new Map;this.Fe=new Set;this.init$={};this.ctxOwner=false;this.Et=void 0;this.St=false;this.ctxName=this.Q;this.J=false;this.Et=this.getAttribute("ctx-name")||void 0,this.ctxName=this.Q,this.ko=new $t(this,{context:Wr,callback:o=>{if(!o){console.error("SymbioteMixin: Received invalid ctx-name from context");return}this.wr=o,this.Cr();},subscribe:true});}static set template(r){console.error("Caution: static 'template' property is deprecated and has no effect. See https://github.com/uploadcare/file-uploader/releases/tag/v1.25.0 for details.");}get Tr(){return this.Et}set Tr(r){let o=r??void 0;this.Et!==o&&(this.Et=o,this.Cr());}shouldUpdate(r){return this.J?super.shouldUpdate(r):false}get Q(){return this.Tr||this.wr||void 0}Cr(){if(this.ctxName=this.Q,!(!this.ctxName||this.De)){if(this.isConnected){this.yi();return}this.St=true;}}willUpdate(r){super.willUpdate(r),this.ctxName=this.Q,this.ctxName&&(this.gi?this.gi.setValue(this.ctxName):this.gi=new Ut(this,{context:Wr,initialValue:this.ctxName}));}xr(){if(!(!this._||this.Pe.size===0)){for(let[r,{value:o,rewrite:n}]of this.Pe)this._.add(r,o,n);this.Pe.clear();}}Er(){return !this._&&this.Q&&this.vi(),this._&&this.xr(),this._}kt(){let r=this.Er();if(!r)throw new Error("SymbioteMixin: Shared context is not initialized.");return r}vi(){let r=this.init$,o=this.Q;if(!o){console.error("SymbioteMixin: ctx-name is required for components with shared properties (*)");return}if(!this._){this._=Ot.getCtx(o)??Ot.registerCtx(r,o);for(let[n,a]of Object.entries(this.init$))this._.add(n,a,this.ctxOwner);this.xr();}}get $(){return this.Q&&this.vi(),new Proxy({},{get:(r,o)=>{if(typeof o=="string")return this._?.read(o)},set:(r,o,n)=>(typeof o!="string"||this._?.pub(o,n),true)})}sub(r,o,n=true){let a=this.kt().sub(r,o,n);if(!a||typeof a!="function")return ()=>{};let l=a.bind(a),c=false,d=()=>{c||(c=true,l(),this.Fe.delete(d));};return this.Fe.add(d),d}pub(r,o){this.kt().pub(r,o);}set$(r){for(let[o,n]of Object.entries(r))this.pub(o,n);}get sharedCtx(){return this.kt()}has(r){return this._?.has(r)??false}add(r,o,n=false){let a=this.Er();if(!a){if(!n&&this.Pe.has(r))return;this.Pe.set(r,{value:o,rewrite:n});return}this.Pe.delete(r),a.add(r,o,n);}add$(r,o=false){for(let[n,a]of Object.entries(r))this.add(n,a,o);}connectedCallback(){super.connectedCallback(),this.De?this.J&&this.mi&&(this.mi=false,this.initCallback()):this.ctxName?(this.St=false,this.yi()):this.St&&this.Q&&(this.St=false,this.yi());}yi(){if(this.De)return;this.De=true,this.vi();let r=this.init$;if(Object.keys(r).length>0){let o=this.kt();for(let[n,a]of Object.entries(r))o.read(n)===void 0&&o.pub(n,a),this.sub(n,U(async()=>{this.isConnected&&(await this.updateComplete,this.requestUpdate());},0),false);}this.initCallback(),this.J=true,this.requestUpdate();}firstUpdated(r){super.firstUpdated(r);}disconnectedCallback(){this.Ao(),super.disconnectedCallback(),this.De&&(this.mi=true);}Ao(){if(this.Fe.size!==0){for(let r of [...this.Fe])r();this.Fe.clear();}}initCallback(){}}return p([y({type:String,attribute:"ctx-name",noAccessor:true})],i.prototype,"Tr",1),p([g()],i.prototype,"wr",2),p([g()],i.prototype,"ctxName",2),p([g()],i.prototype,"J",2),i}}var zo=s=>s.tagName?.includes("-")??false,Be=class{constructor(i){this.he=new Set;this.At=new Map;this.Sr=false;this.fe=i,this.fe.addController(this);}hostDisconnected(){this.Pt?.(),this.Pt=void 0,this.he.clear(),this.At.clear();}hostUpdated(){if(!this.Pt&&this.fe.has(T("testMode"))){let i=this.fe.subConfigValue("testMode",t=>{this.Sr=!!t,this.kr();});this.Pt=i;}this.Po(),this.kr();}Po(){let i=this.fe,t=i.renderRoot??i;if(!t)return;let e=this.fe,r=e.tagName?.toLowerCase(),o=Array.from(t.querySelectorAll("[data-testid]")).filter(n=>!zo(n));for(let n of o)if(!(r&&n.closest(r)!==e)&&!this.he.has(n)){let a=n.getAttribute("data-testid");if(!a)continue;this.he.add(n),this.At.set(n,a);}for(let n of Array.from(this.he))(!n.isConnected||r&&n.closest(r)!==e)&&(this.he.delete(n),this.At.delete(n));}kr(){if(!this.he.size)return;let i=this.fe.testId||"";for(let t of this.he){let e=this.At.get(t);e&&(this.Sr?t.setAttribute("data-testid",`${i}--${e}`):t.removeAttribute("data-testid"));}}};var jo=qr(Xr()(jr(Hr(at)))),C=class extends jo{constructor(){super();this.init$=pr();this.l10n=Gr(()=>this.sharedCtx);this.debugPrint=Pe(()=>this.sharedCtx,this.constructor.name);this.n=xr(()=>this.sharedCtx);new Be(this);}static{this.styleAttrs=[];}emit(t,e,r){let o=this.has("*eventEmitter")?this.$["*eventEmitter"]:void 0;if(!o)return;o.emit(t,e,r);let n=typeof e=="function"?e():e;this.telemetryManager.sendEvent({eventType:t,payload:n??void 0});}hasBlockInCtx(t){for(let e of this.blocksRegistry)if(t(e))return true;return false}connectedCallback(){this.constructor.styleAttrs.forEach(e=>{this.setAttribute(e,"");}),super.connectedCallback(),ie.registerClient(this);}initCallback(){this.ee("*blocksRegistry",()=>new Set),this.ee("*pluginManager",t=>new _e(t)),this.ee("*eventEmitter",t=>new Fe(t)),this.ee("*localeManager",t=>new Le(t)),this.ee("*modalManager",t=>new Ie(t)),this.ee("*a11y",()=>new Me),this.ee("*clipboard",t=>new Re(t)),this.ee("*telemetryManager",t=>new Ke(t)),this.sub(rt("locale-id"),t=>{let e=Dr(t);this.style.direction=e==="ltr"?"":e,this.requestUpdate();}),this.subConfigValue("testMode",t=>{if(!t||!this.testId){this.removeAttribute("data-testid");return}this.setAttribute("data-testid",this.testId);}),this.blocksRegistry.add(this);}get testId(){return window.customElements.getName(this.constructor)}get modalManager(){return this.me("*modalManager",false)}get telemetryManager(){return this.me("*telemetryManager")}get localeManager(){return this.me("*localeManager")}get a11y(){return this.me("*a11y")}get clipboardLayer(){return this.me("*clipboard")}get blocksRegistry(){return this.me("*blocksRegistry")}get eventEmitter(){return this.me("*eventEmitter")}disconnectedCallback(){super.disconnectedCallback(),ie.unregisterClient(this);let t=this.blocksRegistry;t?.delete(this),t?.size===0&&setTimeout(()=>{this.isConnected||t?.size>0||this.destroyCtxCallback();},0);}destroyCtxCallback(){this.Oo(),Ot.deleteCtx(this.ctxName);}Ar(){let t="*sharedContextInstances";if(!this.has(t)||!this.$[t]){let e=new Map;this.add(t,e,true);}return this.$[t]}ee(t,e){let r=this.Ar();if(!r.has(t)&&(!this.has(t)||!this.$[t])){let o=e(this.n);this.add(t,o,true),r.set(t,o);return}}Oo(){let t=this.Ar();for(let[e,r]of t.entries())r?.destroy?.(),this.pub(e,null);t.clear();}me(t,e=true){if(this.has(t)&&this.$[t])return this.$[t];if(!e)return this.$[t];throw new Error(`Unexpected error: context manager for key "${String(t)}" is not available`)}async proxyUrl(t){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(t,{uuid:Oe(t),cdnUrlModifiers:yi(t),fileName:ke(t)})}catch(e){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",e),this.telemetryManager.sendEventError(e,"secureDeliveryProxyUrlResolver. Failed to resolve secure delivery proxy URL. Falling back to the default URL."),t}return this.cfg.secureDeliveryProxy?je(this.cfg.secureDeliveryProxy,{previewUrl:t},{transform:e=>window.encodeURIComponent(e)}):t}get cfg(){if(!this.ae){let t={};this.ae=new Proxy(t,{set:(e,r,o)=>{if(typeof r!="string"||!(r in R))return false;let n=r,a=T(n);return this.has(a)||this.add(a,R[n]),this.$[a]=o,true},get:(e,r)=>{let o=T(r);return this.has(o)||this.add(o,R[r]),this.$[o]}});}return this.ae}subConfigValue(t,e){let r=T(t);return this.has(r)||this.add(r,R[t]),this.sub(r,e)}};var ht="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function Yr(...s){return s.reduce((i,t)=>{if(typeof t=="string")return i[t]=true,i;for(let e of Object.keys(t))i[e]=t[e];return i},{})}function K(...s){let i=Yr(...s);return Object.keys(i).reduce((t,e)=>(i[e]&&t.push(e),t),[]).join(" ")}function Zr(s,...i){let t=Yr(...i);for(let e of Object.keys(t))s.classList.toggle(e,!!t[e]);}var re=["free"],Qr=s=>{let i=Qt(s);if(!i||i.length===0)return [];let t=[];for(let e of i){let r=e.trim();if(!r)continue;let o=r.indexOf(":");if(o===-1&&!re.includes(r)){console.warn(`Invalid crop preset: ${r}`);continue}let n=Number(r.slice(0,o)),a=Number(r.slice(o+1));if((!Number.isFinite(n)||!Number.isFinite(a)||n<=0||a<=0)&&!re.includes(r)){console.warn(`Invalid crop preset: ${r}`);continue}t.push({id:ut.generateFastUid(),type:"aspect-ratio",width:re.includes(r)?0:n,height:re.includes(r)?0:a,hasFreeform:re.includes(r)});}return t},Jr=(s,i,t,e=.1)=>{let r=s/i,o=null,n=1/0;for(let a of t){let[l,c]=[a.width,a.height],d=l/c,u=Math.abs(r-d);u<n&&(n=u,o=a);}if(o){let[a,l]=[o.width,o.height],c=a/l;if(Math.abs(r-c)/c>e)return null}return o};var Ho=s=>$.includes(s),ts=s=>{if(!s)return $;let i=St(s).filter(Ho);return i.length===0?$:i};function es(s){return {"*originalUrl":null,"*loadingOperations":new Map,"*faderEl":null,"*cropperEl":null,"*imgEl":null,"*imgContainerEl":null,"*networkProblems":false,"*imageSize":null,"*editorTransformations":{},"*cropPresetList":[],"*currentAspectRatio":null,"*tabList":$,"*tabId":O.CROP,"*on.retryNetwork":()=>{let i=s.querySelectorAll("img");for(let t of i){let e=t.src;t.src=ht,t.src=e;}s.$["*networkProblems"]=false;},"*on.apply":i=>{if(!i)return;let t=s.$["*originalUrl"];if(!t){console.warn("Original URL is null, cannot apply transformations");return}let e=J(ct(i),"preview"),r=tt(t,e),o={originalUrl:t,cdnUrlModifiers:e,cdnUrl:r,transformations:i};s.dispatchEvent(new CustomEvent("apply",{detail:o,bubbles:true,composed:true})),s.remove();},"*on.cancel":()=>{s.remove(),s.dispatchEvent(new CustomEvent("cancel",{bubbles:true,composed:true}));}}}var is="<svg width='0' height='0' style='position:absolute'><symbol fill='none' viewBox='0 0 9 6' id='uc-icon-arrow-dropdown' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='m1.5 1.667 3 2.666 3-2.666' opacity='.5'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-aspect-ratio' xmlns='http://www.w3.org/2000/svg'/><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='ruc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#ruc-icon-id__a)'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#uuc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#uuc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#uuc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#uuc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#uuc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#uuc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#uuc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#uuc-icon-id__h)'/><defs><linearGradient id='uuc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='uuc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>";var At={transition:"uc-transition",visible:"uc-visible",hidden:"uc-hidden"},se=class extends C{constructor(){super(...arguments);this.Oe=false;this.Pr=At;this.Or=At.visible;this.Rr=At.hidden;this.bi=false;this.Mr=false;}set visible(t){this.Oe=t,this.Ir();}get visible(){return this.Oe}set styles(t){this.Pr=t,this.bi=true,this.Or=t.visible??At.visible,this.Rr=t.hidden??At.hidden;}get styles(){return this.Pr}Ir(){this.style.visibility=this.Oe?"inherit":"hidden",Zr(this,{[At.transition]:!this.bi,[this.Or]:this.Oe,[this.Rr]:!this.Oe}),this.toggleAttribute("inert",!this.Oe);}Ro(){this.Mr||(this.Mr=true,this.dispatchEvent(new CustomEvent("initial-render",{bubbles:true,composed:true})));}initCallback(){super.initCallback(),this.classList.toggle("uc-initial",true),this.bi||this.classList.add(At.transition),this.Ir(),setTimeout(()=>{this.classList.toggle("uc-initial",false),this.Ro();},0);}};p([y({type:Boolean})],se.prototype,"visible",1),p([y({attribute:false})],se.prototype,"styles",1);var Ge=class extends C{constructor(){super(...arguments);this.active=false;this.Ot=E();this.Ti=false;this.Ci=()=>{let t=this.Ot.value;t&&(this.Lr(t),this.Ti&&this.active&&this.wi());};}firstUpdated(t){super.firstUpdated(t),this.active&&this.wi();}updated(t){super.updated(t),t.has("active")&&(this.active?this.wi():this.Mo());}wi(){let t=this.Ot.value;if(!t)return;this.Ti=true;let{width:e}=this.getBoundingClientRect();t.removeEventListener("transitionend",this.Ci),t.style.transition="transform 1s",t.style.opacity="1",t.style.transform=`translateX(${e}px)`,t.addEventListener("transitionend",this.Ci,{once:true});}Mo(){let t=this.Ot.value;t&&(this.Ti=false,t.removeEventListener("transitionend",this.Ci),this.Lr(t));}Lr(t){t.style.transition="initial",t.style.opacity="0",t.style.transform="translateX(-101%)";}render(){return m`<div class="uc-inner"><div class="uc-line" ${k(this.Ot)}></div></div>`}};p([y({type:Boolean,reflect:true})],Ge.prototype,"active",2);var ft=j(class extends W{constructor(s){if(super(s),s.type!==lt.ATTRIBUTE||s.name!=="class"||s.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return " "+Object.keys(s).filter(i=>s[i]).join(" ")+" "}update(s,[i]){if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(e=>e!=="")));for(let e in i)i[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(i)}let t=s.element.classList;for(let e of this.st)e in i||(t.remove(e),this.st.delete(e));for(let e in i){let r=!!i[e];r===this.st.has(e)||this.nt?.has(e)||(r?(t.add(e),this.st.add(e)):(t.remove(e),this.st.delete(e)));}return F}});var A=s=>s??w;var Nt=class extends C{constructor(){super(...arguments);this.name="";this.Rt="";this.Ke=null;this.Ur=null;}initCallback(){super.initCallback(),this.setAttribute("aria-hidden","true"),this.subConfigValue("iconHrefResolver",e=>{this.Ur=e,this.Ei();});let t=this.n.pluginManager;t?.onPluginsChange&&(this.xi=t.onPluginsChange(()=>this.Ei()));}willUpdate(t){super.willUpdate(t),t.has("name")&&this.Ei();}Ei(){if(!this.name){this.Rt="",this.Ke=null;return}let e=this.n.pluginManager?.snapshot().icons.find(n=>n.name===this.name);if(e){this.Ke=e.svg,this.Rt="";return}this.Ke=null;let r=`#uc-icon-${this.name}`,o=this.Ur?.(this.name);this.Rt=o??r;}render(){return this.Ke?m`${this.yield("",m`${xe(this.Ke)}`)}`:m` ${this.yield("",m`<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use href=${this.Rt}></use></svg>`)} `}disconnectedCallback(){this.xi?.(),this.xi=void 0,super.disconnectedCallback();}};p([y({type:String})],Nt.prototype,"name",2),p([g()],Nt.prototype,"Rt",2),p([g()],Nt.prototype,"Ke",2);var q=class extends C{constructor(){super(...arguments);this.text="";this.icon="";this.reverse=false;this.theme="default";this.ariaRole=void 0;this.ariaControls="";this.titleProp="";this.active=false;}firstUpdated(t){super.firstUpdated(t),this.Nr(),this.$r();}updated(t){super.updated(t),t.has("reverse")&&this.Nr(),t.has("theme")&&this.$r();}Nr(){this.style.flexDirection=this.reverse?"row-reverse":"";}$r(){this.theme&&this.theme!=="custom"&&(this.className=`uc-${this.theme}`);}get Io(){let t=this.Si;return {"uc-icon":true,"uc-icon_left":!this.reverse,"uc-icon_right":this.reverse,"uc-icon_hidden":t,"uc-icon_single":this.Lo}}get Si(){return !this.icon}get Lo(){return !this.text&&!this.Si}render(){return m`<button type="button" role=${A(this.ariaRole||void 0)} aria-controls=${A(this.ariaControls||void 0)} aria-label=${A(this.l10n(this.titleProp))} title=${A(this.l10n(this.titleProp))} ><uc-icon class=${ft(this.Io)} name=${A(this.icon||void 0)} ?hidden=${this.Si} ></uc-icon><div class="uc-text">${this.text}</div></button>`}};p([y({type:String})],q.prototype,"text",2),p([y({type:String})],q.prototype,"icon",2),p([y({type:Boolean,reflect:true})],q.prototype,"reverse",2),p([y({type:String,reflect:true})],q.prototype,"theme",2),p([y({attribute:"aria-role"})],q.prototype,"ariaRole",2),p([y({attribute:"aria-controls"})],q.prototype,"ariaControls",2),p([y({attribute:"title-prop"})],q.prototype,"titleProp",2),p([y({type:Boolean,noAccessor:true})],q.prototype,"active",2);function oe(s){let i=new Image;return {promise:new Promise((r,o)=>{i.src=s,i.onload=()=>r(),i.onerror=n=>o(n);}),image:i,cancel:()=>{i.naturalWidth===0&&(i.src=ht);}}}function ne(s){let i=[];for(let o of s){let n=oe(o);i.push(n);}let t=i.map(o=>o.image);return {promise:Promise.allSettled(i.map(o=>o.promise)),images:t,cancel:()=>{i.forEach(o=>{o.cancel();});}}}var rs=(s,i)=>{let t=false,e,r=0,o=((...n)=>{t?(e&&clearTimeout(e),e=setTimeout(()=>{Date.now()-r>=i&&(s(...n),r=Date.now());},Math.max(i-(Date.now()-r),0))):(s(...n),r=Date.now(),t=true);});return Object.defineProperty(o,"cancel",{configurable:false,writable:false,enumerable:false,value:()=>{e&&clearTimeout(e);}}),o};var ae=33.333333333333336,v=1,Li=24,ss=6;function mt(s,i){for(let[t,e]of Object.entries(i))s.setAttributeNS(null,t,e.toString());}function V(s,i={}){let t=document.createElementNS("http://www.w3.org/2000/svg",s);return mt(t,i),t}function os(s,i,t){let{x:e,y:r,width:o,height:n}=s,a=i.includes("w")?0:1,l=i.includes("n")?0:1,c=a===0?-1:1,d=l===0?-1:1,u=[e+a*o+1.5*c,r+l*n+1.5*d-24*t*d],h=[e+a*o+1.5*c,r+l*n+1.5*d],f=[e+a*o-24*t*c+1.5*c,r+l*n+1.5*d],b=`M ${u[0]} ${u[1]} L ${h[0]} ${h[1]} L ${f[0]} ${f[1]}`,L=[h[0],h[1]];return {d:b,center:L}}function ns(s,i,t){let{x:e,y:r,width:o,height:n}=s,a=i==="n"||i==="s",l=i==="w"||i==="e",c=a?.5:i==="w"?0:1,d=l?.5:i==="n"?0:1,u=i==="w"?-1:i==="e"?1:0,h=i==="n"?-1:i==="s"?1:0,f,b;a?(f=[e+c*o-34*t/2,r+d*n+1.5*h],b=[e+c*o+34*t/2,r+d*n+1.5*h]):(f=[e+c*o+1.5*u,r+d*n-34*t/2],b=[e+c*o+1.5*u,r+d*n+34*t/2]);let L=`M ${f[0]} ${f[1]} L ${b[0]} ${b[1]}`,P=[(f[0]+b[0])/2,(f[1]+b[1])/2];return {d:L,center:P}}function as(s){return s===""?"move":["e","w"].includes(s)?"ew-resize":["n","s"].includes(s)?"ns-resize":["nw","se"].includes(s)?"nwse-resize":"nesw-resize"}function ls({rect:s,delta:[i,t],imageBox:e}){return Dt({...s,x:s.x+i,y:s.y+t},e)}function Dt(s,i){let{x:t}=s,{y:e}=s;return s.x<i.x?t=i.x:s.x+s.width>i.x+i.width&&(t=i.x+i.width-s.width),s.y<i.y?e=i.y:s.y+s.height>i.y+i.height&&(e=i.y+i.height-s.height),{...s,x:t,y:e}}function Bo({rect:s,delta:i,aspectRatio:t,imageBox:e}){let[,r]=i,{y:o,width:n,height:a}=s;o+=r,a-=r,t&&(n=a*t);let l=s.x+s.width/2-n/2;return o<=e.y&&(o=e.y,a=s.y+s.height-o,t&&(n=a*t,l=s.x+s.width/2-n/2)),l<=e.x&&(l=e.x,o=s.y+s.height-a),l+n>=e.x+e.width&&(l=Math.max(e.x,e.x+e.width-n),n=e.x+e.width-l,t&&(a=n/t),o=s.y+s.height-a),a<v&&(a=v,t&&(n=a*t,l=s.x+s.width/2-n/2),o=s.y+s.height-a),n<v&&(n=v,t&&(a=n/t,l=s.x+s.width/2-n/2),o=s.y+s.height-a),{x:l,y:o,width:n,height:a}}function Go({rect:s,delta:i,aspectRatio:t,imageBox:e}){let[r]=i,{x:o,width:n,height:a}=s;o+=r,n-=r,t&&(a=n/t);let l=s.y+s.height/2-a/2;return o<=e.x&&(o=e.x,n=s.x+s.width-o,t&&(a=n/t,l=s.y+s.height/2-a/2)),l<=e.y&&(l=e.y,o=s.x+s.width-n),l+a>=e.y+e.height&&(l=Math.max(e.y,e.y+e.height-a),a=e.y+e.height-l,t&&(n=a*t),o=s.x+s.width-n),a<v&&(a=v,t&&(n=a*t),l=s.y+s.height/2-a/2,o=s.x+s.width-n),n<v&&(n=v,t&&(a=n/t),l=s.y+s.height/2-a/2,o=s.x+s.width-n),{x:o,y:l,width:n,height:a}}function qo({rect:s,delta:i,aspectRatio:t,imageBox:e}){let[,r]=i,{y:o,width:n,height:a}=s;a+=r,t&&(n=a*t);let l=s.x+s.width/2-n/2;return o+a>=e.y+e.height&&(a=e.y+e.height-o,t&&(n=a*t),l=s.x+s.width/2-n/2),l<=e.x&&(l=e.x,o=s.y),l+n>=e.x+e.width&&(l=Math.max(e.x,e.x+e.width-n),n=e.x+e.width-l,t&&(a=n/t),o=s.y),a<v&&(a=v,t&&(n=a*t),l=s.x+s.width/2-n/2),n<v&&(n=v,t&&(a=n/t),l=s.x+s.width/2-n/2),{x:l,y:o,width:n,height:a}}function Wo({rect:s,delta:i,aspectRatio:t,imageBox:e}){let[r]=i,{x:o,width:n,height:a}=s;n+=r,t&&(a=n/t);let l=s.y+s.height/2-a/2;return o+n>=e.x+e.width&&(n=e.x+e.width-o,t&&(a=n/t),l=s.y+s.height/2-a/2),l<=e.y&&(l=e.y,o=s.x),l+a>=e.y+e.height&&(l=Math.max(e.y,e.y+e.height-a),a=e.y+e.height-l,t&&(n=a*t),o=s.x),a<v&&(a=v,t&&(n=a*t),l=s.y+s.height/2-a/2),n<v&&(n=v,t&&(a=n/t),l=s.y+s.height/2-a/2),{x:o,y:l,width:n,height:a}}function Xo({rect:s,delta:i,aspectRatio:t,imageBox:e}){let[r,o]=i,{x:n,y:a,width:l,height:c}=s;return n+r<e.x&&(r=e.x-n),a+o<e.y&&(o=e.y-a),n+=r,l-=r,a+=o,c-=o,t&&Math.abs(l/c)>t?(o=l/t-c,c+=o,a-=o,a<=e.y&&(c=c-(e.y-a),l=c*t,n=s.x+s.width-l,a=e.y)):t&&(r=c*t-l,l=l+r,n-=r,n<=e.x&&(l=l-(e.x-n),c=l/t,n=e.x,a=s.y+s.height-c)),c<v&&(c=v,t&&(l=c*t),n=s.x+s.width-l,a=s.y+s.height-c),l<v&&(l=v,t&&(c=l/t),n=s.x+s.width-l,a=s.y+s.height-c),{x:n,y:a,width:l,height:c}}function Yo({rect:s,delta:i,aspectRatio:t,imageBox:e}){let[r,o]=i,{x:n,y:a,width:l,height:c}=s;return n+l+r>e.x+e.width&&(r=e.x+e.width-n-l),a+o<e.y&&(o=e.y-a),l+=r,a+=o,c-=o,t&&Math.abs(l/c)>t?(o=l/t-c,c+=o,a-=o,a<=e.y&&(c=c-(e.y-a),l=c*t,n=s.x,a=e.y)):t&&(r=c*t-l,l+=r,n+l>=e.x+e.width&&(l=e.x+e.width-n,c=l/t,n=e.x+e.width-l,a=s.y+s.height-c)),c<v&&(c=v,t&&(l=c*t),a=s.y+s.height-c),l<v&&(l=v,t&&(c=l/t),a=s.y+s.height-c),{x:n,y:a,width:l,height:c}}function Zo({rect:s,delta:i,aspectRatio:t,imageBox:e}){let[r,o]=i,{x:n,y:a,width:l,height:c}=s;return n+r<e.x&&(r=e.x-n),a+c+o>e.y+e.height&&(o=e.y+e.height-a-c),n+=r,l-=r,c+=o,t&&Math.abs(l/c)>t?(o=l/t-c,c+=o,a+c>=e.y+e.height&&(c=e.y+e.height-a,l=c*t,n=s.x+s.width-l,a=e.y+e.height-c)):t&&(r=c*t-l,l+=r,n-=r,n<=e.x&&(l=l-(e.x-n),c=l/t,n=e.x,a=s.y)),c<v&&(c=v,t&&(l=c*t),n=s.x+s.width-l),l<v&&(l=v,t&&(c=l/t),n=s.x+s.width-l),{x:n,y:a,width:l,height:c}}function Qo({rect:s,delta:i,aspectRatio:t,imageBox:e}){let[r,o]=i,{x:n,y:a,width:l,height:c}=s;return n+l+r>e.x+e.width&&(r=e.x+e.width-n-l),a+c+o>e.y+e.height&&(o=e.y+e.height-a-c),l+=r,c+=o,t&&Math.abs(l/c)>t?(o=l/t-c,c+=o,a+c>=e.y+e.height&&(c=e.y+e.height-a,l=c*t,n=s.x,a=e.y+e.height-c)):t&&(r=c*t-l,l+=r,n+l>=e.x+e.width&&(l=e.x+e.width-n,c=l/t,n=e.x+e.width-l,a=s.y)),c<v&&(c=v,t&&(l=c*t)),l<v&&(l=v,t&&(c=l/t)),{x:n,y:a,width:l,height:c}}function cs({direction:s,...i}){switch(s){case "n":return Bo(i);case "w":return Go(i);case "s":return qo(i);case "e":return Wo(i);case "nw":return Xo(i);case "ne":return Yo(i);case "sw":return Zo(i);case "se":return Qo(i);default:return i.rect}}function us(s,[i,t]){return s.x<=i&&i<=s.x+s.width&&s.y<=t&&t<=s.y+s.height}function ds(s,i){return s.x>=i.x&&s.y>=i.y&&s.x+s.width<=i.x+i.width&&s.y+s.height<=i.y+i.height}function ps(s,i){return Math.abs(s.width/s.height-i)<.1}function Ft({width:s,height:i},t){let e=t/90%2!==0;return {width:e?i:s,height:e?s:i}}function Kt(s){return {x:Math.round(s.x),y:Math.round(s.y),width:Math.round(s.width),height:Math.round(s.height)}}function gt(s,i,t){return Math.min(Math.max(s,i),t)}function hs(s,i){let t={};for(let e of i){let r=s[e];(Object.hasOwn(s,e)||r!==void 0)&&(t[e]=r);}return t}function Vt(s,i,t){let r=window.devicePixelRatio,o=Math.min(Math.ceil(i*r),3e3),n=r>=2?"lightest":"normal";return tt(s,J(Ae,ct(t),`quality/${n}`,`stretch/off/-/resize/${o}x`,`@clib/${Lt}/${It}/uc-cloud-image-editor/`))}var We=class extends C{constructor(){super(...arguments);this._r=`uc-backdrop-mask-${ut.generateFastUid()}`;this.It=false;this.He=false;this.Kr=E();this.Be=false;this.Ge=null;this.zr=t=>{this.jr(),this.qe&&(t.stopPropagation(),t.preventDefault(),this.qe=false);};this.Hr=t=>{if(!this.qe||!this.Mt||!this.Ai)return;t.stopPropagation(),t.preventDefault();let e=this.te;if(!e)return;let{x:r,y:o}=e.getBoundingClientRect(),n=t.x-r,a=t.y-o,l=n-this.Mt[0],c=a-this.Mt[1],{direction:d}=this.Ai,u=this.zo(d,[l,c]);u&&(this.$["*cropBox"]=u);};this.Br=t=>{if(!this.Z)return;let e=Object.values(this.Z).find(r=>{if(!r||this.Oi(r.direction))return false;let n=r.interactionNode.getBoundingClientRect(),a={x:n.x,y:n.y,width:n.width,height:n.height};return us(a,[t.x,t.y])});this.Dr=e,this.jr();};}get te(){return this.Kr.value??null}get qe(){return this.He}set qe(t){this.He!==t&&(this.He=t,this.Pi());}Pi(){this.ze&&this.ze.setAttribute("class",K({"uc-guides--hidden":this.It,"uc-guides--visible":!this.It&&this.He,"uc-guides--semi-hidden":!this.It&&!this.He}));}Oi(t){let e=this.$["*imageBox"];if(!e)return false;if(t===""&&e.height<=v&&e.width<=v)return true;let r=e.height<=v&&(t.includes("n")||t.includes("s")),o=e.width<=v&&(t.includes("e")||t.includes("w"));return r||o}Uo(){let t=this.$["*cropBox"];if(!t)return;let{x:e,y:r,width:o,height:n}=t,a=this.te;if(!a)return;let l=V("mask",{id:this._r}),c=V("rect",{x:0,y:0,width:"100%",height:"100%",fill:"white"}),d=V("rect",{x:e,y:r,width:o,height:n,fill:"black"});l.appendChild(c),l.appendChild(d);let u=V("rect",{x:0,y:0,width:"100%",height:"100%",fill:"var(--color-image-background)","fill-opacity":.85,mask:`url(#${this._r})`});a.appendChild(u),a.appendChild(l),this.Ve=l,this.ki=d;}No(){this.Ve&&(this.Ve.style.display="none",window.requestAnimationFrame(()=>{this.Ve&&(this.Ve.style.display="block");}));}$o(){let t=this.$["*cropBox"];if(!t)return;let{x:e,y:r,width:o,height:n}=t;this.ki&&mt(this.ki,{x:e,y:r,width:o,height:n});}_o(){let t=this.$["*cropBox"];if(!(!t||!this.ze||!this.Z)){for(let e of Object.values(this.Z)){if(!e)continue;let{direction:r,pathNode:o,interactionNode:n,groupNode:a}=e,l=r==="",c=r.length===2,{x:d,y:u,width:h,height:f}=t;if(l)mt(n,{x:d,y:u,width:h,height:f});else {let L=gt(Math.min(h,f)/82/2,0,1),P=c?os(t,r,L):ns(t,r,L),I=P.center;if(!I)continue;let bt=Math.max(Li*gt(Math.min(h,f)/Li/3,0,1),ss);mt(n,{x:I[0]-bt,y:I[1]-bt,width:bt*2,height:bt*2}),mt(o,{d:P.d});}let b=this.Oi(r);a.setAttribute("class",K("uc-thumb",{"uc-thumb--hidden":b,"uc-thumb--visible":!b}));}mt(this.ze,{x:t.x-1*.5,y:t.y-1*.5,width:t.width+1,height:t.height+1});}}Vr(t,e){let r=V("g");r.classList.add("uc-thumb"),r.setAttribute("with-effects","");let o=V("rect",{fill:"transparent"}),n=V("path",{stroke:"currentColor",fill:"none","stroke-width":3});r.appendChild(n),r.appendChild(o),t[e]={direction:e,pathNode:n,interactionNode:o,groupNode:r},e===""&&(r.style.cursor="move"),o.addEventListener("pointerdown",this.Do.bind(this,e));}Fo(){let t={};for(let e=0;e<3;e++)for(let r=0;r<3;r++){let o=`${["n","","s"][e]}${["w","","e"][r]}`;o!==""&&this.Vr(t,o);}return this.Vr(t,""),t}Ko(){let t=V("svg"),e=V("rect",{x:0,y:0,width:"100%",height:"100%",fill:"none",stroke:"currentColor","stroke-width":1,"stroke-opacity":.5});t.appendChild(e);for(let r=1;r<=2;r++){let o=V("line",{x1:`${ae*r}%`,y1:"0%",x2:`${ae*r}%`,y2:"100%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});t.appendChild(o);}for(let r=1;r<=2;r++){let o=V("line",{x1:"0%",y1:`${ae*r}%`,x2:"100%",y2:`${ae*r}%`,stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});t.appendChild(o);}return t.classList.add("uc-guides","uc-guides--semi-hidden"),t}Vo(){let t=this.te;if(!t)return;let e=document.createDocumentFragment(),r=this.Ko();e.appendChild(r);let o=this.Fo();for(let{groupNode:n}of Object.values(o))e.appendChild(n);t.appendChild(e),this.Z=o,this.ze=r,this.Pi();}Do(t,e){if(!this.Z)return;let r=this.Z[t];if(!r||this.Oi(t))return;let o=this.$["*cropBox"],n=this.te;if(!n)return;let{x:a,y:l}=n.getBoundingClientRect(),c=e.x-a,d=e.y-l;this.qe=true,this.Ai=r,this.Mt=[c,d],this.Fr={...o};}zo(t,e){let[r,o]=e,n=this.$["*imageBox"],a=this.Fr??this.$["*cropBox"],l=this.$["*currentAspectRatio"],c=l?l.width/l.height:void 0;if(t===""?a=ls({rect:a,delta:[r,o],imageBox:n}):a=cs({rect:a,delta:[r,o],direction:t,aspectRatio:c,imageBox:n}),!Object.values(a).every(d=>Number.isFinite(d)&&d>=0)){console.error("CropFrame is trying to create invalid rectangle",{payload:a});return}return Dt(Kt(a),n)}jr(){let t=this.Dr,e=this.te;e&&(e.style.cursor=t?as(t.direction):"initial");}Gr(t){if(this.je){this.je.setAttribute("href",t);return}let e=this.te;if(!e){this.Ge=t;return}this.Ge=null;let r=document.createDocumentFragment(),o=V("image",{href:t});o.setAttribute("class","uc-cloud-mask"),r.appendChild(o),e.appendChild(r),this.je=o;}jo(){let t=this.$["*cropBox"];if(!t||!this.je)return;let{x:e,y:r,width:o,height:n}=t;mt(this.je,{x:e,y:r,height:n,width:o});}Ri(){this.Be&&(this.$o(),this._o(),this.jo());}toggleThumbs(t){if(this.Z)for(let e of Object.values(this.Z)){if(!e)continue;let{groupNode:r}=e;r.setAttribute("class",K("uc-thumb",{"uc-thumb--hidden":!t,"uc-thumb--visible":t}));}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this.No(),this.Be&&window.requestAnimationFrame(()=>{this.Ri();});}),this.sub("*cropBox",t=>{t&&(this.It=t.height<=v||t.width<=v,this.Pi(),this.Be&&window.requestAnimationFrame(()=>{this.Ri();}));}),this.subConfigValue("cloudImageEditorMaskHref",t=>{t&&this.Gr(t);}),document.addEventListener("pointermove",this.Hr,true),document.addEventListener("pointerup",this.zr,true);}firstUpdated(t){super.firstUpdated(t),this.Ho();}Ho(){let t=this.te;if(!(!t||this.Be)){if(this.Uo(),this.Vo(),this.Be=true,t.addEventListener("pointermove",this.Br,true),this.Ge){let e=this.Ge;this.Ge=null,this.Gr(e);}this.Ri();}}disconnectedCallback(){super.disconnectedCallback(),this.te?.removeEventListener("pointermove",this.Br,true),document.removeEventListener("pointermove",this.Hr,true),document.removeEventListener("pointerup",this.zr,true);}render(){return m`<svg class="uc-svg" xmlns="http://www.w3.org/2000/svg" ${k(this.Kr)}></svg>`}};p([g()],We.prototype,"He",2);function tn(s){return s?[({dimensions:t,coords:e})=>[...t,...e].every(r=>Number.isInteger(r)&&Number.isFinite(r)),({dimensions:t,coords:e})=>t.every(r=>r>0)&&e.every(r=>r>=0)].every(t=>t(s)):true}var Xe=class extends C{constructor(){super();this.ctxOwner=true;this.ge={width:0,height:0};this.i=null;this.g=false;this.K=null;this.Wr=E();this.Li=E();this.init$={...this.init$,"*padding":20,"*operations":{rotate:0,mirror:false,flip:false},"*imageBox":{x:0,y:0,width:0,height:0},"*cropBox":{x:0,y:0,width:0,height:0}},this.qr=U(this.Xr.bind(this),300),this.Mi=rs(()=>{!this.isConnected||!this.g||(this.Ui(),this.Yr(),this.Zr(),this.Ni(),this.$i());},100);}firstUpdated(t){super.firstUpdated(t),this.Ui();}Yr(){let t=this.$["*editorTransformations"],e=hs(t,Object.keys(this.$["*operations"])),r={...this.$["*operations"],...e};this.$["*operations"]=r;}Ui(){let t=this.Wr.value;if(!t)return;let e=t.getContext("2d"),r=this.offsetWidth,o=this.offsetHeight,n=window.devicePixelRatio;t.style.width=`${r}px`,t.style.height=`${o}px`,t.width=r*n,t.height=o*n,e?.scale(n,n),this.Ii=t,this.i=e;}Zr(){if(!this.g||!this.K)return;let t=this.K,e=this.$["*padding"],r=this.$["*operations"],{rotate:o}=r,n={width:this.offsetWidth,height:this.offsetHeight},a=Ft({width:t.naturalWidth,height:t.naturalHeight},o),l;if(a.width>n.width-e*2||a.height>n.height-e*2){let c=a.width/a.height,d=n.width/n.height;if(c>d){let u=n.width-e*2,h=u/c,f=0+e,b=e+(n.height-e*2)/2-h/2;l={x:f,y:b,width:u,height:h};}else {let u=n.height-e*2,h=u*c,f=e+(n.width-e*2)/2-h/2,b=0+e;l={x:f,y:b,width:h,height:u};}}else {let{width:c,height:d}=a,u=e+(n.width-e*2)/2-c/2,h=e+(n.height-e*2)/2-d/2;l={x:u,y:h,width:c,height:d};}this.$["*imageBox"]=Kt(l);}Ni(){let t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:o}=r,n=this.$["*editorTransformations"].crop,{width:a,x:l,y:c}=e;if(n){let{dimensions:[h,f],coords:[b,L]}=n,{width:P}=Ft(this.ge,o),I=a/P;t=Dt(Kt({x:l+b*I,y:c+L*I,width:h*I,height:f*I}),e);}let d=this.$["*currentAspectRatio"],u=d?d.width/d.height:void 0;if(!ds(t,e)||u&&!ps(t,u)){let h=e.width/e.height,f=e.width,b=e.height;u&&(h>u?f=Math.min(e.height*u,e.width):b=Math.min(e.width/u,e.height)),t={x:e.x+e.width/2-f/2,y:e.y+e.height/2-b/2,width:f,height:b};}this.$["*cropBox"]=Dt(Kt(t),e);}Bo(){let t=this.i;if(!t)return;let e=this.K;if(!e)return;let r=this.$["*imageBox"],o=this.$["*operations"],{mirror:n,flip:a,rotate:l}=o,c=Ft({width:r.width,height:r.height},l);t.save(),t.translate(r.x+r.width/2,r.y+r.height/2),t.rotate(l*Math.PI*-1/180),t.scale(n?-1:1,a?-1:1),t.drawImage(e,-c.width/2,-c.height/2,c.width,c.height),t.restore();}$i(){if(!this.g||!this.K||!this.Ii||!this.i)return;let t=this.Ii;this.i.clearRect(0,0,t.width,t.height),this.Bo();}Go({fromViewer:t}){this.K&&(this.Li.value?.toggleThumbs(true),this.qo(),setTimeout(()=>{this.className=K({"uc-active_from_viewer":t,"uc-active_from_editor":!t,"uc-inactive_to_editor":false});}));}Qr(){let t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:o}=r,{width:n,height:a}=e,{width:l,height:c}=Ft(this.ge,o),{width:d,height:u}=t,h=n/l,f=a/c;return [gt(Math.round(d/h),1,l),gt(Math.round(u/f),1,c)]}Wo(){let t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:o}=r,{width:n,height:a,x:l,y:c}=e,{width:d,height:u}=Ft(this.ge,o),{x:h,y:f}=t,b=n/d,L=a/u,P=this.Qr(),I={dimensions:P,coords:[gt(Math.round((h-l)/b),0,d-P[0]),gt(Math.round((f-c)/L),0,u-P[1])]};if(!tn(I)){console.error("Cropper is trying to create invalid crop object",{payload:I});return}if(!(P[0]===d&&P[1]===u))return I}Xr(){if(!this.isConnected||!this.ge)return;let t=this.$["*operations"],{rotate:e,mirror:r,flip:o}=t,n=this.Wo(),l={...this.$["*editorTransformations"],crop:n,rotate:e,mirror:r,flip:o};this.$["*editorTransformations"]=l;}setValue(t,e){this.$["*operations"]={...this.$["*operations"],[t]:e},this.g&&(this.Zr(),this.Ni(),this.$i());}getValue(t){return this.$["*operations"][t]}async activate(t,{fromViewer:e}={}){if(!this.g){this.g=true,await this.updateComplete,this.Ui(),this.ge=t,this.removeEventListener("transitionend",this.Jr);try{let r=this.$["*originalUrl"],o=this.$["*editorTransformations"];this.K=await this.Xo(r,o),this.Yr(),this.Mi(),this.Go({fromViewer:e});}catch(r){console.error("Failed to activate cropper",{error:r}),this.telemetryManager.sendEventError(r,"cloud editor image. Failed to activate cropper");}this.f=new ResizeObserver(r=>{let[o]=r;if(!o)return;o.contentRect.width>0&&o.contentRect.height>0&&this.g&&this.K&&this.Mi();}),this.f.observe(this);}}deactivate({reset:t=false}={}){this.g&&(!t&&this.Xr(),this.g=false,this.Yo(),this.className=K({"uc-active_from_viewer":false,"uc-active_from_editor":false,"uc-inactive_to_editor":true}),this.Li.value?.toggleThumbs(false),this.addEventListener("transitionend",this.Jr,{once:true}),this.f?.disconnect());}Yo(){let t=this.Qr(),e=this.$["*cropBox"],r=Math.min(this.offsetWidth,t[0])/e.width,o=Math.min(this.offsetHeight,t[1])/e.height,n=Math.min(r,o),a=e.x+e.width/2,l=e.y+e.height/2;this.style.transform=`scale(${n}) translate(${(this.offsetWidth/2-a)/n}px, ${(this.offsetHeight/2-l)/n}px)`,this.style.transformOrigin=`${a}px ${l}px`;}qo(){let t=this.$["*cropBox"],e=t.x+t.width/2,r=t.y+t.height/2;this.style.transform="scale(1)",this.style.transformOrigin=`${e}px ${r}px`;}Jr(){this.g||(this.K=null);}async Xo(t,e){let r=this.offsetWidth;e={...e,crop:void 0,rotate:void 0,flip:void 0,mirror:void 0};let o=await this.proxyUrl(Vt(t,r,e)),{promise:n,cancel:a,image:l}=oe(o),c=this.Re(o);return l.addEventListener("load",c,{once:true}),l.addEventListener("error",c,{once:true}),this.m?.(),this.m=a,n.then(()=>l).catch(d=>(console.error("Failed to load image",{error:d}),this.$["*networkProblems"]=true,l))}Re(t){let e="crop",r=this.$["*loadingOperations"],o=r.get(e);return o||(o=new Map,r.set(e,o)),o.get(t)||(o.set(t,true),this.$["*loadingOperations"]=r),()=>{let n=r.get(e);n?.has(t)&&(n.delete(t),this.$["*loadingOperations"]=r);}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this.$i();}),this.sub("*cropBox",()=>{this.K&&this.qr();}),this.sub("*currentAspectRatio",()=>{this.Ni();}),setTimeout(()=>{this.sub("*networkProblems",t=>{t||this.g&&this.ge&&this.activate(this.ge,{fromViewer:false});});},0);}disconnectedCallback(){super.disconnectedCallback(),this.f?.disconnect(),this.K&&(this.K=null);}render(){return m`<canvas class="uc-canvas" ${k(this.Wr)}></canvas><uc-crop-frame ${k(this.Li)}></uc-crop-frame>`}};p([g()],Xe.prototype,"K",2);function Ii(s,i,t){let e=t,r=t-1,o=new Array(e);for(let n=r;n>=0;n-=1)o[n]=Math.ceil((n*i+(r-n)*s)/r);return o}function en(s){return typeof s=="string"&&s in H}function rn(s){let i=[];for(let t=0;t<s.length-1;t+=1){let e=s[t],r=s[t+1];typeof e=="number"&&typeof r=="number"&&i.push([e,r]);}return i}function sn(s,i,t){let e=rn(s).find(([n,a])=>n<=i&&i<=a);if(!e)return s.map(()=>0);let[r,o]=e;return s.map(n=>{let a=Math.abs(r-o)||1,l=Math.abs(i-r)/a;return r===n?i>t?1:1-l:o===n?i>=t?l:1:0})}function on(s,i){return s.map((t,e)=>t<i?s.length-e:e)}function fs(s,i){let t=H[s].keypointsNumber,{range:e,zero:r}=H[s];return [...new Set([...Ii(e[0],r,t+1),...Ii(r,e[1],t+1),r,i])].sort((o,n)=>o-n)}var $i=class extends C{constructor(){super();this.g=false;this._i=true;this.r="initial";this.es={};this.ie=[];this.rs=0;this.os=E();this.Lt=E();this.classList.add("uc-inactive_to_cropper"),this.ss=U(async(t,e,r)=>{let o=()=>!this.ns(t,e)||this.Di!==r||!!this.ie.find(c=>c.value===r);if(o())return;let n=await this.as(t,r),a=new Image;a.src=n.src;let l=this.Re(n.src);a.addEventListener("load",l,{once:true}),a.addEventListener("error",l,{once:true}),n.image=a,a.classList.add("uc-fader-image"),a.addEventListener("load",()=>{if(o())return;let c=this.ie,d=c.findIndex(b=>b.value>r);d===-1&&(d=c.length);let h=c[d]?.image,f=this.Lt.value;!f||h&&!f.contains(h)||(c.splice(d,0,n),h?f.insertBefore(a,h):f.appendChild(a),this.Vi(t,r));},{once:true}),a.addEventListener("error",()=>{this.$["*networkProblems"]=true;},{once:true});},600);}Re(t){let e=this.r,r=this.$["*loadingOperations"];r.has(e)||r.set(e,new Map);let o=r.get(e);return o&&!o.get(t)&&(o.set(t,true),this.$["*loadingOperations"]=r),()=>{let n=r.get(e);n?.has(t)&&(n.delete(t),this.$["*loadingOperations"]=r);}}ls(){window.cancelAnimationFrame(this.rs),this.rs=window.requestAnimationFrame(()=>{for(let t of this.ie){let{image:e}=t;e&&(e.style.opacity=t.opacity.toString(),e.style.zIndex=t.zIndex.toString());}});}ye({url:t=this.ts,filter:e=this.c??void 0,operation:r,value:o}={}){if(!t)throw new Error("URL is not defined");let n={...this.es};r&&(r==="filter"?e&&typeof o=="number"&&(n.filter={name:e,amount:o}):typeof o=="number"&&(n[r]=o));let a=this.offsetWidth;return this.proxyUrl(Vt(t,a,n))}async as(t,e){return {src:await this.ye({operation:t,value:e}),image:void 0,opacity:0,zIndex:0,value:e}}ns(t,e){return this.r===t&&this.c===e}set(t){let e=typeof t=="string"?parseInt(t,10):t;!en(this.r)||!Number.isFinite(e)||(this.Vi(this.r,e),this.ss(this.r,this.c,e));}Vi(t,e){this.r=t,this.Di=e;let{zero:r}=H[t],o=this.ie.map(l=>l.value),n=sn(o,e,r),a=on(o,r);this.ie.forEach((l,c)=>{let d=n[c],u=a[c];typeof d=="number"&&(l.opacity=d),typeof u=="number"&&(l.zIndex=u);}),this.ls();}cs(){let t=new Image;return t.classList.add("uc-fader-image","uc-fader-image--preview"),t.style.opacity="0",t}async Zo(){this.s=this.s||this.cs();let t=this.s;t&&this.us(t);let e=this.ie.map(c=>c.src),{images:r,promise:o,cancel:n}=ne(e);r.forEach(c=>{let d=this.Re(c.src);c.addEventListener("load",d),c.addEventListener("error",d);}),this.Fi=()=>{n(),this.Fi=void 0;};let a=this.r,l=this.c;if(await o,this.g&&this.ns(a,l)){let c=this.Lt.value;if(!c)return;c.replaceChildren(),this.ie.forEach((d,u)=>{let h=r[u];h&&(h.classList.add("uc-fader-image"),d.image=h,c.appendChild(h));}),this.ls();}}async setTransformations(t){if(this.es=t,this.s){let e=await this.ye(),r=this.Re(e);this.s.src=e,this.s.addEventListener("load",r,{once:true}),this.s.addEventListener("error",r,{once:true}),this.s.style.opacity="1",this.s.addEventListener("error",()=>{this.$["*networkProblems"]=true;},{once:true});}}async preload({url:t,filter:e,operation:r,value:o}){if(!r||typeof o!="number")return;this.Ki?.();let n=fs(r,o),a=await Promise.all(n.map(c=>this.ye({url:t,filter:e,operation:r,value:c}))),{cancel:l}=ne(a);this.Ki=l;}Qo(t){let e=this.s||this.cs();if(this.us(e),this.s=e,e.src===t){e.style.opacity="1",e.style.transform="scale(1)",this.className=K({"uc-active_from_viewer":this.We,"uc-active_from_cropper":!this.We,"uc-inactive_to_cropper":false});return}e.style.opacity="0";let r=this.Re(t);e.addEventListener("error",r,{once:true}),e.src=t,e.addEventListener("load",()=>{r(),e&&(e.style.opacity="1",e.style.transform="scale(1)",this.className=K({"uc-active_from_viewer":this.We,"uc-active_from_cropper":!this.We,"uc-inactive_to_cropper":false}));},{once:true}),e.addEventListener("error",()=>{this.$["*networkProblems"]=true;},{once:true});}async activate({url:t,operation:e,value:r,filter:o,fromViewer:n}){if(this.g=true,this._i=false,await this.updateComplete,this.ts=t,this.r=e??"initial",this.Di=r,this.c=o,this.We=n,typeof r!="number"&&!o){let l=await this.ye({operation:e,value:r});this.Qo(l),this.zi();return}!e||typeof r!="number"||(this.ie=await Promise.all(fs(e,r).map(l=>this.as(e,l))),this.Vi(e,r),this.Zo());}deactivate({hide:t=true}={}){this.g=false,this.Fi?.(),this.Ki?.(),t&&!this._i?(this._i=true,this.s&&(this.s.style.transform="scale(1)"),this.className=K({"uc-active_from_viewer":false,"uc-active_from_cropper":false,"uc-inactive_to_cropper":true}),this.addEventListener("transitionend",()=>{this.zi();},{once:true})):this.zi();}us(t){let e=this.os.value;e&&(e.contains(t)||e.appendChild(t));}zi(){this.Lt.value?.replaceChildren();}render(){return m`<div class="uc-fader-preview-host" ${k(this.os)}></div><div class="uc-fader-layers-host" ${k(this.Lt)}></div>`}};var ms="important",nn=" !"+ms,le=j(class extends W{constructor(s){if(super(s),s.type!==lt.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((i,t)=>{let e=s[t];return e==null?i:i+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(s,[i]){let{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);for(let e of this.ft)i[e]==null&&(this.ft.delete(e),e.includes("-")?t.removeProperty(e):t[e]=null);for(let e in i){let r=i[e];if(r!=null){this.ft.add(e);let o=typeof r=="string"&&r.endsWith(nn);e.includes("-")||o?t.setProperty(e,o?r.slice(0,-11):r,o?ms:""):t[e]=r;}}return F}});var nt=class extends C{constructor(){super();this.ji=0;this.Ut=E();this.ds=E();this.hs=E();this.disabled=false;this.min=0;this.max=100;this.defaultValue=0;this.zero=0;this.re=0;this.en=t=>{t.stopPropagation();let e=this.fs(t);e!==null&&(this.Hi(e),this.Jo("slider-input",e));};this.tn=t=>{t.stopPropagation();let e=this.fs(t);e!==null&&this.Hi(e);};this.ms=()=>{this.style.setProperty("--color-effect","var(--hover-color-rgb)");};this.gs=()=>{this.style.setProperty("--color-effect","var(--idle-color-rgb)");};this.setAttribute("with-effects","");}Jo(t,e){this.dispatchEvent(new CustomEvent(t,{detail:{value:e},bubbles:true,composed:true}));}firstUpdated(t){super.firstUpdated(t),this.ji=Number.parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"),10)||0,this.ys(this.re),this.Bi(),this.f=new ResizeObserver(()=>{this.Bi(),this.Nt(this.re);}),this.f.observe(this);let e=this.Ut.value;e?.addEventListener("focus",this.ms),e?.addEventListener("blur",this.gs),window.setTimeout(()=>{this.Nt(this.re);},0);}willUpdate(t){super.willUpdate(t),t.has("defaultValue")&&this.defaultValue!==this.re&&this.Hi(this.defaultValue),(t.has("min")||t.has("max"))&&this.hasUpdated&&(this.Bi(),this.Nt(this.re)),t.has("zero")&&this.hasUpdated&&this.vs(this.re);}Nt(t){this.vs(t);let e=this.max-this.min;if(e===0)return;let{width:r}=this.getBoundingClientRect(),a=100/e*(t-this.min)*(r-this.ji)/100;window.requestAnimationFrame(()=>{let l=this.ds.value;l&&(l.style.transform=`translateX(${a}px)`);});}vs(t){if(!this.Xe)return;let e=this.max-this.min;if(e===0)return;this.Xe.style.opacity=t===this.zero?"0":"1";let{width:r}=this.getBoundingClientRect(),a=100/e*(this.zero-this.min)*(r-this.ji)/100;window.requestAnimationFrame(()=>{this.Xe&&(this.Xe.style.transform=`translateX(${a}px)`);});}Bi(){let e=this.hs.value;if(!e)return;let{width:r}=e.getBoundingClientRect(),o=Math.ceil(r/2),n=Math.ceil(o/15)-2;if(this.ps===n)return;let a=document.createDocumentFragment(),l=document.createElement("div"),c=document.createElement("div");l.className="uc-minor-step",c.className="uc-border-step",a.appendChild(c);for(let u=0;u<n;u+=1)a.appendChild(l.cloneNode());a.appendChild(c.cloneNode());for(let u=0;u<n;u+=1)a.appendChild(l.cloneNode());a.appendChild(c.cloneNode());let d=document.createElement("div");d.className="uc-zero-dot",a.appendChild(d),this.Xe=d,e.innerHTML="",e.appendChild(a),this.ps=n;}disconnectedCallback(){super.disconnectedCallback();let t=this.Ut.value;t?.removeEventListener("focus",this.ms),t?.removeEventListener("blur",this.gs),this.f?.disconnect(),this.f=void 0;}Hi(t){Number.isFinite(t)&&(this.re=t,this.hasUpdated&&(this.ys(t),this.Nt(t)));}ys(t){let e=this.Ut.value;e&&(e.value=String(t));}fs(t){let e=t.currentTarget;if(!e)return null;let r=Number.parseInt(e.value,10);return Number.isFinite(r)?r:null}render(){return m`<div class="uc-steps" ${k(this.hs)}></div><div class="uc-thumb" ${k(this.ds)}></div><input class="uc-input" type="range" ${k(this.Ut)} .min=${String(this.min)} .max=${String(this.max)} .value=${String(this.re)} ?disabled=${this.disabled} @input=${this.en} @change=${this.tn} />`}};p([y({type:Boolean,reflect:true})],nt.prototype,"disabled",2),p([y({type:Number})],nt.prototype,"min",2),p([y({type:Number})],nt.prototype,"max",2),p([y({type:Number,attribute:false})],nt.prototype,"defaultValue",2),p([y({type:Number})],nt.prototype,"zero",2),p([g()],nt.prototype,"re",2);var Y="original",Ye=class extends C{constructor(){super(...arguments);this.state={operation:"filter",filter:void 0,originalUrl:"",disabled:false,min:0,max:100,value:0,defaultValue:0,zero:0};this.rn=t=>{let{value:e}=t.detail;this.$["*faderEl"]?.set(e),this.state={...this.state,value:e};};}setOperation(t,e){this.state={...this.state,operation:t,filter:e},this.sn();let r=this.$["*faderEl"],o=this.state.originalUrl||this.$["*originalUrl"];r&&o&&r.activate({url:o,operation:this.state.operation,value:this.state.filter===Y?void 0:this.state.value,filter:this.state.filter===Y?void 0:this.state.filter,fromViewer:false});}sn(){let t=this.state.operation,{range:e,zero:r}=H[t],[o,n]=e;this.state={...this.state,min:o,max:n,zero:r};let l=this.$["*editorTransformations"][t];if(t==="filter"){let d=Number(n),u=l;if(u){let{name:h,amount:f}=u;d=h===this.state.filter?f:n;}this.state={...this.state,value:d,defaultValue:d};return}let c=typeof l<"u"?l:r;this.state={...this.state,value:c,defaultValue:c};}apply(){let e={...this.$["*editorTransformations"]};this.state.operation==="filter"?!this.state.filter||this.state.filter===Y?delete e.filter:e.filter={name:this.state.filter,amount:this.state.value}:e[this.state.operation]=this.state.value,this.$["*editorTransformations"]=e;}cancel(){this.$["*faderEl"]?.deactivate({hide:false});}initCallback(){super.initCallback(),this.sub("*originalUrl",t=>{t&&(this.state={...this.state,originalUrl:t});});}updated(t){if(super.updated(t),t.has("state")){let e=`${this.state.filter??this.state.operation} ${this.state.value}`;this.$["*operationTooltip"]=e;}}render(){return m`<uc-slider-ui .disabled=${this.state.disabled} .min=${this.state.min} .max=${this.state.max} .defaultValue=${this.state.defaultValue} .zero=${this.state.zero} @slider-input=${this.rn} ></uc-slider-ui>`}};p([g()],Ye.prototype,"state",2);function zt(s){if(!s)return null;let i=s.match(/^([A-Za-z]+)\s+(\d+)$/);if(!i)return null;let[,t,e]=i;return !t||typeof e>"u"?null:{filter:t,value:Number(e)}}var N=class extends C{constructor(){super(...arguments);this.active=false;this.title="";this.icon="";this.titleProp="";}get buttonClasses(){let t=this.active;return {"uc-active":t,"uc-not_active":!t}}bs(){let t=this.buttonClasses;for(let[e,r]of Object.entries(t))this.classList.toggle(e,r);}onClick(t){}connectedCallback(){super.connectedCallback(),this.bs();}updated(t){super.updated(t),t.has("active")&&this.bs();}render(){let t=this.onClick,e=this.title;return m`<button role="option" type="button" aria-label=${A(this.titleProp)} title=${A(this.titleProp)} @click=${t} ><uc-icon name=${this.icon}></uc-icon><div class="uc-title" ?hidden=${!e}>${e}</div></button>`}};p([g()],N.prototype,"active",2),p([g()],N.prototype,"title",2),p([g()],N.prototype,"icon",2),p([g()],N.prototype,"titleProp",2);var Ze=12,Qe=16,an=s=>{let i=12,t=12;return s.width/s.height>=1?(i=Ze,t=Math.round(Ze*s.height/s.width)):(t=Ze,i=Math.round(Ze*s.width/s.height)),{width:i,height:t}},Ui=class extends N{initCallback(){super.initCallback(),this.icon="arrow-dropdown",this.sub("*currentAspectRatio",i=>{let t=this.nn(i);this.title=t,this.titleProp=t;});}onClick(){this.$["*showListAspectRatio"]=true;}nn(i){return i?i.hasFreeform?this.l10n("freeform-crop"):this.l10n("crop-to-shape",{value:`${i.width}:${i.height}`}):""}render(){let i=this.onClick,t=this.title;return m`<button role="option" type="button" class=${ft(this.buttonClasses)} aria-label=${A(this.titleProp)} title=${A(this.titleProp)} @click=${i} ><div class="uc-title" ?hidden=${!t}>${t}</div><uc-icon name=${this.icon}></uc-icon></button>`}},Je=class extends N{constructor(){super(...arguments);this.E=null;}get aspectRatio(){return this.E}set aspectRatio(t){if(this.E===t)return;let e=this.E;this.E=t,this.requestUpdate("aspectRatio",e),t?this.Ts(t):(this.removeAttribute("uc-aspect-ratio-freeform"),this.title="",this.titleProp="");}initCallback(){super.initCallback(),this.E&&this.Ts(this.E),this.sub("*currentAspectRatio",t=>{this.active=t&&t.id===this.E?.id||t?.width===this.E?.width&&t?.height===this.E?.height;});}onClick(){this.$["*currentAspectRatio"]?.id!==this.E?.id&&(this.$["*currentAspectRatio"]=this.E);}Ts(t){if(!this.isConnected)return;let e=!!t.hasFreeform;this.toggleAttribute("uc-aspect-ratio-freeform",e);let r=()=>{let n=e?this.l10n("custom"):`${t.width}:${t.height}`;return this.title=n,n},o=()=>{let n=this.l10n("a11y-cloud-editor-apply-aspect-ratio",{name:e?this.l10n("custom").toLowerCase():this.l10n("crop-to-shape",{value:`${t.width}:${t.height}`}).toLowerCase(),value:""});return this.titleProp=n,n};r(),o(),e||this.requestUpdate();}an(){let t=this.E;if(!t||t.hasFreeform)return m`<uc-icon name=${this.icon}></uc-icon>`;let{width:e,height:r}=an(t),o=(Qe-e)/2,n=(Qe-r)/2;return m`<uc-icon><svg viewBox="0 0 ${Qe} ${Qe}" aria-hidden="true" focusable="false" ><rect x=${o} y=${n} width=${e} height=${r} rx="2" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round" ></rect></svg></uc-icon>`}render(){let t=this.onClick,e=this.title;return m`<button role="option" type="button" class=${ft(this.buttonClasses)} aria-label=${A(this.titleProp)} title=${A(this.titleProp)} @click=${t} >${this.an()}<div class="uc-title" ?hidden=${!e}>${e}</div></button>`}};p([y({attribute:false})],Je.prototype,"aspectRatio",1);function ln(s){let i=s+90;return i=i>=360?0:i,i}function cn(s,i){if(s==="rotate")return ln(typeof i=="number"?i:0);if(s==="mirror"||s==="flip")return !i;throw new Error(`Unsupported operation: ${s}`)}var ti=class extends N{constructor(){super(...arguments);this.operation=void 0;}willUpdate(t){super.willUpdate(t),this.operation?(this.titleProp=this.l10n("a11y-cloud-editor-apply-crop",{name:this.l10n(this.operation).toLowerCase()}),this.icon=this.operation):(this.icon="",this.titleProp="");}onClick(t){if(!this.operation)return;let e=this.$["*cropperEl"],r=e.getValue(this.operation),o=cn(this.operation,r);this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:this.operation,next:o,prev:r}),e.setValue(this.operation,o);}};p([y({type:String})],ti.prototype,"operation",2);var yt=class extends N{constructor(){super(...arguments);this.r="";this.c="";this.Ye="";this.$t=0;this.s=null;this.Ie=false;this.isOriginal=false;this.Cs=20;}get filter(){return this.c}set filter(t){let e=t??"";if(this.c===e)return;let r=this.c;this.c=e,this.r="filter",this.isOriginal=e===Y,this.icon=this.isOriginal?"original":"slider",this.Cs=this.isOriginal?40:20,this.requestUpdate("filter",r),this.isConnected&&this.xs(e);}onClick(t){if(this.active)this.isOriginal||(this.$["*sliderEl"].setOperation(this.r,this.c),this.$["*showSlider"]=true);else {let e=this.$["*sliderEl"];e.setOperation(this.r,this.c),e.apply();}this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:zt(this.$["*operationTooltip"])}),this.$["*currentFilter"]=this.c;}ln(){let t=parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"),10),e=Number.isFinite(t)&&t>0?t:this.Cs||32,r=window.devicePixelRatio,o=Math.ceil(r*e),n=r>=2?"lightest":"normal",a=100,l={...this.$["*editorTransformations"]};return l[this.r]=this.c!==Y?{name:this.c,amount:a}:void 0,tt(this.Ye,J(Ae,ct(l),`quality/${n}`,`scale_crop/${o}x${o}/center`,`@clib/${Lt}/${It}/uc-cloud-image-editor/`))}async cn(t,e){t[0]?.isIntersecting?await this.Gi(e):this.m?.();}initCallback(){super.initCallback(),this.f=new window.IntersectionObserver(this.cn.bind(this),{threshold:[0,1]});let t=this.$["*originalUrl"];this.Ye=t??"",this.sub("*originalUrl",e=>{this.Ye=e??"",!this.isOriginal&&this.Ye&&this.isConnected&&!this.s&&(this.f?.observe(this),this.ve());}),this.isOriginal||(this.f?.observe(this),this.ve()),this.c&&this.xs(this.c),this.sub("*currentFilter",e=>{this.active=!!(e&&e===this.c);}),this.sub("*networkProblems",async e=>{e||(this.s?await this.Gi():this.ve());});}disconnectedCallback(){super.disconnectedCallback(),this.f?.disconnect(),this.m?.(),this._t();}updated(t){super.updated(t),t.has("isOriginal")&&(this.isOriginal?this.f?.unobserve(this):(this.f?.observe(this),this.ve()));}xs(t){if(!t){this.titleProp="";return}let e=this.l10n("a11y-cloud-editor-apply-filter",{name:t.toLowerCase()});this.titleProp=e;}async Gi(t){if(!this.isConnected){t?.unobserve(this),this.m?.(),this.m=void 0;return}if(!this.Ye){!this.Me&&!this.se&&this.ve();return}let e=++this.$t,r="";try{r=await this.proxyUrl(this.ln());}catch(a){this.$["*networkProblems"]=true,console.error("Failed to resolve preview URL",{error:a});return}this.Ie=false,this.m?.();let{promise:o,cancel:n}=oe(r);this.m=()=>{n(),this.$t===e&&(this.m=void 0);};try{if(await o,this.$t!==e||!this.isConnected)return;this.s=r,this.Ie=!0,this._t(),(t??this.f)?.unobserve(this);}catch(a){this.$["*networkProblems"]=true,console.error("Failed to load image",{error:a}),this.ve();}finally{this.$t===e&&(this.m=void 0);}}ve(){if(!this.isConnected||this.s||this.Ie||this.isOriginal||this.$["*networkProblems"]){this._t();return}this.se&&cancelAnimationFrame(this.se),this.se=requestAnimationFrame(()=>{if(this.se=void 0,!this.isConnected||this.s||this.Ie||this.isOriginal){this._t();return}let t=this.getBoundingClientRect(),e=t.width>0&&t.height>0,r=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;if(e&&t.bottom>0&&t.right>0&&t.top<o&&t.left<r){this.Gi();return}this.Me=window.setTimeout(()=>{this.Me=void 0,this.ve();},500);});}_t(){this.se&&(cancelAnimationFrame(this.se),this.se=void 0),this.Me&&(window.clearTimeout(this.Me),this.Me=void 0);}get un(){return !!(this.Ie&&!this.active&&!this.isOriginal)}render(){let t=this.onClick,e={opacity:this.un?"1":"0"};this.s&&(e.backgroundImage=`url(${this.s})`);let r={opacity:this.active||this.isOriginal?"1":"0"};return m`<button role="option" type="button" class=${ft(this.buttonClasses)} aria-label=${A(this.titleProp)} title=${A(this.titleProp)} @click=${t} ><div class="uc-preview" ?data-loaded=${this.Ie} style=${le(e)}></div><uc-icon class=${ft({"uc-original-icon":this.isOriginal})} name=${this.icon} style=${le(r)} ></uc-icon></button>`}};p([g()],yt.prototype,"s",2),p([g()],yt.prototype,"Ie",2),p([g()],yt.prototype,"isOriginal",2),p([g()],yt.prototype,"Cs",2),p([y({type:String})],yt.prototype,"filter",1);var ei=class extends N{constructor(){super(...arguments);this.r="";}get operation(){return this.r}set operation(t){let e=t??"";if(this.r===e)return;let r=this.r;this.r=e,this.requestUpdate("operation",r),this.isConnected&&e&&this.Es(e);}Es(t){this.icon=t;let e=()=>{let o=this.l10n("a11y-cloud-editor-apply-tuning",{name:this.l10n(t).toLowerCase()});return this.titleProp=o,o},r=()=>{let o=this.l10n(t);return this.title=o,o};e(),r();}initCallback(){super.initCallback(),this.r&&this.Es(this.r),this.sub("*editorTransformations",t=>{if(!this.r)return;let{zero:e}=H[this.r],r=t[this.r],o=typeof r<"u"?r!==e:false;this.active=o;});}onClick(t){this.$["*sliderEl"]?.setOperation(this.r),this.$["*showSlider"]=true,this.$["*currentOperation"]=this.r,this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:zt(this.$["*operationTooltip"])});}};p([y({type:String})],ei.prototype,"operation",1);var un=1,gs=()=>{},ii=class extends C{constructor(){super(...arguments);this.hiddenScrollbar=false;this.Ss=t=>{t.preventDefault();let{deltaY:e,deltaX:r}=t;if(Math.abs(r)>un){this.scrollLeft+=r;return}this.scrollLeft+=e;};}connectedCallback(){super.connectedCallback(),this.addEventListener("wheel",this.Ss,{passive:false}),this.addEventListener("scroll",gs,{passive:true});}disconnectedCallback(){this.removeEventListener("wheel",this.Ss),this.removeEventListener("scroll",gs),super.disconnectedCallback();}};p([y({type:Boolean,noAccessor:true,attribute:"hidden-scrollbar"})],ii.prototype,"hiddenScrollbar",2);var z=class extends C{constructor(){super(...arguments);this.Ze=false;this.showMainToolbar=true;this.showSubToolbar=false;this.ks=true;this.tabList=[...$];this.activeTab=O.CROP;this.Dt=true;this.qi=false;this.As=null;this.Ps=0;this.Os=0;this.Ft=E();this.Rs=E();this.tabToggleRefs={[O.CROP]:E(),[O.TUNING]:E(),[O.FILTERS]:E()};this.Ms=()=>{this.be();};this.Qe=[];this.Kt=U(t=>{this.Ze=t;},500);this.Vt=U(()=>{let t=this.$["*editorTransformations"],e=this.$["*currentOperation"],r="",o=false;if(this.$["*tabId"]===O.FILTERS)if(o=true,this.$["*currentFilter"]&&t?.filter?.name===this.$["*currentFilter"]){let n=t?.filter?.amount||100;r=`${this.$["*currentFilter"]} ${n}`;}else r=this.l10n(Y);else if(this.showSubToolbar&&this.$["*tabId"]===O.TUNING&&e){o=true;let n=t?.[e]||H[e].zero;r=`${this.l10n(e)} ${n}`;}o&&(this.$["*operationTooltip"]=r),this.qi=o;},0);this.pn={hidden:"uc-sub-toolbar--top-hidden",visible:"uc-sub-toolbar--visible"};this.dn={hidden:"uc-sub-toolbar--bottom-hidden",visible:"uc-sub-toolbar--visible"};this.hn={hidden:"uc-tab-toggle--hidden",visible:"uc-tab-toggle--visible"};this.mn={hidden:"uc-tab-toggles--hidden",visible:"uc-tab-toggles--visible"};this.init$={...this.init$,"*sliderEl":null,"*showSlider":false,"*showListAspectRatio":false,"*currentFilter":Y,"*currentOperation":null,"*operationTooltip":null};this.kn=t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"cancel"}),this.m?.();let e=this.$["*on.cancel"];e?.();};this.An=t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"apply"});let e=this.$["*on.apply"];e?.(this.$["*editorTransformations"]);};this.Pn=t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"apply-slider",operation:zt(this.$["*operationTooltip"])}),this.Ft.value?.apply(),this.Is();};this.On=t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"cancel-slider"}),this.Ft.value?.cancel(),this.Is();};this.Rn=t=>{let r=t.currentTarget?.getAttribute("data-id");r&&(this.telemetryManager.sendEventCloudImageEditor(t,r),this.Wi(r,{fromViewer:false}));};}Is(){this.$["*showSlider"]=false,this.$["*tabId"]===O.CROP&&(this.$["*showListAspectRatio"]=false),this.$["*tabId"]===O.TUNING&&(this.qi=false);}Wi(t,{fromViewer:e=false,force:r=false}={}){this.$["*tabId"]!==t&&(this.$["*tabId"]=t),this.Ls(t,{fromViewer:e,force:r});}Ls(t,{fromViewer:e,force:r=false}){if(!r&&this.activeTab===t){this.be();return}this.activeTab=t;let o=this.$["*faderEl"],n=this.$["*cropperEl"];t===O.CROP?(o?.deactivate(),this.$["*imageSize"]&&n?.activate(this.$["*imageSize"],{fromViewer:e})):(o?.activate({url:this.$["*originalUrl"],fromViewer:e}),n?.deactivate());for(let a of $){let l=a===t,d=this.tabToggleRefs[a]?.value;d&&(d.active=l),l&&this.be();}}be(){let e=this.tabToggleRefs[this.activeTab]?.value,r=this.Rs.value;if(!e||!r)return;let o=e.offsetLeft,n=e.offsetWidth||Number(getComputedStyle(e).width.replace("px",""));(this.Ps!==o||this.Os!==n)&&(this.Ps=o,this.Os=n,r.style.transform=`translateX(${o}px)`,r.style.width=`${n}px`);}get Xi(){return this.Qe.length>=3}gn(t){switch(t){case O.CROP:return this.yn();case O.FILTERS:return this.vn();case O.TUNING:return this.bn();default:return []}}yn(){let t=[];if(this.Xi)t.push(()=>this.Tn());else for(let e of this.Qe)t.push(()=>this.Us(e));for(let e of Cr)t.push(()=>this.Cn(e));return this.Yi(t)}vn(){let e=[Y,...wr].map(r=>()=>this.wn(r));return this.Yi(e)}bn(){let t=Tr.map(e=>()=>this.xn(e));return this.Yi(t)}Yi(t){return t.length?t.map(r=>r()):[]}Tn(){return m`<uc-editor-freeform-button-control></uc-editor-freeform-button-control>`}Us(t){return m`<uc-editor-aspect-ratio-button-control .aspectRatio=${t}></uc-editor-aspect-ratio-button-control>`}Cn(t){return m`<uc-editor-crop-button-control .operation=${t}></uc-editor-crop-button-control>`}wn(t){return m`<uc-editor-filter-control .filter=${t}></uc-editor-filter-control>`}xn(t){return m`<uc-editor-operation-control .operation=${t}></uc-editor-operation-control>`}En(){return this.Xi?this.Qe.map(t=>this.Us(t)):[]}async Sn(){if(this.$["*imgContainerEl"]&&this.$["*originalUrl"]){let t=this.$["*imgContainerEl"].offsetWidth,e=await this.proxyUrl(Vt(this.$["*originalUrl"],t,this.$["*editorTransformations"]));this.m?.();let{cancel:r}=ne([e]);this.m=()=>{r(),this.m=void 0;};}}initCallback(){super.initCallback();let t=this.$["*cropPresetList"]??[];this.Qe=[...t],this.sub("*cropPresetList",e=>{this.Qe=[...e??[]];}),this.sub("*imageSize",e=>{e&&setTimeout(()=>{this.Wi(this.$["*tabId"],{fromViewer:true});},0);}),this.sub("*editorTransformations",e=>{let r=e?.filter?.name;this.$["*currentFilter"]!==r&&(this.$["*currentFilter"]=r??"");}),this.sub("*currentFilter",()=>{this.Vt();}),this.sub("*currentOperation",()=>{this.Vt();}),this.sub("*tabId",e=>{this.Ls(e,{fromViewer:false,force:true}),this.Vt();}),this.sub("*originalUrl",()=>{this.$["*faderEl"]?.deactivate();}),this.sub("*editorTransformations",e=>{this.Sn(),this.$["*faderEl"]?.setTransformations(e);}),this.sub("*loadingOperations",e=>{let r=false;for(let[,o]of e.entries()){if(r)break;for(let[,n]of o.entries())if(n){r=true;break}}this.Kt(r);}),this.sub("*showSlider",e=>{e?(this.showSubToolbar=true,this.showMainToolbar=false,this.Dt=true):this.$["*showListAspectRatio"]||(this.showSubToolbar=false,this.showMainToolbar=true);}),this.sub("*showListAspectRatio",e=>{e?(this.showSubToolbar=true,this.showMainToolbar=false,this.Dt=false):this.$["*showSlider"]||(this.showSubToolbar=false,this.showMainToolbar=true);}),this.sub("*tabList",e=>{if(this.tabList=e,this.ks=e.length>1,!e.includes(this.$["*tabId"])&&e.length>0){let[r]=e;r&&this.Wi(r,{fromViewer:false});return}this.be();}),this.sub("*operationTooltip",e=>{this.As=e;}),this.Vt();}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.Ms);}firstUpdated(t){super.firstUpdated(t),this.zt(),this.be();}updated(t){super.updated(t),(t.has("activeTab")||t.has("tabList"))&&this.updateComplete.then(()=>this.be()),(t.has("showSubToolbar")||t.has("showMainToolbar"))&&this.zt();}disconnectedCallback(){window.removeEventListener("resize",this.Ms),super.disconnectedCallback(),this.$["*showSlider"]=false,this.$["*showListAspectRatio"]=false;}zt(){let t=this.Ft.value;t&&(this.$["*sliderEl"]=t);}Mn(t){let e=this.tabList.includes(t),r=this.activeTab===t,o=this.tabList.indexOf(t),n=o>=0?le({gridColumn:`${o+1}`}):w;return m`<uc-presence-toggle class="uc-tab-toggle" .visible=${e} .styles=${this.hn}><uc-btn-ui theme="tab" data-id=${t} icon=${t} role="tab" aria-controls=${`tab_${t}`} aria-selected=${r?"true":"false"} title-prop=${`a11y-editor-tab-${t}`} .active=${r} style=${n} @click=${this.Rn} ${k(this.tabToggleRefs[t])} ></uc-btn-ui></uc-presence-toggle>`}In(t){let e=this.gn(t);return m`<div id=${`tab_${t}`} class="uc-tab-content" ><uc-editor-scroller hidden-scrollbar><div class="uc-controls-list_align"><div role="listbox" aria-orientation="horizontal" class="uc-controls-list_inner">${e.length?e:w}</div></div></uc-editor-scroller></div>`}render(){let t=["uc-info-tooltip",this.qi?"uc-info-tooltip_visible":"uc-info-tooltip_hidden"].join(" "),e=this.Xi;return m`<uc-line-loader-ui .active=${this.Ze}></uc-line-loader-ui><div class="uc-info-tooltip_container"><div class="uc-info-tooltip_wrapper"><div class=${t}>${this.As??""}</div></div></div><div class="uc-toolbar-container"><uc-presence-toggle role="tablist" class="uc-sub-toolbar" .visible=${this.showMainToolbar} .styles=${this.pn} ><div class="uc-tab-content-row">${$.map(r=>Zt(this.activeTab===r,()=>this.In(r)))}</div><div class="uc-controls-row"><uc-presence-toggle class="uc-tab-toggles" .visible=${this.ks} .styles=${this.mn} @initial-render=${()=>this.be()} ><div class="uc-tab-toggles_indicator" ${k(this.Rs)} ></div>${$.map(r=>this.Mn(r))}</uc-presence-toggle><uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" title-prop="cancel" @click=${this.kn} ></uc-btn-ui><uc-btn-ui theme="primary-icon" icon="done" title-prop="apply" @click=${this.An}></uc-btn-ui></div></uc-presence-toggle><uc-presence-toggle class="uc-sub-toolbar" .visible=${this.showSubToolbar} .styles=${this.dn}><div class="uc-slider" ?hidden=${!this.Dt}><uc-editor-slider ${k(this.Ft)}></uc-editor-slider></div><div class="uc-list-aspect-ratio-container" ?hidden=${this.Dt||!e}>${e?m`<div class="uc-list-aspect-ratio">${this.En()}</div>`:w}</div><div class="uc-controls-row"><uc-btn-ui theme="secondary" @click=${this.On} text=${this.l10n("cancel")}></uc-btn-ui><uc-btn-ui theme="primary" @click=${this.Pn} text=${this.l10n("apply")}></uc-btn-ui></div></uc-presence-toggle></div>`}};p([g()],z.prototype,"Ze",2),p([g()],z.prototype,"showMainToolbar",2),p([g()],z.prototype,"showSubToolbar",2),p([g()],z.prototype,"ks",2),p([g()],z.prototype,"tabList",2),p([g()],z.prototype,"activeTab",2),p([g()],z.prototype,"Dt",2),p([g()],z.prototype,"qi",2),p([g()],z.prototype,"As",2),p([g()],z.prototype,"Qe",2);var ys=kt([...$]),_=class extends C{constructor(){super(...arguments);this.ctxOwner=true;this.Ln="";this.ye=ht;this.Un="";this.Ze=false;this.uuid=null;this.cdnUrl=null;this.cropPreset="";this.tabs=ys;this.Ns=false;this.J=false;this.Zi=null;this.Je=null;this.Kt=U(t=>{this.Ze=t;},300);this.jt=E();this.$s=E();this._s=E();this.Ds=E();this.Fs=()=>{this.Kt(false),this.ye!==ht&&(this.$["*networkProblems"]=false);};this.Ks=()=>{this.Kt(false),this.$["*networkProblems"]=true;};this.Nn=()=>{let t=this.$["*on.retryNetwork"];t?.();};this.init$={...this.init$,...es(this)};}static{this.styleAttrs=["uc-cloud-image-editor"];}$n(){this.J||this.Zi||(this.Zi=this.updateComplete.then(()=>{this.Zi=null,this.J=true;}));}initCallback(){super.initCallback(),this.Vs(),this.zs();}zt(){let t=this._s.value;t&&(this.$["*faderEl"]=t);let e=this.$s.value;e&&(this.$["*cropperEl"]=e);let r=this.Ds.value;r&&(this.$["*imgContainerEl"]=r);let o=this.jt.value;o&&(this.$["*imgEl"]=o);}_n(){let t=this.jt.value;t&&(t.addEventListener("load",this.Fs),t.addEventListener("error",this.Ks));}Dn(){let t=this.jt.value;t&&(t.removeEventListener("load",this.Fs),t.removeEventListener("error",this.Ks));}get Fn(){let t=this.$["*tabId"];return K("uc-image",{"uc-image_hidden_to_cropper":t===O.CROP,"uc-image_hidden_effects":t!==O.CROP})}js(){if(this.Je)return this.Je;let t=3e3;return this.Je=new Promise((e,r)=>{let o=()=>{window.clearTimeout(d),c.disconnect(),this.Je=null;},n=()=>{let{width:u,height:h}=this.getBoundingClientRect();return u>0&&h>0},a=()=>{o(),window.setTimeout(()=>e(),0);},l=()=>{let u=new Error("[cloud-image-editor] timeout waiting for non-zero container size");o(),this.isConnected&&console.error(u.message),r(u);},c=new ResizeObserver(u=>{let[h]=u;h&&h.contentRect.width>0&&h.contentRect.height>0&&a();}),d=window.setTimeout(()=>{l();},t);if(n()){a();return}c.observe(this);}),this.Je}firstUpdated(t){super.firstUpdated(t),this.zt(),this._n(),this.initEditor();let e=!!(this.uuid||this.cdnUrl),r=t.has("uuid")||t.has("cdnUrl");e&&!r&&this.updateImage();}disconnectedCallback(){this.Dn(),super.disconnectedCallback();}render(){let t=this.Un??"",e=this.Ln??"",r=this.ye||ht,o=this.Ze,n=this.Ns;return m` ${xe(is)}<div class="uc-wrapper uc-wrapper_desktop"><uc-presence-toggle class="uc-network_problems_splash" .visible=${n}><div class="uc-network_problems_content"><div class="uc-network_problems_icon"><uc-icon name="sad"></uc-icon></div><div class="uc-network_problems_text">Network error</div></div><div class="uc-network_problems_footer"><uc-btn-ui theme="primary" text="Retry" @click=${this.Nn}></uc-btn-ui></div></uc-presence-toggle><div class="uc-viewport"><div class="uc-file_type_outer"><div class="uc-file_type">${t}</div></div><div class="uc-image_container" ${k(this.Ds)}><img src=${r} class=${this.Fn} ${k(this.jt)} />${Zt(this.J,()=>m`<uc-editor-image-cropper ${k(this.$s)}></uc-editor-image-cropper>`)}<uc-editor-image-fader ${k(this._s)}></uc-editor-image-fader></div><div class="uc-info_pan">${e}</div></div><div class="uc-toolbar"><uc-line-loader-ui .active=${o}></uc-line-loader-ui><div class="uc-toolbar_content uc-toolbar_content__editor">${Zt(this.J,()=>m`<uc-editor-toolbar></uc-editor-toolbar>`)}</div></div></div>`}updated(t){super.updated(t),t.has("uuid")&&this.uuid&&this.updateImage(),t.has("cdnUrl")&&this.cdnUrl&&this.updateImage(),t.has("tabs")&&this.Vs(),(t.has("cropPreset")||t.has("cdnUrl"))&&this.zs();}Vs(){let t=this.tabs||ys;this.$["*tabList"]=ts(t);}zs(){let t=Qr(this.cropPreset??""),e=null;if(this.cdnUrl){let r=bi(this.cdnUrl),o=Ti(r);if(Array.isArray(o?.crop?.dimensions)){let[n,a]=o.crop.dimensions;e=Jr(n,a,t,.1);}}this.$["*cropPresetList"]=t,this.$["*currentAspectRatio"]=e??t?.[0]??null;}async updateImage(){if(this.isConnected){try{await this.js();}catch{return}if(this.isConnected){if(this.cdnUrl){let t=this.cdnUrl,e=Oe(t),r=vi(t,e);if(r===this.$["*originalUrl"])return;this.$["*originalUrl"]=r;let o=bi(t),n=Ti(o);this.$["*editorTransformations"]=n;}else if(this.uuid){let t=vi(this.cfg.cdnCname,this.uuid);if(t===this.$["*originalUrl"])return;this.$["*originalUrl"]=t,Object.keys(this.$["*editorTransformations"]).length>0&&(this.$["*editorTransformations"]={});}else throw new Error("No UUID nor CDN URL provided");this.$["*tabId"]===O.CROP?this.$["*cropperEl"]?.deactivate({reset:true}):this.$["*faderEl"]?.deactivate();try{let t=this.$["*originalUrl"],e=await this.proxyUrl(tt(t,J("json"))),r=await fetch(e).then(a=>a.json()),{width:o,height:n}=r;this.$["*imageSize"]={width:o,height:n},this.$["*tabId"]===O.CROP?this.$["*cropperEl"]?.activate(this.$["*imageSize"]):this.$["*faderEl"]?.activate({url:t});}catch(t){t&&(this.telemetryManager.sendEventError(t,"cloud editor image. Failed to load image info"),console.error("Failed to load image info",t));}this.$n();}}}async initEditor(){try{await this.js();}catch{return}this.classList.add("uc-editor_ON"),this.sub("*networkProblems",t=>{let e=!!t;this.Ns=e;}),this.sub("*editorTransformations",t=>{if(Object.keys(t).length===0)return;let e=this.$["*originalUrl"],r=J(ct(t),"preview"),o=tt(e,r),n={originalUrl:e,cdnUrlModifiers:r,cdnUrl:o,transformations:t};this.dispatchEvent(new CustomEvent("change",{detail:n,bubbles:true,composed:true}));},false);}};p([g()],_.prototype,"Ln",2),p([g()],_.prototype,"ye",2),p([g()],_.prototype,"Un",2),p([g()],_.prototype,"Ze",2),p([y({type:String,reflect:true})],_.prototype,"uuid",2),p([y({type:String,attribute:"cdn-url",reflect:true})],_.prototype,"cdnUrl",2),p([y({type:String,attribute:"crop-preset",reflect:true})],_.prototype,"cropPreset",2),p([y({type:String,reflect:true})],_.prototype,"tabs",2),p([g()],_.prototype,"Ns",2),p([g()],_.prototype,"J",2);var bs=class extends _{static{this.styleAttrs=[...super.styleAttrs,"uc-wgt-common"];}constructor(){super(),this.init$={...this.init$,"*solution":this.tagName};}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:st.INIT_SOLUTION}),this.a11y?.registerBlock(this);}};var dn=["UploaderBlock","ActivityBlock","Block","SolutionBlock"];function pn(s){for(let i in s){if(dn.includes(i))continue;let t=[...i].reduce((e,r)=>(r.toUpperCase()===r&&(r=`-${r.toLowerCase()}`),e+=r,e),"");t.startsWith("-")&&(t=t.replace("-","")),t.startsWith("uc-")||(t=`uc-${t}`),s[i].reg&&s[i].reg(t);}}var Ni=s=>s.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(i=>i.toLowerCase()).join("-");var vs=new Set;function Ts(s){vs.has(s)||(vs.add(s),console.warn(s));}var hn=[{test:s=>!!s.accept&&!!s.imgOnly,message:"There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list."},{test:s=>s.enableVideoRecording!==null,message:"The `enableVideoRecording` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."},{test:s=>s.defaultCameraMode!==null,message:"The `defaultCameraMode` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."}],ws=U(s=>{for(let{test:i,message:t}of hn)i(s)&&Ts(t);},0);var Cs=(s,i)=>{let t=new URL(i);return t.hostname=`${s}.${t.hostname}`,t.toString().replace(/\/$/,"")},fn="0123456789abcdefghijklmnopqrstuvwxyz",xs=s=>{if(s<=0n)return "0";let i="";for(;s>0n;){let t=s%36n;i=fn[Number(t)]+i,s=s/36n;}return i},_i=(s,i)=>{try{let t=new URL(s),e=new URL(i);return t.hostname.endsWith(e.hostname)}catch{return false}};var mn=async s=>{let i=new TextEncoder().encode(s),t=await window.crypto.subtle.digest("SHA-256",i),e=Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("");return BigInt(`0x${e}`)},gn=10,yn=async s=>{let i=await mn(s);return xs(i).slice(0,gn)},Es=async(s,i)=>{let t=await yn(s);return Cs(t,i)};var Ss=s=>s instanceof Promise||!!(s&&typeof s=="object"&&"then"in s&&typeof s.then=="function");var Di=s=>s,bn=[Di({key:"cameraModes",deps:["enableVideoRecording"],fn:({cameraModes:s,enableVideoRecording:i})=>{let t=i();if(t===null)return s();let e=St(s());return t&&!e.includes("video")?e=e.concat("video"):t||(e=e.filter(r=>r!=="video")),kt(e)}}),Di({key:"cameraModes",deps:["defaultCameraMode"],fn:({cameraModes:s,defaultCameraMode:i})=>{let t=i();if(t===null)return s();let e=St(s());return e=e.sort((r,o)=>r===t?-1:o===t?1:0),kt(e)}}),Di({key:"cdnCname",deps:["pubkey","cdnCnamePrefixed"],fn:({pubkey:s,cdnCname:i,cdnCnamePrefixed:t})=>{let e=s(),r=i(),o=t();return e&&(r===wi||_i(r,o))?Es(e,o):r}})],ks=({key:s,setValue:i,getValue:t,computationControllers:e})=>{for(let r of bn){if(!r.deps.includes(s))continue;let o={[r.key]:()=>t(r.key)};for(let l of r.deps)o[l]=()=>t(l);let n=new AbortController;e.get(r.fn)?.abort(),e.set(r.fn,n);let a;try{a=r.fn(o,{signal:n.signal});}catch(l){e.get(r.fn)===n&&e.delete(r.fn),console.error(`Failed to compute value for "${r.key}"`,l);return}Ss(a)?a.then(l=>{n.signal.aborted||i(r.key,l);}).catch(l=>{n.signal.aborted||console.error(`Failed to compute value for "${r.key}"`,l);}).finally(()=>{e.get(r.fn)===n&&e.delete(r.fn);}):i(r.key,a);}};var Fi=Object.freeze({PHOTO:"photo",VIDEO:"video"});var x=s=>String(s),M=s=>{let i=Number(s);if(Number.isNaN(i))throw new Error(`Invalid number: "${s}"`);return i},S=s=>{if(typeof s>"u"||s===null)return false;if(typeof s=="boolean")return s;if(s==="true"||s==="")return true;if(s==="false")return false;throw new Error(`Invalid boolean: "${s}"`)},Os=s=>s==="auto"?s:S(s),As=s=>{let i=x(s);if(i!=="user"&&i!=="environment"&&i!=="")throw new Error(`Invalid value: "${i}"`);return i},Ps=s=>{let i=x(s);if(!Object.values(Fi).includes(i))throw new Error(`Invalid value: "${i}"`);return i},Rs=s=>{let i=x(s),t=St(i);if(t.some(e=>!Object.values(Fi).includes(e)))throw new Error(`Invalid value: "${JSON.stringify(t)}"`);return i},Ms=s=>{let i=x(s);if(i==="local"||i==="global")return i;if(S(s)===false)return false;throw new Error(`Invalid value: "${i}"`)},Ls=s=>{if(typeof s=="object"&&!Array.isArray(s)||typeof s=="function")return s;throw new Error("Invalid metadata value. Must be an object or function.")},Ki=s=>{if(typeof s=="object")return s;throw new Error("Invalid value. Must be an object.")},ri=s=>{if(typeof s=="function")return s;throw new Error("Invalid value. Must be a function.")},si=s=>{if(Array.isArray(s))return s;throw new Error("Must be an array.")},Is=s=>{let i=x(s);if(["grid","list"].includes(i))return i;throw new Error(`Invalid value: "${i}"`)};var vn={pubkey:x,multiple:S,multipleMin:M,multipleMax:M,confirmUpload:S,imgOnly:S,accept:x,externalSourcesPreferredTypes:x,externalSourcesEmbedCss:x,store:Os,cameraMirror:S,cameraCapture:As,sourceList:x,topLevelOrigin:x,maxLocalFileSizeBytes:M,thumbSize:M,showEmptyList:S,useLocalImageEditor:S,useCloudImageEditor:S,cloudImageEditorTabs:x,removeCopyright:S,cropPreset:x,imageShrink:x,modalScrollLock:S,modalBackdropStrokes:S,sourceListWrap:S,remoteTabSessionKey:x,cdnCname:x,cdnCnamePrefixed:x,baseUrl:x,socialBaseUrl:x,secureSignature:x,secureExpire:x,secureDeliveryProxy:x,retryThrottledRequestMaxTimes:M,retryNetworkErrorMaxTimes:M,multipartMinFileSize:M,multipartChunkSize:M,maxConcurrentRequests:M,multipartMaxConcurrentRequests:M,multipartMaxAttempts:M,checkForUrlDuplicates:S,saveUrlForRecurrentUploads:S,groupOutput:S,userAgentIntegration:x,debug:S,localeName:x,metadata:Ls,secureUploadsExpireThreshold:M,localeDefinitionOverride:s=>Ki(s),secureUploadsSignatureResolver:s=>ri(s),secureDeliveryProxyUrlResolver:s=>ri(s),iconHrefResolver:s=>ri(s),plugins:s=>si(s),fileValidators:si,collectionValidators:si,validationTimeout:M,validationConcurrency:M,cameraModes:Rs,defaultCameraMode:Ps,enableAudioRecording:S,enableVideoRecording:S,mediaRecorderOptions:Ki,maxVideoRecordingDuration:M,filesViewMode:Is,gridShowFileNames:S,cloudImageEditorAutoOpen:S,cloudImageEditorMaskHref:x,testMode:S,qualityInsights:S,pasteScope:Ms},$s=(s,i)=>{if(!(typeof i>"u"||i===null))try{return vn[s](i)}catch(t){return console.error(`Invalid value for config key "${s}".`,t),R[s]}};var oi=[...new Set(["debug",...Object.keys(R)])],Tn=["metadata","plugins","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators","mediaRecorderOptions"],Ns=s=>Tn.includes(s),zi=oi.filter(s=>!Ns(s)),Vi={...Object.fromEntries(zi.map(s=>[Ni(s),s])),...Object.fromEntries(zi.map(s=>[s.toLowerCase(),s]))},Us=s=>`__${s}`,ni=class extends C{constructor(){super(...arguments);this.init$={...this.init$,...Object.fromEntries(Object.entries(R).map(([t,e])=>[T(t),e]))};this.Kn=new Map;this.Bt={};this.Hs=new Set;this.Le=new Map;}Qi(t){return this.Hs.has(t)}Bs(t){let e=this.n.pluginManager;if(e)return e.configRegistry.get(t)}Gs(t){return [...new Set([Ni(t),t.toLowerCase()])]}Vn(t,e){if(Ns(t)||this.Qi(t)&&this.Bs(t)?.attribute===false)return;let r=this.Gs(t);for(let o of r)typeof e>"u"||e===null?this.removeAttribute(o):this.getAttribute(o)!==e.toString()&&this.setAttribute(o,e.toString());}zn(t,e){let r=T(t);if(this.$[r]!==e)if(typeof e>"u"||e===null){let o=R[t];this.$[r]=o!==void 0?o:e;}else this.$[r]=e;}Te(t,e){let r;this.Qi(t)?r=this.Bs(t)?.normalize?.(e)??e:r=$s(t,e);let o=this,n=Us(t);o[n]!==r&&(this.jn(t,o[n],r),o[n]=r,this.Vn(t,r),this.zn(t,r),this.debugPrint(`"${t}"`,r),this.Qi(t)||ws(this.cfg));}Gt(t){let e=this,r=Us(t);return e[r]??this.$[T(t)]}jn(t,e,r){this.cfg.debug&&r!==e&&typeof r=="object"&&typeof e=="object"&&JSON.stringify(r)===JSON.stringify(e)&&(console.warn(`[uc-config] Option "${t}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${t}" previous value:`,e),console.warn(`[uc-config] "${t}" new value:`,r));}qs(t){let e=t.configRegistry.getAll();this.Bt={},this.Hs=new Set(e.keys());for(let[r,o]of this.Le)e.has(r)||(o(),this.Le.delete(r));for(let[r,o]of e){let a=T(r);if(o.attribute){let c=this.Gs(r);for(let d of c)this.Bt[d]=r;}this.sharedCtx.has(a)||this.sharedCtx.add(a,o.defaultValue);let l=Object.getOwnPropertyDescriptor(this,r);if((!l||!l.set||!l.get)&&Object.defineProperty(this,r,{set:c=>{this.Te(r,c);},get:()=>this.Gt(r),enumerable:true,configurable:true}),!this.Le.has(r)){let c=this.sub(a,d=>{this.Te(r,d);},false);this.Le.set(r,c);}}}Hn(){this.n.when("pluginManager",t=>{this.qs(t),this.Ht=t.onPluginsChange(()=>{this.qs(t);});});}Bn(){this.et=new MutationObserver(t=>{for(let e of t)if(e.type==="attributes"&&e.attributeName){let r=e.attributeName,o=e.oldValue,n=this.getAttribute(r);if(o===n||r in Vi)continue;r in this.Bt&&this.attributeChangedCallback(r,o??"",n??"");}}),this.et.observe(this,{attributes:true,attributeOldValue:true});}initCallback(){super.initCallback();let t=this;this.Hn(),this.Bn();for(let r of zi)this.sub(T(r),o=>{this.Te(r,o);},false);for(let r of oi){let o=t[r]??this.$[T(r)];o!==R[r]&&this.Te(r,o);let n=Object.getOwnPropertyDescriptor(this,r);(!n||!n.set||!n.get)&&Object.defineProperty(this,r,{set:a=>{this.Te(r,a);},get:()=>this.Gt(r)});}let e=r=>{ks({key:r,setValue:this.Te.bind(this),getValue:this.Gt.bind(this),computationControllers:this.Kn});};for(let r of oi)this.sub(T(r),()=>e(r));}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),e===r)return;let o=this,n=Vi[t];n?o[n]=r:this.n.when("pluginManager",a=>{if(this.getAttribute(t)!==r)return;let l=this.Bt[t],c=l?a.configRegistry.get(l):void 0;if(l&&c){let d=c.fromAttribute?c.fromAttribute(r):r;if(this.Gt(l)===d)return;this.Te(l,d);}});}disconnectedCallback(){super.disconnectedCallback(),this.Ht&&(this.Ht(),this.Ht=void 0),this.et&&(this.et.disconnect(),this.et=void 0);for(let t of this.Le.values())t();this.Le.clear();}static get observedAttributes(){let t=super.observedAttributes,e=Object.keys(Vi);return [...t,...e]}};for(let s of oi)ni.prototype[s]=void 0;/*! For license information please see uc-cloud-image-editor.min.js.LEGAL.txt */
|
|
8
|
+
export{q as BtnUi,bs as CloudImageEditor,_ as CloudImageEditorBlock,ni as Config,We as CropFrame,Je as EditorAspectRatioButtonControl,ti as EditorCropButtonControl,yt as EditorFilterControl,Ui as EditorFreeformButtonControl,Xe as EditorImageCropper,$i as EditorImageFader,ei as EditorOperationControl,ii as EditorScroller,Ye as EditorSlider,z as EditorToolbar,Nt as Icon,Ge as LineLoaderUi,se as PresenceToggle,nt as SliderUi,pn as defineComponents};
|