isometrik-plugin-chat-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/BlockChatList-720a703e.js +423 -0
- package/dist/cjs/BlockChatList-720a703e.js.map +1 -0
- package/dist/cjs/DocumentMessageBubble-c79bfbe5.js +493 -0
- package/dist/cjs/DocumentMessageBubble-c79bfbe5.js.map +1 -0
- package/dist/cjs/Image-67c52acd.js +135 -0
- package/dist/cjs/Image-67c52acd.js.map +1 -0
- package/dist/cjs/ImageMessageBubble-1218fb66.js +675 -0
- package/dist/cjs/ImageMessageBubble-1218fb66.js.map +1 -0
- package/dist/cjs/IsometrikLogo-976b1c34.js +44 -0
- package/dist/cjs/IsometrikLogo-976b1c34.js.map +1 -0
- package/dist/cjs/MessageSearch-5fc9dc00.js +5892 -0
- package/dist/cjs/MessageSearch-5fc9dc00.js.map +1 -0
- package/dist/cjs/ReactionsContainer-a6ce9059.js +375 -0
- package/dist/cjs/ReactionsContainer-a6ce9059.js.map +1 -0
- package/dist/cjs/Text-fedf6eab.js +60 -0
- package/dist/cjs/Text-fedf6eab.js.map +1 -0
- package/dist/cjs/VideoMessageBubble-c4694a78.js +571 -0
- package/dist/cjs/VideoMessageBubble-c4694a78.js.map +1 -0
- package/dist/cjs/WebChat-403e7ab1.js +2884 -0
- package/dist/cjs/WebChat-403e7ab1.js.map +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/audio-bubble_8.cjs.entry.js +21011 -0
- package/dist/cjs/audio-bubble_8.cjs.entry.js.map +1 -0
- package/dist/cjs/block-chat-list.cjs.entry.js +16 -0
- package/dist/cjs/block-chat-list.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-app.cjs.entry.js +55 -0
- package/dist/cjs/chat-app.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-assets-6ab1faa6.js +9 -0
- package/dist/cjs/chat-assets-6ab1faa6.js.map +1 -0
- package/dist/cjs/chat-creds-f4cbf400.js +38 -0
- package/dist/cjs/chat-creds-f4cbf400.js.map +1 -0
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js +24 -0
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js +26 -0
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js +24 -0
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js.map +1 -0
- package/dist/cjs/content-eca5336c.js +81 -0
- package/dist/cjs/content-eca5336c.js.map +1 -0
- package/dist/cjs/dialog-drawer-9d04911c.js +5313 -0
- package/dist/cjs/dialog-drawer-9d04911c.js.map +1 -0
- package/dist/cjs/forward-memebers.cjs.entry.js +128 -0
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -0
- package/dist/cjs/group-members-a60fb1cb.js +41 -0
- package/dist/cjs/group-members-a60fb1cb.js.map +1 -0
- package/dist/cjs/groupcast-49dae5ab.js +202 -0
- package/dist/cjs/groupcast-49dae5ab.js.map +1 -0
- package/dist/cjs/imagePlaceholder-030cc566.js +4365 -0
- package/dist/cjs/imagePlaceholder-030cc566.js.map +1 -0
- package/dist/cjs/index-9afe62b6.js +3129 -0
- package/dist/cjs/index-9afe62b6.js.map +1 -0
- package/dist/cjs/index.cjs.js +148 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/isometrik-webchat.cjs.js +54 -0
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/login-page.cjs.entry.js +85 -0
- package/dist/cjs/login-page.cjs.entry.js.map +1 -0
- package/dist/cjs/member-add.cjs.entry.js +122 -0
- package/dist/cjs/member-add.cjs.entry.js.map +1 -0
- package/dist/cjs/message-reaction-976f6261.js +24 -0
- package/dist/cjs/message-reaction-976f6261.js.map +1 -0
- package/dist/cjs/my-component.cjs.entry.js +29 -0
- package/dist/cjs/my-component.cjs.entry.js.map +1 -0
- package/dist/cjs/reaction-container.cjs.entry.js +52 -0
- package/dist/cjs/reaction-container.cjs.entry.js.map +1 -0
- package/dist/cjs/shadow-css-7c4dbc43.js +336 -0
- package/dist/cjs/shadow-css-7c4dbc43.js.map +1 -0
- package/dist/cjs/signup-page.cjs.entry.js +143 -0
- package/dist/cjs/signup-page.cjs.entry.js.map +1 -0
- package/dist/cjs/taguser-aca04ed9.js +512 -0
- package/dist/cjs/taguser-aca04ed9.js.map +1 -0
- package/dist/cjs/theme-provider_2.cjs.entry.js +113 -0
- package/dist/cjs/theme-provider_2.cjs.entry.js.map +1 -0
- package/dist/cjs/toast-helper-defae4a5.js +84 -0
- package/dist/cjs/toast-helper-defae4a5.js.map +1 -0
- package/dist/cjs/utils-bcad3386.js +9 -0
- package/dist/cjs/utils-bcad3386.js.map +1 -0
- package/dist/collection/api/conversations.js +12 -0
- package/dist/collection/api/group-members.js +36 -0
- package/dist/collection/api/groupcast.js +183 -0
- package/dist/collection/api/membership-control.js +13 -0
- package/dist/collection/api/message-reaction.js +16 -0
- package/dist/collection/api/social-accounts.js +282 -0
- package/dist/collection/app-root.js +51 -0
- package/dist/collection/app-root.js.map +1 -0
- package/dist/collection/assets/images/avatar.svg +1 -0
- package/dist/collection/assets/images/chatdefaultbg.svg +6140 -0
- package/dist/collection/assets/images/equalizer.svg +1 -0
- package/dist/collection/assets/images/imagePlaceholder.svg +2 -0
- package/dist/collection/assets/images/link.svg +1 -0
- package/dist/collection/assets/images/videoPlaceholder.svg +4 -0
- package/dist/collection/assets/images/videoThumbnail.svg +1 -0
- package/dist/collection/assets/svg/ExcelDocument.js +2 -0
- package/dist/collection/assets/svg/IsometrikLogo.js +38 -0
- package/dist/collection/assets/svg/Moon.svg +1 -0
- package/dist/collection/assets/svg/NoChatPlaceholder.js +16 -0
- package/dist/collection/assets/svg/NoContactsPlaceholder.js +9 -0
- package/dist/collection/assets/svg/NoMessagePlaceholder.svg +13 -0
- package/dist/collection/assets/svg/PdfDocument.js +2 -0
- package/dist/collection/assets/svg/ProfilePlaceholder.js +1 -0
- package/dist/collection/assets/svg/SelectChatPlaceholder.js +13 -0
- package/dist/collection/assets/svg/Sun.svg +1 -0
- package/dist/collection/assets/svg/broadcast-selected.svg +4 -0
- package/dist/collection/assets/svg/broadcst-default.svg +4 -0
- package/dist/collection/assets/svg/close.svg +1 -0
- package/dist/collection/assets/svg/group.svg +7 -0
- package/dist/collection/assets/svg/login.svg +3051 -0
- package/dist/collection/assets/svg/message-add.svg +5 -0
- package/dist/collection/assets/svg/message-bold.svg +3 -0
- package/dist/collection/assets/svg/message-outline.svg +5 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/ChatUIComponent/AddMember.js +144 -0
- package/dist/collection/components/ChatUIComponent/AddMember.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/AudioBubble.js +528 -0
- package/dist/collection/components/ChatUIComponent/AudioBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/BlockChatList.js +114 -0
- package/dist/collection/components/ChatUIComponent/BlockChatList.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js +540 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/profile-page.css +252 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +1175 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +11 -0
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +790 -0
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ForwardMessageList.js +152 -0
- package/dist/collection/components/ChatUIComponent/ForwardMessageList.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/GroupCast.js +218 -0
- package/dist/collection/components/ChatUIComponent/GroupCast.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +590 -0
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js +103 -0
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +1352 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/WebChatBody/web-chat-body.css +277 -0
- package/dist/collection/components/Login.js +118 -0
- package/dist/collection/components/Login.js.map +1 -0
- package/dist/collection/components/Signup.js +177 -0
- package/dist/collection/components/Signup.js.map +1 -0
- package/dist/collection/components/chat-main.js +131 -0
- package/dist/collection/components/chat-main.js.map +1 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +83 -0
- package/dist/collection/components/my-component/my-component.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/WebChat.js +2686 -0
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js +675 -0
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/web-chat.css +336 -0
- package/dist/collection/components/theme-provider.js +182 -0
- package/dist/collection/components/theme-provider.js.map +1 -0
- package/dist/collection/constants/chat-assets.js +12 -0
- package/dist/collection/constants/chat-creds.js +31 -0
- package/dist/collection/constants/content.js +75 -0
- package/dist/collection/constants/urls.js +1 -0
- package/dist/collection/index.js +135 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/lib/helpers.js +205 -0
- package/dist/collection/lib/taguser.js +123 -0
- package/dist/collection/store/conversation.js +25 -0
- package/dist/collection/store/conversation.js.map +1 -0
- package/dist/collection/store/group-members.js +24 -0
- package/dist/collection/store/group-members.js.map +1 -0
- package/dist/collection/store/unread-count.js +18 -0
- package/dist/collection/store/unread-count.js.map +1 -0
- package/dist/collection/stories/Components/ActionsPopup/ActionsPopup.js +222 -0
- package/dist/collection/stories/Components/ActionsPopup/ActionsPopup.stories.js +148 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentBox.js +211 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentPreview/AttachmentPreview.js +708 -0
- package/dist/collection/stories/Components/AttachmentBox/AttachmentPreview/AttachmentPreview.stories.js +57 -0
- package/dist/collection/stories/Components/AttachmentBox/Attachmentbox.stories.js +74 -0
- package/dist/collection/stories/Components/AttachmentBox/CameraPreview.js +231 -0
- package/dist/collection/stories/Components/BlockUsers/BlockUsers.js +337 -0
- package/dist/collection/stories/Components/Body/Body.js +48 -0
- package/dist/collection/stories/Components/Body/Body.stories.js +33 -0
- package/dist/collection/stories/Components/Buttons/Buttons.js +65 -0
- package/dist/collection/stories/Components/Buttons/Buttons.stories.js +132 -0
- package/dist/collection/stories/Components/ChatSidebar/ChatSidebar.js +951 -0
- package/dist/collection/stories/Components/ChatSidebar/ChatSidebar.stories.js +75 -0
- package/dist/collection/stories/Components/ChatSidebar/ContextMenu.js +109 -0
- package/dist/collection/stories/Components/ChatTile/ChatTile.js +290 -0
- package/dist/collection/stories/Components/ChatTile/ChatTile.stories.js +180 -0
- package/dist/collection/stories/Components/Chip/Chip.js +111 -0
- package/dist/collection/stories/Components/Chip/Chip.stories.js +149 -0
- package/dist/collection/stories/Components/ContactInfo/ContactInfo.js +1491 -0
- package/dist/collection/stories/Components/ContactInfo/ContactInfo.stories.js +118 -0
- package/dist/collection/stories/Components/ContactInfo/MediaList.js +147 -0
- package/dist/collection/stories/Components/ContactInfo/ProfileInfo.js +1219 -0
- package/dist/collection/stories/Components/ContactTile/ContactTile.js +416 -0
- package/dist/collection/stories/Components/ContactTile/ContactTile.stories.js +60 -0
- package/dist/collection/stories/Components/Dialog-Drawer/confirm.js +113 -0
- package/dist/collection/stories/Components/Dialog-Drawer/deletemessage.js +97 -0
- package/dist/collection/stories/Components/Dialog-Drawer/dialog-drawer.js +264 -0
- package/dist/collection/stories/Components/EmojiReactions/EmojiReactions.js +179 -0
- package/dist/collection/stories/Components/Footer/Footer.js +4 -0
- package/dist/collection/stories/Components/Footer/Footer.stories.js +155 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardMessageContainer.js +433 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardMessageContainer.stories.js +110 -0
- package/dist/collection/stories/Components/ForwardMessage/ForwardUi.js +46 -0
- package/dist/collection/stories/Components/GroupChatContacts/GroupChatContacts.js +546 -0
- package/dist/collection/stories/Components/GroupChatContacts/GroupChatContacts.stories.js +56 -0
- package/dist/collection/stories/Components/GroupInfo/GroupInfo.js +394 -0
- package/dist/collection/stories/Components/GroupInfo/GroupInfo.stories.js +107 -0
- package/dist/collection/stories/Components/Head/ClosedHeader/ClosedHead.js +129 -0
- package/dist/collection/stories/Components/Head/ClosedHeader/ClosedHead.stories.js +78 -0
- package/dist/collection/stories/Components/Head/Head.js +672 -0
- package/dist/collection/stories/Components/Head/Head.stories.js +91 -0
- package/dist/collection/stories/Components/Icon/Icon.js +115 -0
- package/dist/collection/stories/Components/Image/Image.js +41 -0
- package/dist/collection/stories/Components/Image/Image.stories.js +49 -0
- package/dist/collection/stories/Components/Image/Img.stories.js +178 -0
- package/dist/collection/stories/Components/Inputbox/Input.js +206 -0
- package/dist/collection/stories/Components/Inputbox/Input.stories.js +87 -0
- package/dist/collection/stories/Components/InstagramAccounts/InstagramAccountsPanel.js +605 -0
- package/dist/collection/stories/Components/Loader/Spinner/Spinner.js +60 -0
- package/dist/collection/stories/Components/Loader/Spinner/Spinner.stories.js +38 -0
- package/dist/collection/stories/Components/MainPlaceHolder/MainChatPlaceHolder.js +78 -0
- package/dist/collection/stories/Components/MainPlaceHolder/MainPlaceHolder.stories.js +130 -0
- package/dist/collection/stories/Components/MediaGallery/MediaGallery.js +868 -0
- package/dist/collection/stories/Components/MediaGallery/MediaGallery.stories.js +81 -0
- package/dist/collection/stories/Components/MembersList/MembersList.js +348 -0
- package/dist/collection/stories/Components/MessageBubble/AudioMessageBubble/AudioMesaageBubble.js +533 -0
- package/dist/collection/stories/Components/MessageBubble/DocumentMessageBubble/DocumentMessageBubble.js +484 -0
- package/dist/collection/stories/Components/MessageBubble/DocumentMessageBubble/DocumentMessageBubble.stories.js +54 -0
- package/dist/collection/stories/Components/MessageBubble/ImageMessageBubble/ImageMessageBubble.js +683 -0
- package/dist/collection/stories/Components/MessageBubble/ImageMessageBubble/ImageMessageBubble.stories.js +49 -0
- package/dist/collection/stories/Components/MessageBubble/IncomingTextMessageBubble/IncomingTextMessageBubble.js +450 -0
- package/dist/collection/stories/Components/MessageBubble/IncomingTextMessageBubble/IncomingTextMessageBubble.stories.js +56 -0
- package/dist/collection/stories/Components/MessageBubble/LinkMessageBubble/LinkMessageBubble.js +721 -0
- package/dist/collection/stories/Components/MessageBubble/OutgoingTextMessageBubble/OutgoingTextMessageBubble.js +139 -0
- package/dist/collection/stories/Components/MessageBubble/OutgoingTextMessageBubble/OutgoingTextMessageBubble.stories.js +63 -0
- package/dist/collection/stories/Components/MessageBubble/VideoMessageBubble/VideoMessageBubble.js +576 -0
- package/dist/collection/stories/Components/MessageBubble/VideoMessageBubble/VideoMessageBubble.stories.js +50 -0
- package/dist/collection/stories/Components/MessageDatePill/MessageDatePill.js +66 -0
- package/dist/collection/stories/Components/MessageDatePill/MessageDatePill.stories.js +48 -0
- package/dist/collection/stories/Components/MessageInfo/MessageInfo.js +465 -0
- package/dist/collection/stories/Components/MessageInfo/MessageInfo.stories.js +111 -0
- package/dist/collection/stories/Components/MessageSearch/MessageSearch.js +242 -0
- package/dist/collection/stories/Components/MessageSearchBar/SearchBar.js +523 -0
- package/dist/collection/stories/Components/MessageSearchBar/SearchBar.stories.js +98 -0
- package/dist/collection/stories/Components/MessageUnreadCount/MessageUnreadCount.js +51 -0
- package/dist/collection/stories/Components/MessageUnreadCount/MessageUnreadCount.stories.js +79 -0
- package/dist/collection/stories/Components/NewChatSidebar/NewChatSidebar.js +560 -0
- package/dist/collection/stories/Components/NewChatSidebar/NewChatSidebar.stories.js +56 -0
- package/dist/collection/stories/Components/Placeholder/NoContactsPlaceholder.js +57 -0
- package/dist/collection/stories/Components/Popup/ConfirmationPopup/DeleteConfirmationPopup/DeletePopup.js +114 -0
- package/dist/collection/stories/Components/ProfileSidebar/ProfileSidebar.js +166 -0
- package/dist/collection/stories/Components/ProfileSidebar/ProfileSidebar.stories.js +125 -0
- package/dist/collection/stories/Components/ProfileTab/ProfileTab.js +939 -0
- package/dist/collection/stories/Components/ProfileTab/ProfileTab.stories.js +144 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsContainer.js +166 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsContainer.stories.js +115 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsInfoCard/ReactionsInfoCard.js +98 -0
- package/dist/collection/stories/Components/ReactionsContainer/ReactionsInfoCard/ReactionsInfoCard.stories.js +55 -0
- package/dist/collection/stories/Components/ReadMark/BlueReadMark/BlueReadMark.js +27 -0
- package/dist/collection/stories/Components/ReadMark/BlueReadMark/BlueReadMark.stories.js +28 -0
- package/dist/collection/stories/Components/ReadMark/ClockMark/ClockMark.js +26 -0
- package/dist/collection/stories/Components/ReadMark/ClockMark/ClockMark.stories.js +33 -0
- package/dist/collection/stories/Components/ReadMark/DoubleMark/DoubleMark.js +27 -0
- package/dist/collection/stories/Components/ReadMark/DoubleMark/DoubleMark.stories.js +28 -0
- package/dist/collection/stories/Components/ReadMark/SingleMark/SingleMark.js +38 -0
- package/dist/collection/stories/Components/ReadMark/SingleMark/SingleMark.stories.js +33 -0
- package/dist/collection/stories/Components/ReplyBlock/MediaIcons.js +16 -0
- package/dist/collection/stories/Components/ReplyBlock/ReplyBlock.js +196 -0
- package/dist/collection/stories/Components/ReplyBlock/ReplyBlock.stories.js +57 -0
- package/dist/collection/stories/Components/ReplyMessageContainer/ReplyMessageContainer.js +645 -0
- package/dist/collection/stories/Components/ReplyMessageContainer/ReplyMessageContainer.stories.js +58 -0
- package/dist/collection/stories/Components/SearchableList/SearchableList.js +393 -0
- package/dist/collection/stories/Components/SearchableList/SearchableList.stories.js +65 -0
- package/dist/collection/stories/Components/SharePopup/SharePopup.js +152 -0
- package/dist/collection/stories/Components/SharePopup/SharePopup.stories.js +47 -0
- package/dist/collection/stories/Components/Splitscreen/Splitscreen.js +157 -0
- package/dist/collection/stories/Components/Splitscreen/Splitscreen.stories.js +100 -0
- package/dist/collection/stories/Components/TestFooter/MentionUserList.js +194 -0
- package/dist/collection/stories/Components/TestFooter/TestFooter.js +1339 -0
- package/dist/collection/stories/Components/TestFooter/TestFooter.stories.js +89 -0
- package/dist/collection/stories/Components/Text/Text.js +57 -0
- package/dist/collection/stories/Components/Text/Text.stories.js +83 -0
- package/dist/collection/stories/Components/TextStyle/TextStyle.js +38 -0
- package/dist/collection/stories/Components/TextStyle/TextStyle.stories.js +50 -0
- package/dist/collection/stories/Components/Time/Timestamp.js +50 -0
- package/dist/collection/stories/Components/Time/Timestamp.stories.js +34 -0
- package/dist/collection/stories/Components/Toaster/Toaster.js +94 -0
- package/dist/collection/stories/Components/Toaster/Toaster.stories.js +108 -0
- package/dist/collection/stories/Components/Toaster/toast-helper.js +79 -0
- package/dist/collection/stories/Components/Toaster/toast-helper.js.map +1 -0
- package/dist/collection/stories/Components/final/final.js +86 -0
- package/dist/collection/stories/Components/final/final.stories.js +30 -0
- package/dist/collection/stories/assets/SEARCH ICON.svg +1 -0
- package/dist/collection/types/ConversationDetailsTypes.js +2 -0
- package/dist/collection/types/ConversationDetailsTypes.js.map +1 -0
- package/dist/collection/utils/chatSdk.js +14 -0
- package/dist/collection/utils/getFomattedDate.js +34 -0
- package/dist/collection/utils/getFomattedDate.js.map +1 -0
- package/dist/collection/utils/unixTimeConverter.js +28 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/esm/BlockChatList-9fc3a42b.js +421 -0
- package/dist/esm/BlockChatList-9fc3a42b.js.map +1 -0
- package/dist/esm/DocumentMessageBubble-b67726f2.js +491 -0
- package/dist/esm/DocumentMessageBubble-b67726f2.js.map +1 -0
- package/dist/esm/Image-bb9efda3.js +121 -0
- package/dist/esm/Image-bb9efda3.js.map +1 -0
- package/dist/esm/ImageMessageBubble-0e473f6e.js +673 -0
- package/dist/esm/ImageMessageBubble-0e473f6e.js.map +1 -0
- package/dist/esm/IsometrikLogo-14db76af.js +42 -0
- package/dist/esm/IsometrikLogo-14db76af.js.map +1 -0
- package/dist/esm/MessageSearch-4101a627.js +5875 -0
- package/dist/esm/MessageSearch-4101a627.js.map +1 -0
- package/dist/esm/ReactionsContainer-bdd74a3c.js +373 -0
- package/dist/esm/ReactionsContainer-bdd74a3c.js.map +1 -0
- package/dist/esm/Text-3b0b3898.js +58 -0
- package/dist/esm/Text-3b0b3898.js.map +1 -0
- package/dist/esm/VideoMessageBubble-88a7a53e.js +569 -0
- package/dist/esm/VideoMessageBubble-88a7a53e.js.map +1 -0
- package/dist/esm/WebChat-5448d615.js +2882 -0
- package/dist/esm/WebChat-5448d615.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/audio-bubble_8.entry.js +21001 -0
- package/dist/esm/audio-bubble_8.entry.js.map +1 -0
- package/dist/esm/block-chat-list.entry.js +8 -0
- package/dist/esm/block-chat-list.entry.js.map +1 -0
- package/dist/esm/chat-app.entry.js +51 -0
- package/dist/esm/chat-app.entry.js.map +1 -0
- package/dist/esm/chat-assets-bd8778d5.js +6 -0
- package/dist/esm/chat-assets-bd8778d5.js.map +1 -0
- package/dist/esm/chat-creds-ff086f05.js +35 -0
- package/dist/esm/chat-creds-ff086f05.js.map +1 -0
- package/dist/esm/chat-document-message-bubble.entry.js +20 -0
- package/dist/esm/chat-document-message-bubble.entry.js.map +1 -0
- package/dist/esm/chat-image-message-bubble.entry.js +22 -0
- package/dist/esm/chat-image-message-bubble.entry.js.map +1 -0
- package/dist/esm/chat-video-message-bubble.entry.js +20 -0
- package/dist/esm/chat-video-message-bubble.entry.js.map +1 -0
- package/dist/esm/content-5aea5e39.js +79 -0
- package/dist/esm/content-5aea5e39.js.map +1 -0
- package/dist/esm/dialog-drawer-9fa083b1.js +5304 -0
- package/dist/esm/dialog-drawer-9fa083b1.js.map +1 -0
- package/dist/esm/forward-memebers.entry.js +124 -0
- package/dist/esm/forward-memebers.entry.js.map +1 -0
- package/dist/esm/group-members-bb3c8db7.js +37 -0
- package/dist/esm/group-members-bb3c8db7.js.map +1 -0
- package/dist/esm/groupcast-d1c54a27.js +187 -0
- package/dist/esm/groupcast-d1c54a27.js.map +1 -0
- package/dist/esm/imagePlaceholder-e544f70b.js +4360 -0
- package/dist/esm/imagePlaceholder-e544f70b.js.map +1 -0
- package/dist/esm/index-fddf30b7.js +3093 -0
- package/dist/esm/index-fddf30b7.js.map +1 -0
- package/dist/esm/index.js +139 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isometrik-webchat.js +49 -0
- package/dist/esm/isometrik-webchat.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/login-page.entry.js +81 -0
- package/dist/esm/login-page.entry.js.map +1 -0
- package/dist/esm/member-add.entry.js +118 -0
- package/dist/esm/member-add.entry.js.map +1 -0
- package/dist/esm/message-reaction-ad47ea1a.js +20 -0
- package/dist/esm/message-reaction-ad47ea1a.js.map +1 -0
- package/dist/esm/my-component.entry.js +25 -0
- package/dist/esm/my-component.entry.js.map +1 -0
- package/dist/esm/reaction-container.entry.js +48 -0
- package/dist/esm/reaction-container.entry.js.map +1 -0
- package/dist/esm/shadow-css-7ad5caf8.js +334 -0
- package/dist/esm/shadow-css-7ad5caf8.js.map +1 -0
- package/dist/esm/signup-page.entry.js +139 -0
- package/dist/esm/signup-page.entry.js.map +1 -0
- package/dist/esm/taguser-e9032d65.js +510 -0
- package/dist/esm/taguser-e9032d65.js.map +1 -0
- package/dist/esm/theme-provider_2.entry.js +108 -0
- package/dist/esm/theme-provider_2.entry.js.map +1 -0
- package/dist/esm/toast-helper-840fd8dc.js +82 -0
- package/dist/esm/toast-helper-840fd8dc.js.map +1 -0
- package/dist/esm/utils-11fcde98.js +7 -0
- package/dist/esm/utils-11fcde98.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/isometrik-webchat/index.esm.js +2 -0
- package/dist/isometrik-webchat/index.esm.js.map +1 -0
- package/dist/isometrik-webchat/isometrik-webchat.css +2 -0
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +2 -0
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -0
- package/dist/isometrik-webchat/p-12774661.js +2 -0
- package/dist/isometrik-webchat/p-12774661.js.map +1 -0
- package/dist/isometrik-webchat/p-12e56271.js +549 -0
- package/dist/isometrik-webchat/p-12e56271.js.map +1 -0
- package/dist/isometrik-webchat/p-1415e589.js +2 -0
- package/dist/isometrik-webchat/p-1415e589.js.map +1 -0
- package/dist/isometrik-webchat/p-18f8d210.js +13 -0
- package/dist/isometrik-webchat/p-18f8d210.js.map +1 -0
- package/dist/isometrik-webchat/p-1b2461f4.js +357 -0
- package/dist/isometrik-webchat/p-1b2461f4.js.map +1 -0
- package/dist/isometrik-webchat/p-229095d4.js +2 -0
- package/dist/isometrik-webchat/p-229095d4.js.map +1 -0
- package/dist/isometrik-webchat/p-2953d06a.entry.js +2 -0
- package/dist/isometrik-webchat/p-2953d06a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-3004a123.js +2 -0
- package/dist/isometrik-webchat/p-3004a123.js.map +1 -0
- package/dist/isometrik-webchat/p-3044698a.js +2 -0
- package/dist/isometrik-webchat/p-3044698a.js.map +1 -0
- package/dist/isometrik-webchat/p-40517d7f.js +1098 -0
- package/dist/isometrik-webchat/p-40517d7f.js.map +1 -0
- package/dist/isometrik-webchat/p-42a62cf2.js +2 -0
- package/dist/isometrik-webchat/p-42a62cf2.js.map +1 -0
- package/dist/isometrik-webchat/p-48e1d174.js +45 -0
- package/dist/isometrik-webchat/p-48e1d174.js.map +1 -0
- package/dist/isometrik-webchat/p-48e243ec.entry.js +2 -0
- package/dist/isometrik-webchat/p-48e243ec.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-4d2aca06.js +257 -0
- package/dist/isometrik-webchat/p-4d2aca06.js.map +1 -0
- package/dist/isometrik-webchat/p-610bfd8a.js +2 -0
- package/dist/isometrik-webchat/p-610bfd8a.js.map +1 -0
- package/dist/isometrik-webchat/p-674e4bb0.js +9 -0
- package/dist/isometrik-webchat/p-674e4bb0.js.map +1 -0
- package/dist/isometrik-webchat/p-8490e13d.js +192 -0
- package/dist/isometrik-webchat/p-8490e13d.js.map +1 -0
- package/dist/isometrik-webchat/p-858b0da8.entry.js +2 -0
- package/dist/isometrik-webchat/p-858b0da8.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-89108249.entry.js +5010 -0
- package/dist/isometrik-webchat/p-89108249.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-8dcdea59.js +2963 -0
- package/dist/isometrik-webchat/p-8dcdea59.js.map +1 -0
- package/dist/isometrik-webchat/p-92d0b21c.js +2 -0
- package/dist/isometrik-webchat/p-92d0b21c.js.map +1 -0
- package/dist/isometrik-webchat/p-ada9c8e8.entry.js +2 -0
- package/dist/isometrik-webchat/p-ada9c8e8.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-adbb398d.entry.js +2 -0
- package/dist/isometrik-webchat/p-adbb398d.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-b07dd267.js +2 -0
- package/dist/isometrik-webchat/p-b07dd267.js.map +1 -0
- package/dist/isometrik-webchat/p-bf0aeb22.entry.js +2 -0
- package/dist/isometrik-webchat/p-bf0aeb22.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-bfd51dd4.entry.js +2 -0
- package/dist/isometrik-webchat/p-bfd51dd4.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-c50aa410.entry.js +2 -0
- package/dist/isometrik-webchat/p-c50aa410.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-cd34448c.entry.js +2 -0
- package/dist/isometrik-webchat/p-cd34448c.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-d4b8ece6.entry.js +2 -0
- package/dist/isometrik-webchat/p-d4b8ece6.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-de8a8642.js +197 -0
- package/dist/isometrik-webchat/p-de8a8642.js.map +1 -0
- package/dist/isometrik-webchat/p-e09b32eb.js +591 -0
- package/dist/isometrik-webchat/p-e09b32eb.js.map +1 -0
- package/dist/isometrik-webchat/p-e1255160.js +2 -0
- package/dist/isometrik-webchat/p-e1255160.js.map +1 -0
- package/dist/isometrik-webchat/p-e3731295.js +274 -0
- package/dist/isometrik-webchat/p-e3731295.js.map +1 -0
- package/dist/isometrik-webchat/p-e4efea64.entry.js +2 -0
- package/dist/isometrik-webchat/p-e4efea64.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-ef6e482a.entry.js +2 -0
- package/dist/isometrik-webchat/p-ef6e482a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-f1f5d5bd.js +3 -0
- package/dist/isometrik-webchat/p-f1f5d5bd.js.map +1 -0
- package/dist/isometrik-webchat/p-ff9f3dfe.js +203 -0
- package/dist/isometrik-webchat/p-ff9f3dfe.js.map +1 -0
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +2 -0
- package/dist/loader/package.json +11 -0
- package/dist/types/app-root.d.ts +0 -0
- package/dist/types/components/ChatUIComponent/AddMember.d.ts +13 -0
- package/dist/types/components/ChatUIComponent/AudioBubble.d.ts +39 -0
- package/dist/types/components/ChatUIComponent/BlockChatList.d.ts +13 -0
- package/dist/types/components/ChatUIComponent/ChatDocumentMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/ChatImageMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/ChatOwnProfile/Profile.d.ts +42 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +85 -0
- package/dist/types/components/ChatUIComponent/ChatVideoMessageBubble.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +154 -0
- package/dist/types/components/ChatUIComponent/ForwardMessageList.d.ts +15 -0
- package/dist/types/components/ChatUIComponent/GroupCast.d.ts +26 -0
- package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +45 -0
- package/dist/types/components/ChatUIComponent/ReactionContainer.d.ts +12 -0
- package/dist/types/components/ChatUIComponent/WebChatBody/WebChatBody.d.ts +120 -0
- package/dist/types/components/Login.d.ts +13 -0
- package/dist/types/components/Signup.d.ts +17 -0
- package/dist/types/components/chat-main.d.ts +15 -0
- package/dist/types/components/my-component/my-component.d.ts +16 -0
- package/dist/types/components/my-component/web-chat/WebchatRightSide.d.ts +42 -0
- package/dist/types/components/theme-provider.d.ts +44 -0
- package/dist/types/components.d.ts +838 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/stencil-public-runtime.d.ts +1678 -0
- package/dist/types/store/conversation.d.ts +17 -0
- package/dist/types/store/group-members.d.ts +18 -0
- package/dist/types/store/unread-count.d.ts +10 -0
- package/dist/types/stories/Components/Toaster/toast-helper.d.ts +8 -0
- package/dist/types/types/ConversationDetailsTypes.d.ts +52 -0
- package/dist/types/utils/getFomattedDate.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +89 -0
- package/readme.md +569 -0
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
import{h as t,i,k as s}from"./p-48e1d174.js";import{a as e}from"./p-40517d7f.js";import"./p-f1f5d5bd.js";import"./p-de8a8642.js";import"./p-8490e13d.js";import{W as n}from"./p-610bfd8a.js";const o="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDE2IDE2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE2IDJIMFYxNEgxNlYyWk02LjUgNVYxMUg3LjVMMTEgOEw3LjUgNUg2LjVaIiBmaWxsPSIjMDAwMDAwIi8+Cjwvc3ZnPg==";const r="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDhweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSI0OHB4IiBmaWxsPSIjZThlYWVkIj48cGF0aCBkPSJNMjg1LTI0MHYtNDgwaDYwdjQ4MGgtNjBaTTQ1MC04MHYtODAwaDYwdjgwMGgtNjBaTTEyMC00MDB2LTE2MGg2MHYxNjBoLTYwWm00OTUgMTYwdi00ODBoNjB2NDgwaC02MFptMTY1LTE2MHYtMTYwaDYwdjE2MGgtNjBaIi8+PC9zdmc+";class h{constructor(){this.listeners={}}on(t,i,s){if(!this.listeners[t]){this.listeners[t]=new Set}if(s===null||s===void 0?void 0:s.once){const s=(...e)=>{this.un(t,s);i(...e)};this.listeners[t].add(s);return()=>this.un(t,s)}this.listeners[t].add(i);return()=>this.un(t,i)}un(t,i){var s;(s=this.listeners[t])===null||s===void 0?void 0:s.delete(i)}once(t,i){return this.on(t,i,{once:true})}unAll(){this.listeners={}}emit(t,...i){if(this.listeners[t]){this.listeners[t].forEach((t=>t(...i)))}}}class a extends h{constructor(t){super();this.subscriptions=[];this.isDestroyed=false;this.options=t}onInit(){return}_init(t){if(this.isDestroyed){this.subscriptions=[];this.isDestroyed=false}this.wavesurfer=t;this.onInit()}destroy(){this.emit("destroy");this.subscriptions.forEach((t=>t()));this.subscriptions=[];this.isDestroyed=true;this.wavesurfer=undefined}}var c=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,o){function r(t){try{a(e.next(t))}catch(t){o(t)}}function h(t){try{a(e["throw"](t))}catch(t){o(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,h)}a((e=e.apply(t,i||[])).next())}))};function l(t,i){return c(this,void 0,void 0,(function*(){const s=new AudioContext({sampleRate:i});try{return yield s.decodeAudioData(t)}finally{if(s.state!=="closed"){yield s.close().catch((()=>undefined))}}}))}function u(t){const i=t[0];if(i.some((t=>t>1||t<-1))){const s=i.length;let e=0;for(let t=0;t<s;t++){const s=Math.abs(i[t]);if(s>e)e=s}for(const i of t){for(let t=0;t<s;t++){i[t]/=e}}}return t}function d(t,i){if(!t||t.length===0){throw new Error("channelData must be a non-empty array")}if(i<=0){throw new Error("duration must be greater than 0")}if(typeof t[0]==="number")t=[t];if(!t[0]||t[0].length===0){throw new Error("channelData must contain non-empty channel arrays")}u(t);const s=t.map((t=>t instanceof Float32Array?t:Float32Array.from(t)));return{duration:i,length:s[0].length,sampleRate:s[0].length/i,numberOfChannels:s.length,getChannelData:t=>{const i=s[t];if(!i){throw new Error(`Channel ${t} not found`)}return i},copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}const f={decode:l,createBuffer:d};function p(t,i){const s=i.xmlns?document.createElementNS(i.xmlns,t):document.createElement(t);for(const[t,e]of Object.entries(i)){if(t==="children"&&e){for(const[t,i]of Object.entries(e)){if(i instanceof Node){s.appendChild(i)}else if(typeof i==="string"){s.appendChild(document.createTextNode(i))}else{s.appendChild(p(t,i))}}}else if(t==="style"){Object.assign(s.style,e)}else if(t==="textContent"){s.textContent=e}else{s.setAttribute(t,e.toString())}}return s}function g(t,i,s){const e=p(t,i||{});s===null||s===void 0?void 0:s.appendChild(e);return e}function m(t){if(t instanceof HTMLElement)return true;return typeof t==="object"&&t!==null&&t.nodeType===Node.ELEMENT_NODE&&typeof t.style==="object"}const v=Object.freeze({__proto__:null,createElement:g,isHTMLElement:m,default:g});var y=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,o){function r(t){try{a(e.next(t))}catch(t){o(t)}}function h(t){try{a(e["throw"](t))}catch(t){o(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,h)}a((e=e.apply(t,i||[])).next())}))};function b(t,i,s){return y(this,void 0,void 0,(function*(){var e;if(!t.body||!t.headers)return;const n=t.body.getReader();const o=Number(t.headers.get("Content-Length"))||0;let r=0;const h=()=>{n.cancel()};if(s){if(s.aborted){n.cancel();return}s.addEventListener("abort",h,{once:true})}try{while(true){const t=yield n.read();if(t.done){break}r+=((e=t.value)===null||e===void 0?void 0:e.length)||0;if(o>0){const t=Math.round(r/o*100);i(t)}}}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;console.warn("Progress tracking error:",t)}finally{if(s){s.removeEventListener("abort",h)}}}))}function w(t,i,s){return y(this,void 0,void 0,(function*(){var e;const n=yield fetch(t,s);if(n.status>=400){throw new Error(`Failed to fetch ${t}: ${n.status} (${n.statusText})`)}b(n.clone(),i,(e=s===null||s===void 0?void 0:s.signal)!==null&&e!==void 0?e:undefined);return n.blob()}))}const x={fetchBlob:w};function M(t){let i=t;const s=new Set;return{get value(){return i},set(t){if(!Object.is(i,t)){i=t;s.forEach((t=>t(i)))}},update(t){this.set(t(i))},subscribe(t){s.add(t);return()=>s.delete(t)}}}function k(t,i){const s=M(t());i.forEach((i=>i.subscribe((()=>{const i=t();if(!Object.is(s.value,i)){s.set(i)}}))));return{get value(){return s.value},subscribe(t){return s.subscribe(t)}}}function j(t,i){let s;const e=()=>{if(s){s();s=undefined}s=t()};const n=i.map((t=>t.subscribe(e)));e();return()=>{if(s){s();s=undefined}n.forEach((t=>t()))}}var D=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,o){function r(t){try{a(e.next(t))}catch(t){o(t)}}function h(t){try{a(e["throw"](t))}catch(t){o(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,h)}a((e=e.apply(t,i||[])).next())}))};class L extends h{get isPlayingSignal(){return this._isPlaying}get currentTimeSignal(){return this._currentTime}get durationSignal(){return this._duration}get volumeSignal(){return this._volume}get mutedSignal(){return this._muted}get playbackRateSignal(){return this._playbackRate}get seekingSignal(){return this._seeking}constructor(t){super();this.isExternalMedia=false;this._ownBlobUrl=null;this.reactiveMediaEventCleanups=[];if(t.media){this.media=t.media;this.isExternalMedia=true}else{this.media=document.createElement("audio")}this._isPlaying=M(false);this._currentTime=M(0);this._duration=M(0);this._volume=M(this.media.volume);this._muted=M(this.media.muted);this._playbackRate=M(this.media.playbackRate||1);this._seeking=M(false);this.setupReactiveMediaEvents();if(t.mediaControls){this.media.controls=true}if(t.autoplay){this.media.autoplay=true}if(t.playbackRate!=null){this.onMediaEvent("canplay",(()=>{if(t.playbackRate!=null){this.media.playbackRate=t.playbackRate}}),{once:true})}}setupReactiveMediaEvents(){this.reactiveMediaEventCleanups.push(this.onMediaEvent("play",(()=>{this._isPlaying.set(true)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("pause",(()=>{this._isPlaying.set(false)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("ended",(()=>{this._isPlaying.set(false)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("timeupdate",(()=>{this._currentTime.set(this.media.currentTime)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("durationchange",(()=>{this._duration.set(this.media.duration||0)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("loadedmetadata",(()=>{this._duration.set(this.media.duration||0)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("seeking",(()=>{this._seeking.set(true)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("seeked",(()=>{this._seeking.set(false)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("volumechange",(()=>{this._volume.set(this.media.volume);this._muted.set(this.media.muted)})));this.reactiveMediaEventCleanups.push(this.onMediaEvent("ratechange",(()=>{this._playbackRate.set(this.media.playbackRate)})))}onMediaEvent(t,i,s){this.media.addEventListener(t,i,s);return()=>this.media.removeEventListener(t,i,s)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){if(this._ownBlobUrl){URL.revokeObjectURL(this._ownBlobUrl);this._ownBlobUrl=null}}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,i){const s=this.getSrc();if(t&&s===t)return;this.revokeSrc();const e=i instanceof Blob&&(this.canPlayType(i.type)||!t)?URL.createObjectURL(i):t;if(e!==t){this._ownBlobUrl=e}if(s){this.media.removeAttribute("src")}if(e||t){try{this.media.src=e}catch(i){this.media.src=t}}}destroy(){this.reactiveMediaEventCleanups.forEach((t=>t()));this.reactiveMediaEventCleanups=[];this.revokeSrc();this.unAll();if(this.isExternalMedia)return;this.media.pause();this.media.removeAttribute("src");this.media.load();this.media.remove()}setMediaElement(t){this.reactiveMediaEventCleanups.forEach((t=>t()));this.reactiveMediaEventCleanups=[];this.media=t;this.setupReactiveMediaEvents()}play(){return D(this,void 0,void 0,(function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError"){return}throw t}}))}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,i){if(i!=null){this.media.preservesPitch=i}this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){const i=this.media;return i.setSinkId(t)}}const C=128;const S=8e3;const I=10;function N(t){if(t<0)return 0;if(t>1)return 1;return t}function T({width:t,height:i,length:s,options:e,pixelRatio:n}){const o=i/2;const r=e.barWidth?e.barWidth*n:1;const h=e.barGap?e.barGap*n:e.barWidth?r/2:0;const a=e.barRadius||0;const c=e.barMinHeight?e.barMinHeight*n:0;const l=r+h||1;const u=s>0?t/l/s:0;return{halfHeight:o,barWidth:r,barGap:h,barRadius:a,barMinHeight:c,barIndexScale:u,barSpacing:l}}function z({maxTop:t,maxBottom:i,halfHeight:s,vScale:e,barMinHeight:n=0,barAlign:o}){let r=Math.round(t*s*e);const h=Math.round(i*s*e);let a=r+h||1;if(a<n){a=n;if(!o){r=a/2}}return{topHeight:r,totalHeight:a}}function $({barAlign:t,halfHeight:i,topHeight:s,totalHeight:e,canvasHeight:n}){if(t==="top")return 0;if(t==="bottom")return n-e;return i-s}function P({channelData:t,barIndexScale:i,barSpacing:s,barWidth:e,halfHeight:n,vScale:o,canvasHeight:r,barAlign:h,barMinHeight:a}){const c=t[0]||[];const l=t[1]||c;const u=c.length;const d=[];let f=0;let p=0;let g=0;for(let t=0;t<=u;t++){const u=Math.round(t*i);if(u>f){const{topHeight:t,totalHeight:i}=z({maxTop:p,maxBottom:g,halfHeight:n,vScale:o,barMinHeight:a,barAlign:h});const c=$({barAlign:h,halfHeight:n,topHeight:t,totalHeight:i,canvasHeight:r});d.push({x:f*s,y:c,width:e,height:i});f=u;p=0;g=0}const m=Math.abs(c[t]||0);const v=Math.abs(l[t]||0);if(m>p)p=m;if(v>g)g=v}return d}function E(t,i,s){const e=i-t.left;const n=s-t.top;const o=e/t.width;const r=n/t.height;return[o,r]}function O({optionsHeight:t,optionsSplitChannels:i,parentHeight:s,numberOfChannels:e,defaultHeight:n=C}){if(t==null)return n;const o=Number(t);if(!isNaN(o))return o;if(t==="auto"){const t=s||n;if(i===null||i===void 0?void 0:i.every((t=>!t.overlay))){return t/e}return t}return n}function B(t){return Math.max(1,t||1)}function A(t){return Boolean(t.barWidth||t.barGap||t.barAlign)}function W(t,i,s){if(!Array.isArray(t))return t||"";if(t.length===0)return"#999";if(t.length<2)return t[0]||"";const e=document.createElement("canvas");const n=e.getContext("2d");if(!n)return t[0]||"";const o=s||e.height*i;const r=n.createLinearGradient(0,0,0,o);const h=1/(t.length-1);t.forEach(((t,i)=>{r.addColorStop(i*h,t)}));return r}function H({duration:t,minPxPerSec:i=0,parentWidth:s,fillParent:e,pixelRatio:n}){const o=Math.ceil(t*i);const r=o>s;const h=Boolean(e&&!r);const a=(h?s:o)*n;return{scrollWidth:o,isScrollable:r,useParentWidth:h,width:a}}function R(t,i){if(!A(i))return t;const s=i.barWidth||.5;const e=i.barGap||s/2;const n=s+e;if(n===0)return t;return Math.floor(t/n)*n}function Y({clientWidth:t,totalWidth:i,options:s}){const e=Math.min(S,t,i);return R(e,s)}function Z({channelData:t,offset:i,clampedWidth:s,totalWidth:e}){return t.map((t=>{const n=Math.floor(i/e*t.length);const o=Math.floor((i+s)/e*t.length);return t.slice(n,o)}))}function U(t){return t>I}function F({scrollLeft:t,totalWidth:i,numCanvases:s}){if(i===0)return[0];const e=t/i;const n=Math.floor(e*s);return[n-1,n,n+1]}function G({channelData:t,barHeight:i,normalize:s,maxPeak:e}){var n;const o=i||1;if(!s)return o;const r=t[0];if(!r||r.length===0)return o;let h=e!==null&&e!==void 0?e:0;if(!e){for(let t=0;t<r.length;t++){const i=(n=r[t])!==null&&n!==void 0?n:0;const s=Math.abs(i);if(s>h)h=s}}if(!h)return o;return o/h}function V({channelData:t,width:i,height:s,vScale:e}){const n=s/2;const o=t[0]||[];const r=t[1]||o;const h=[o,r];return h.map(((t,s)=>{const o=t.length;const r=o?i/o:0;const h=n;const a=s===0?-1:1;const c=[{x:0,y:h}];let l=0;let u=0;for(let i=0;i<=o;i++){const s=Math.round(i*r);if(s>l){const t=Math.round(u*n*e)||1;const i=h+t*a;c.push({x:l,y:i});l=s;u=0}const o=Math.abs(t[i]||0);if(o>u)u=o}c.push({x:l,y:h});return c}))}function _(t){const i=t*2;const s=i<0?Math.floor(i):Math.ceil(i);return s/2}function Q(t){const i=t._cleanup;if(typeof i==="function"){i()}}function q(t,i={}){const{threshold:s=3,mouseButton:e=0,touchDelay:n=100}=i;const o=M(null);const r=new Map;const h=matchMedia("(pointer: coarse)").matches;let a=()=>void 0;const c=i=>{if(i.button!==e)return;if(r.has(i.pointerId))return;r.set(i.pointerId,i);if(r.size>1){return}const c=i.pointerId;let l=i.clientX;let u=i.clientY;let d=false;const f=Date.now();const p=t.getBoundingClientRect();const{left:g,top:m}=p;const v=t=>{if(t.pointerId!==c)return;if(t.defaultPrevented||r.size>1){return}if(h&&Date.now()-f<n)return;const i=t.clientX;const e=t.clientY;const a=i-l;const p=e-u;if(d||Math.abs(a)>s||Math.abs(p)>s){t.preventDefault();t.stopPropagation();if(!d){o.set({type:"start",x:l-g,y:u-m});d=true}o.set({type:"move",x:i-g,y:e-m,deltaX:a,deltaY:p});l=i;u=e}};const y=t=>{if(!r.delete(t.pointerId))return;if(t.pointerId===c&&d){const i=t.clientX;const s=t.clientY;o.set({type:"end",x:i-g,y:s-m})}if(r.size===0){a()}};const b=t=>{if(!t.relatedTarget||t.relatedTarget===document.documentElement){y(t)}};const w=t=>{if(d){t.stopPropagation();t.preventDefault()}};const x=t=>{if(t.defaultPrevented||r.size>1){return}if(d){t.preventDefault()}};document.addEventListener("pointermove",v);document.addEventListener("pointerup",y);document.addEventListener("pointerout",b);document.addEventListener("pointercancel",b);document.addEventListener("touchmove",x,{passive:false});document.addEventListener("click",w,{capture:true});a=()=>{document.removeEventListener("pointermove",v);document.removeEventListener("pointerup",y);document.removeEventListener("pointerout",b);document.removeEventListener("pointercancel",b);document.removeEventListener("touchmove",x);setTimeout((()=>{document.removeEventListener("click",w,{capture:true})}),10)}};t.addEventListener("pointerdown",c);const l=()=>{a();t.removeEventListener("pointerdown",c);r.clear();Q(o)};return{signal:o,cleanup:l}}function J(t){const{scrollLeft:i,scrollWidth:s,clientWidth:e}=t;if(s===0){return{startX:0,endX:1}}const n=i/s;const o=(i+e)/s;return{startX:Math.max(0,Math.min(1,n)),endX:Math.max(0,Math.min(1,o))}}function X(t){return{left:t.scrollLeft,right:t.scrollLeft+t.clientWidth}}function K(t){const i=M({scrollLeft:t.scrollLeft,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth});const s=k((()=>J(i.value)),[i]);const e=k((()=>X(i.value)),[i]);const n=()=>{i.set({scrollLeft:t.scrollLeft,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth})};t.addEventListener("scroll",n,{passive:true});const o=()=>{t.removeEventListener("scroll",n);Q(i)};return{scrollData:i,percentages:s,bounds:e,cleanup:o}}var tt=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,o){function r(t){try{a(e.next(t))}catch(t){o(t)}}function h(t){try{a(e["throw"](t))}catch(t){o(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,h)}a((e=e.apply(t,i||[])).next())}))};var it=undefined&&undefined.__rest||function(t,i){var s={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0)s[e]=t[e];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,e=Object.getOwnPropertySymbols(t);n<e.length;n++){if(i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n]))s[e[n]]=t[e[n]]}return s};const st=60;const et=10;const nt=et*st;class ot extends h{constructor(t,i){super();this.timeouts=[];this.isScrollable=false;this.audioData=null;this.resizeObserver=null;this.lastContainerWidth=0;this.isDragging=false;this.subscriptions=[];this.unsubscribeOnScroll=[];this.dragStream=null;this.scrollStream=null;this.containerInlinePadding=0;this.onClickWrapper=t=>{const i=this.wrapper.getBoundingClientRect();const[s,e]=E(i,t.clientX,t.clientY);this.emit("click",s,e)};this.onDblClickWrapper=t=>{const i=this.wrapper.getBoundingClientRect();const[s,e]=E(i,t.clientX,t.clientY);this.emit("dblclick",s,e)};this.subscriptions=[];this.options=t;const s=this.parentFromOptionsContainer(t.container);this.parent=s;const[e,n]=this.initHtml();s.appendChild(e);this.container=e;this.scrollContainer=n.querySelector(".scroll");this.wrapper=n.querySelector(".wrapper");this.canvasWrapper=n.querySelector(".canvases");this.progressWrapper=n.querySelector(".progress");this.cursor=n.querySelector(".cursor");this.calculateInlinePadding();if(i){n.appendChild(i)}this.initEvents()}parentFromOptionsContainer(t){let i;if(typeof t==="string"){i=document.querySelector(t)}else if(m(t)){i=t}if(!i){throw new Error("Container not found")}return i}initEvents(){this.wrapper.addEventListener("click",this.onClickWrapper);this.wrapper.addEventListener("dblclick",this.onDblClickWrapper);if(this.options.dragToSeek===true||typeof this.options.dragToSeek==="object"){this.initDrag()}this.scrollStream=K(this.scrollContainer);const t=j((()=>{const{startX:t,endX:i}=this.scrollStream.percentages.value;const{left:s,right:e}=this.scrollStream.bounds.value;this.emit("scroll",t,i,s,e)}),[this.scrollStream.percentages,this.scrollStream.bounds]);this.subscriptions.push(t);if(typeof ResizeObserver==="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver((()=>{t().then((()=>this.onContainerResize())).catch((()=>undefined))}));this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;this.calculateInlinePadding();if(t===this.lastContainerWidth&&this.options.height!=="auto")return;this.lastContainerWidth=t;this.reRender();this.emit("resize")}initDrag(){if(this.dragStream)return;this.dragStream=q(this.wrapper);const t=j((()=>{const t=this.dragStream.signal.value;if(!t)return;const i=this.wrapper.getBoundingClientRect().width;const s=N(t.x/i);if(t.type==="start"){this.isDragging=true;this.emit("dragstart",s)}else if(t.type==="move"){this.emit("drag",s)}else if(t.type==="end"){this.isDragging=false;this.emit("dragend",s)}}),[this.dragStream.signal]);this.subscriptions.push(t)}calculateInlinePadding(){const{paddingLeft:t,paddingRight:i}=getComputedStyle(this.scrollContainer);const s=parseFloat(t)+parseFloat(i);this.containerInlinePadding=Number.isNaN(s)?0:s}initHtml(){const t=document.createElement("div");const i=t.attachShadow({mode:"open"});const s=this.options.cspNonce&&typeof this.options.cspNonce==="string"?this.options.cspNonce.replace(/"/g,""):"";i.innerHTML=`\n <style${s?` nonce="${s}"`:""}>\n :host {\n user-select: none;\n min-width: 1px;\n }\n :host audio {\n display: block;\n width: 100%;\n }\n :host .scroll {\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n position: relative;\n }\n :host .noScrollbar {\n scrollbar-color: transparent;\n scrollbar-width: none;\n }\n :host .noScrollbar::-webkit-scrollbar {\n display: none;\n -webkit-appearance: none;\n }\n :host .wrapper {\n position: relative;\n overflow: visible;\n z-index: 2;\n }\n :host .canvases {\n min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;\n pointer-events: none;\n }\n :host .canvases > div {\n position: relative;\n }\n :host canvas {\n display: block;\n position: absolute;\n top: 0;\n image-rendering: pixelated;\n }\n :host .progress {\n pointer-events: none;\n position: absolute;\n z-index: 2;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n overflow: hidden;\n }\n :host .progress > div {\n position: relative;\n }\n :host .cursor {\n pointer-events: none;\n position: absolute;\n z-index: 5;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: 2px;\n }\n </style>\n\n <div class="scroll" part="scroll">\n <div class="wrapper" part="wrapper">\n <div class="canvases" part="canvases"></div>\n <div class="progress" part="progress"></div>\n <div class="cursor" part="cursor"></div>\n </div>\n </div>\n `;return[t,i]}setOptions(t){var i;if(this.options.container!==t.container){const i=this.parentFromOptionsContainer(t.container);i.appendChild(this.container);this.parent=i}if(t.dragToSeek===true||typeof this.options.dragToSeek==="object"){this.initDrag()}else{(i=this.dragStream)===null||i===void 0?void 0:i.cleanup();this.dragStream=null}this.options=t;this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth-this.containerInlinePadding}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:i}=this.scrollContainer;const s=i*t;this.setScroll(s)}destroy(){var t;this.wrapper.removeEventListener("click",this.onClickWrapper);this.wrapper.removeEventListener("dblclick",this.onDblClickWrapper);this.timeouts.forEach((t=>t()));this.timeouts=[];this.subscriptions.forEach((t=>t()));this.container.remove();if(this.resizeObserver){this.resizeObserver.disconnect();this.resizeObserver=null}(t=this.unsubscribeOnScroll)===null||t===void 0?void 0:t.forEach((t=>t()));this.unsubscribeOnScroll=[];if(this.dragStream){this.dragStream.cleanup();this.dragStream=null}if(this.scrollStream){this.scrollStream.cleanup();this.scrollStream=null}}createDelay(t=10){let i;let s;const e=()=>{if(i){clearTimeout(i);i=undefined}if(s){s();s=undefined}};this.timeouts.push(e);return()=>new Promise(((n,o)=>{e();s=o;i=setTimeout((()=>{i=undefined;s=undefined;n()}),t)}))}getHeight(t,i){var s;const e=((s=this.audioData)===null||s===void 0?void 0:s.numberOfChannels)||1;return O({optionsHeight:t,optionsSplitChannels:i,parentHeight:this.parent.clientHeight,numberOfChannels:e,defaultHeight:C})}convertColorValues(t,i){return W(t,this.getPixelRatio(),i===null||i===void 0?void 0:i.canvas.height)}getPixelRatio(){return B(window.devicePixelRatio)}renderBarWaveform(t,i,s,e){const{width:n,height:o}=s.canvas;const{halfHeight:r,barWidth:h,barRadius:a,barIndexScale:c,barSpacing:l,barMinHeight:u}=T({width:n,height:o,length:(t[0]||[]).length,options:i,pixelRatio:this.getPixelRatio()});const d=P({channelData:t,barIndexScale:c,barSpacing:l,barWidth:h,halfHeight:r,vScale:e,canvasHeight:o,barAlign:i.barAlign,barMinHeight:u});s.beginPath();for(const t of d){if(a&&"roundRect"in s){s.roundRect(t.x,t.y,t.width,t.height,a)}else{s.rect(t.x,t.y,t.width,t.height)}}s.fill();s.closePath()}renderLineWaveform(t,i,s,e){const{width:n,height:o}=s.canvas;const r=V({channelData:t,width:n,height:o,vScale:e});s.beginPath();for(const t of r){if(!t.length)continue;s.moveTo(t[0].x,t[0].y);for(let i=1;i<t.length;i++){const e=t[i];s.lineTo(e.x,e.y)}}s.fill();s.closePath()}renderWaveform(t,i,s){s.fillStyle=this.convertColorValues(i.waveColor,s);if(i.renderFunction){i.renderFunction(t,s);return}const e=G({channelData:t,barHeight:i.barHeight,normalize:i.normalize,maxPeak:i.maxPeak});if(A(i)){this.renderBarWaveform(t,i,s,e);return}this.renderLineWaveform(t,i,s,e)}renderSingleCanvas(t,i,s,e,n,o,r){const h=this.getPixelRatio();const a=document.createElement("canvas");a.width=Math.round(s*h);a.height=Math.round(e*h);a.style.width=`${s}px`;a.style.height=`${e}px`;a.style.left=`${Math.round(n)}px`;o.appendChild(a);const c=a.getContext("2d");if(i.renderFunction){c.fillStyle=this.convertColorValues(i.waveColor,c);i.renderFunction(t,c)}else{this.renderWaveform(t,i,c)}if(a.width>0&&a.height>0){const t=a.cloneNode();const s=t.getContext("2d");s.drawImage(a,0,0);s.globalCompositeOperation="source-in";s.fillStyle=this.convertColorValues(i.progressColor,s);s.fillRect(0,0,a.width,a.height);r.appendChild(t)}}renderMultiCanvas(t,i,s,e,n,o){const r=this.getPixelRatio();const{clientWidth:h}=this.scrollContainer;const a=s/r;const c=Y({clientWidth:h,totalWidth:a,options:i});let l={};if(c===0)return;const u=s=>{if(s<0||s>=f)return;if(l[s])return;l[s]=true;const r=s*c;let h=Math.min(a-r,c);h=R(h,i);if(h<=0)return;const u=Z({channelData:t,offset:r,clampedWidth:h,totalWidth:a});this.renderSingleCanvas(u,i,h,e,r,n,o)};const d=()=>{if(U(Object.keys(l).length)){n.innerHTML="";o.innerHTML="";l={}}};const f=Math.ceil(a/c);if(!this.isScrollable){for(let t=0;t<f;t++){u(t)}return}const p=F({scrollLeft:this.scrollContainer.scrollLeft,totalWidth:a,numCanvases:f});p.forEach((t=>u(t)));if(f>1){const t=this.on("scroll",(()=>{const{scrollLeft:t}=this.scrollContainer;d();F({scrollLeft:t,totalWidth:a,numCanvases:f}).forEach((t=>u(t)))}));this.unsubscribeOnScroll.push(t)}}renderChannel(t,i,s,e){var{overlay:n}=i,o=it(i,["overlay"]);const r=document.createElement("div");const h=this.getHeight(o.height,o.splitChannels);r.style.height=`${h}px`;if(n&&e>0){r.style.marginTop=`-${h}px`}this.canvasWrapper.style.minHeight=`${h}px`;this.canvasWrapper.appendChild(r);const a=r.cloneNode();this.progressWrapper.appendChild(a);this.renderMultiCanvas(t,o,s,h,r,a)}render(t){return tt(this,void 0,void 0,(function*(){var i;this.timeouts.forEach((t=>t()));this.timeouts=[];this.unsubscribeOnScroll.forEach((t=>t()));this.unsubscribeOnScroll=[];this.canvasWrapper.innerHTML="";this.progressWrapper.innerHTML="";if(this.options.width!=null){this.scrollContainer.style.width=typeof this.options.width==="number"?`${this.options.width}px`:this.options.width}const s=this.getPixelRatio();const e=this.scrollContainer.clientWidth-this.containerInlinePadding;const{scrollWidth:n,isScrollable:o,useParentWidth:r,width:h}=H({duration:t.duration,minPxPerSec:this.options.minPxPerSec||0,parentWidth:e,fillParent:this.options.fillParent,pixelRatio:s});this.isScrollable=o;this.wrapper.style.width=r?"100%":`${n}px`;this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden";this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar);this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`;this.cursor.style.width=`${this.options.cursorWidth}px`;this.audioData=t;this.emit("render");if(this.options.splitChannels){for(let s=0;s<t.numberOfChannels;s++){const e=Object.assign(Object.assign({},this.options),(i=this.options.splitChannels)===null||i===void 0?void 0:i[s]);this.renderChannel([t.getChannelData(s)],e,h,s)}}else{const i=[t.getChannelData(0)];if(t.numberOfChannels>1)i.push(t.getChannelData(1));this.renderChannel(i,this.options,h,0)}Promise.resolve().then((()=>this.emit("rendered")))}))}reRender(){this.unsubscribeOnScroll.forEach((t=>t()));this.unsubscribeOnScroll=[];if(!this.audioData)return;const{scrollWidth:t}=this.scrollContainer;const{right:i}=this.progressWrapper.getBoundingClientRect();this.render(this.audioData);if(!this.isScrollable&&this.scrollContainer.scrollLeft){this.scrollContainer.scrollLeft=0}else if(this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:t}=this.progressWrapper.getBoundingClientRect();const s=_(t-i);this.scrollContainer.scrollLeft+=s}}zoom(t){this.options.minPxPerSec=t;this.reRender()}scrollIntoView(t,i=false){var s;const{scrollLeft:e,scrollWidth:n,clientWidth:o}=this.scrollContainer;const r=t*n;const h=e;const a=e+o;const c=o/2;if(this.isDragging){const t=30;if(r+t>a){this.scrollContainer.scrollLeft+=t}else if(r-t<h){this.scrollContainer.scrollLeft-=t}}else{if(r<h||r>a){this.scrollContainer.scrollLeft=r-(this.options.autoCenter?c:0)}const t=r-e-c;if(i&&this.options.autoCenter&&t>0){const i=(s=this.audioData)===null||s===void 0?void 0:s.duration;if(i===undefined||i<=0){this.scrollContainer.scrollLeft+=t;return}const e=n/i;if(e<=nt){this.scrollContainer.scrollLeft+=Math.min(t,et)}else{this.scrollContainer.scrollLeft+=t}}}}renderProgress(t,i){if(isNaN(t))return;const s=t*100;this.canvasWrapper.style.clipPath=`polygon(${s}% 0%, 100% 0%, 100% 100%, ${s}% 100%)`;this.progressWrapper.style.width=`${s}%`;this.cursor.style.left=`${s}%`;this.cursor.style.transform=this.options.cursorWidth?`translateX(-${t*this.options.cursorWidth}px)`:"";if(this.isScrollable&&this.options.autoScroll&&this.audioData&&this.audioData.duration>0){this.scrollIntoView(t,i)}}exportImage(t,i,s){return tt(this,void 0,void 0,(function*(){const e=this.canvasWrapper.querySelectorAll("canvas");if(!e.length){throw new Error("No waveform data")}if(s==="dataURL"){const s=Array.from(e).map((s=>s.toDataURL(t,i)));return Promise.resolve(s)}return Promise.all(Array.from(e).map((s=>new Promise(((e,n)=>{s.toBlob((t=>{if(t){e(t)}else{n(new Error("Could not export image"))}}),t,i)})))))}))}}class rt extends h{constructor(){super(...arguments);this.animationFrameId=null;this.isRunning=false}start(){if(this.isRunning)return;this.isRunning=true;const t=()=>{if(!this.isRunning)return;this.emit("tick");this.animationFrameId=requestAnimationFrame(t)};t()}stop(){this.isRunning=false;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}}destroy(){this.stop();this.unAll()}}var ht=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,o){function r(t){try{a(e.next(t))}catch(t){o(t)}}function h(t){try{a(e["throw"](t))}catch(t){o(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,h)}a((e=e.apply(t,i||[])).next())}))};function at(){const t=globalThis.navigator;if(!(t===null||t===void 0?void 0:t.audioSession))return;try{t.audioSession.type="playback"}catch(t){console.warn("Setting navigator.audioSession.type failed:",t)}}class ct extends h{constructor(t){super();this.bufferNode=null;this.playStartTime=0;this.playbackPosition=0;this._muted=false;this._playbackRate=1;this._duration=undefined;this.buffer=null;this.currentSrc="";this.paused=true;this.crossOrigin=null;this.seeking=false;this.autoplay=false;this.addEventListener=this.on;this.removeEventListener=this.un;this._destroyed=false;at();this.audioContext=t||new AudioContext;this.gainNode=this.audioContext.createGain();this.gainNode.connect(this.audioContext.destination)}load(){return ht(this,void 0,void 0,(function*(){return}))}remove(){this.destroy()}destroy(){if(this._destroyed)return;this._destroyed=true;this.currentSrc="";if(this.bufferNode){this.bufferNode.onended=null;try{this.bufferNode.stop()}catch(t){}this.bufferNode.disconnect();this.bufferNode=null}this.gainNode.disconnect();if(typeof this.audioContext.close==="function"){Promise.resolve(this.audioContext.close.call(this.audioContext)).catch((()=>undefined))}this.buffer=null;this.unAll()}get src(){return this.currentSrc}set src(t){this.currentSrc=t;this._duration=undefined;if(!t){this.buffer=null;this.emit("emptied");return}fetch(t).then((i=>{if(i.status>=400){throw new Error(`Failed to fetch ${t}: ${i.status} (${i.statusText})`)}return i.arrayBuffer()})).then((i=>{if(this.currentSrc!==t)return null;return this.audioContext.decodeAudioData(i)})).then((i=>{if(this.currentSrc!==t)return;this.buffer=i;this.emit("loadedmetadata");this.emit("canplay");if(this.autoplay)this.play()})).catch((t=>{console.error("WebAudioPlayer load error:",t)}))}_play(){if(!this.paused)return;this.paused=false;if(this.bufferNode){this.bufferNode.onended=null;this.bufferNode.disconnect()}this.bufferNode=this.audioContext.createBufferSource();if(this.buffer){this.bufferNode.buffer=this.buffer}this.bufferNode.playbackRate.value=this._playbackRate;this.bufferNode.connect(this.gainNode);let t=this.playbackPosition;if(t>=this.duration||t<0){t=0;this.playbackPosition=0}this.bufferNode.start(this.audioContext.currentTime,t);this.playStartTime=this.audioContext.currentTime;this.bufferNode.onended=()=>{if(!this.paused&&this.duration-this.currentTime<.01){this.pause();this.emit("ended")}}}_pause(){this.paused=true;if(this.bufferNode){this.bufferNode.onended=null;try{this.bufferNode.stop()}catch(t){}}this.playbackPosition+=(this.audioContext.currentTime-this.playStartTime)*this._playbackRate}play(){return ht(this,void 0,void 0,(function*(){if(!this.paused)return;this._play();this.emit("play")}))}pause(){if(this.paused)return;this._pause();this.emit("pause")}stopAt(t){const i=(t-this.currentTime)/this._playbackRate;const s=this.bufferNode;s===null||s===void 0?void 0:s.stop(this.audioContext.currentTime+i);s===null||s===void 0?void 0:s.addEventListener("ended",(()=>{if(s===this.bufferNode){this.bufferNode=null;this.pause();this.playbackPosition=Math.min(t,this.duration);this.emit("timeupdate")}}),{once:true})}setSinkId(t){return ht(this,void 0,void 0,(function*(){const i=this.audioContext;return i.setSinkId(t)}))}get playbackRate(){return this._playbackRate}set playbackRate(t){const i=!this.paused;if(i)this._pause();this._playbackRate=t;if(i)this._play();if(this.bufferNode){this.bufferNode.playbackRate.value=t}}get currentTime(){return this.paused?this.playbackPosition:this.playbackPosition+(this.audioContext.currentTime-this.playStartTime)*this._playbackRate}set currentTime(t){const i=!this.paused;if(i)this._pause();this.playbackPosition=t;if(i)this._play();this.emit("seeking");this.emit("timeupdate")}get duration(){var t,i;return(t=this._duration)!==null&&t!==void 0?t:((i=this.buffer)===null||i===void 0?void 0:i.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t;this.emit("volumechange")}get muted(){return this._muted}set muted(t){if(this._muted===t)return;this._muted=t;if(this._muted){this.gainNode.disconnect()}else{this.gainNode.connect(this.audioContext.destination)}}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const i=this.buffer.numberOfChannels;for(let s=0;s<i;s++){t.push(this.buffer.getChannelData(s))}return t}removeAttribute(t){switch(t){case"src":this.src="";break;case"playbackRate":this.playbackRate=0;break;case"currentTime":this.currentTime=0;break;case"duration":this.duration=0;break;case"volume":this.volume=0;break;case"muted":this.muted=false;break}}}function lt(t){var i,s,e,n,o,r;const h=(i=t===null||t===void 0?void 0:t.currentTime)!==null&&i!==void 0?i:M(0);const a=(s=t===null||t===void 0?void 0:t.duration)!==null&&s!==void 0?s:M(0);const c=(e=t===null||t===void 0?void 0:t.isPlaying)!==null&&e!==void 0?e:M(false);const l=(n=t===null||t===void 0?void 0:t.isSeeking)!==null&&n!==void 0?n:M(false);const u=(o=t===null||t===void 0?void 0:t.volume)!==null&&o!==void 0?o:M(1);const d=(r=t===null||t===void 0?void 0:t.playbackRate)!==null&&r!==void 0?r:M(1);const f=M(null);const p=M(null);const g=M("");const m=M(0);const v=M(0);const y=k((()=>!c.value),[c]);const b=k((()=>f.value!==null),[f]);const w=k((()=>b.value&&a.value>0),[b,a]);const x=k((()=>h.value),[h]);const j=k((()=>a.value>0?h.value/a.value:0),[h,a]);const D={currentTime:h,duration:a,isPlaying:c,isPaused:y,isSeeking:l,volume:u,playbackRate:d,audioBuffer:f,peaks:p,url:g,zoom:m,scrollPosition:v,canPlay:b,isReady:w,progress:x,progressPercent:j};const L={setCurrentTime:t=>{const i=Math.max(0,Math.min(a.value||Infinity,t));h.set(i)},setDuration:t=>{a.set(Math.max(0,t))},setPlaying:t=>{c.set(t)},setSeeking:t=>{l.set(t)},setVolume:t=>{const i=Math.max(0,Math.min(1,t));u.set(i)},setPlaybackRate:t=>{const i=Math.max(.1,Math.min(16,t));d.set(i)},setAudioBuffer:t=>{f.set(t);if(t){a.set(t.duration)}},setPeaks:t=>{p.set(t)},setUrl:t=>{g.set(t)},setZoom:t=>{m.set(Math.max(0,t))},setScrollPosition:t=>{v.set(Math.max(0,t))}};return{state:D,actions:L}}function ut(t,i){const s=[];s.push(j((()=>{const s=t.isPlaying.value;i.emit(s?"play":"pause")}),[t.isPlaying]));s.push(j((()=>{const s=t.currentTime.value;i.emit("timeupdate",s);if(t.isPlaying.value){i.emit("audioprocess",s)}}),[t.currentTime,t.isPlaying]));s.push(j((()=>{const s=t.isSeeking.value;if(s){i.emit("seeking",t.currentTime.value)}}),[t.isSeeking,t.currentTime]));let e=false;s.push(j((()=>{const s=t.isReady.value;if(s&&!e){e=true;i.emit("ready",t.duration.value)}}),[t.isReady,t.duration]));s.push(j((()=>{if(t.audioBuffer.value===null){e=false}}),[t.audioBuffer]));let n=false;s.push(j((()=>{const s=t.isPlaying.value;const e=t.currentTime.value;const o=t.duration.value;const r=o>0&&e>=o;if(n&&!s&&r){i.emit("finish")}n=s&&r}),[t.isPlaying,t.currentTime,t.duration]));s.push(j((()=>{const s=t.zoom.value;if(s>0){i.emit("zoom",s)}}),[t.zoom]));return()=>{s.forEach((t=>t()))}}var dt=undefined&&undefined.__awaiter||function(t,i,s,e){function n(t){return t instanceof s?t:new s((function(i){i(t)}))}return new(s||(s=Promise))((function(s,o){function r(t){try{a(e.next(t))}catch(t){o(t)}}function h(t){try{a(e["throw"](t))}catch(t){o(t)}}function a(t){t.done?s(t.value):n(t.value).then(r,h)}a((e=e.apply(t,i||[])).next())}))};const ft={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:true,interact:true,dragToSeek:false,autoScroll:true,autoCenter:true,sampleRate:8e3};class pt extends L{static create(t){return new pt(t)}getState(){return this.wavesurferState}getRenderer(){return this.renderer}constructor(t){const i=t.media||(t.backend==="WebAudio"?new ct:undefined);super({media:i,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate});this.plugins=[];this.decodedData=null;this.stopAtPosition=null;this.subscriptions=[];this.mediaSubscriptions=[];this.abortController=null;this._isDestroyed=false;this._loadVersion=0;this.reactiveCleanups=[];this.options=Object.assign({},ft,t);const{state:s,actions:e}=lt({isPlaying:this.isPlayingSignal,currentTime:this.currentTimeSignal,duration:this.durationSignal,volume:this.volumeSignal,playbackRate:this.playbackRateSignal,isSeeking:this.seekingSignal});this.wavesurferState=s;this.wavesurferActions=e;this.timer=new rt;const n=i?undefined:this.getMediaElement();this.renderer=new ot(this.options,n);this.initPlayerEvents();this.initRendererEvents();this.initTimerEvents();this.initReactiveState();this.initPlugins();const o=this.options.url||this.getSrc()||"";Promise.resolve().then((()=>{this.emit("init");const{peaks:t,duration:i}=this.options;if(o||t&&i){this.load(o,t,i).catch((()=>{}))}}))}updateProgress(t=this.getCurrentTime()){this.renderer.renderProgress(t/this.getDuration(),this.isPlaying());return t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",(()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t);this.emit("audioprocess",t);if(this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition){const t=this.stopAtPosition;this.pause();this.setTime(t)}}})))}initReactiveState(){this.reactiveCleanups.push(ut(this.wavesurferState,{emit:this.emit.bind(this)}))}initPlayerEvents(){if(this.isPlaying()){this.emit("play");this.timer.start()}this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",(()=>{const t=this.updateProgress();this.emit("timeupdate",t)})),this.onMediaEvent("play",(()=>{this.emit("play");this.timer.start()})),this.onMediaEvent("pause",(()=>{this.emit("pause");this.timer.stop();this.stopAtPosition=null})),this.onMediaEvent("emptied",(()=>{this.timer.stop();this.stopAtPosition=null})),this.onMediaEvent("ended",(()=>{this.emit("timeupdate",this.getDuration());this.emit("finish");this.stopAtPosition=null})),this.onMediaEvent("seeking",(()=>{this.emit("seeking",this.getCurrentTime())})),this.onMediaEvent("error",(()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error"));this.stopAtPosition=null})))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",((t,i)=>{if(this.options.interact){this.seekTo(t);this.emit("interaction",t*this.getDuration());this.emit("click",t,i)}})),this.renderer.on("dblclick",((t,i)=>{this.emit("dblclick",t,i)})),this.renderer.on("scroll",((t,i,s,e)=>{const n=this.getDuration();this.emit("scroll",t*n,i*n,s,e)})),this.renderer.on("render",(()=>{this.emit("redraw")})),this.renderer.on("rendered",(()=>{this.emit("redrawcomplete")})),this.renderer.on("dragstart",(t=>{this.emit("dragstart",t)})),this.renderer.on("dragend",(t=>{this.emit("dragend",t)})),this.renderer.on("resize",(()=>{this.emit("resize")})));{let t;const i=this.renderer.on("drag",(i=>{var s;if(!this.options.interact)return;this.renderer.renderProgress(i);clearTimeout(t);let e=0;const n=this.options.dragToSeek;if(this.isPlaying()){e=0}else if(n===true){e=200}else if(n&&typeof n==="object"){e=(s=n.debounceTime)!==null&&s!==void 0?s:200}t=setTimeout((()=>{this.seekTo(i)}),e);this.emit("interaction",i*this.getDuration());this.emit("drag",i)}));this.subscriptions.push((()=>{clearTimeout(t);i()}))}}initPlugins(){var t;if(!((t=this.options.plugins)===null||t===void 0?void 0:t.length))return;this.options.plugins.forEach((t=>{this.registerPlugin(t)}))}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach((t=>t()));this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t);if(t.duration&&!t.peaks){this.decodedData=f.createBuffer(this.exportPeaks(),t.duration)}if(t.peaks&&t.duration){this.decodedData=f.createBuffer(t.peaks,t.duration)}this.renderer.setOptions(this.options);if(t.audioRate){this.setPlaybackRate(t.audioRate)}if(t.mediaControls!=null){this.getMediaElement().controls=t.mediaControls}}registerPlugin(t){if(this.plugins.includes(t)){return t}t._init(this);this.plugins.push(t);const i=t.once("destroy",(()=>{this.plugins=this.plugins.filter((i=>i!==t));this.subscriptions=this.subscriptions.filter((t=>t!==i))}));this.subscriptions.push(i);return t}unregisterPlugin(t){this.plugins=this.plugins.filter((i=>i!==t));t.destroy()}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const i=t/this.getDuration();this.renderer.setScrollPercentage(i)}getActivePlugins(){return this.plugins}loadAudio(t,i,s,e){return dt(this,void 0,void 0,(function*(){var n;const o=++this._loadVersion;this._isDestroyed=false;this.emit("load",t);if(!this.options.media&&this.isPlaying())this.pause();this.decodedData=null;this.stopAtPosition=null;(n=this.abortController)===null||n===void 0?void 0:n.abort();this.abortController=null;if(!i&&!s){const s=this.options.fetchParams||{};if(window.AbortController&&!s.signal){this.abortController=new AbortController;s.signal=this.abortController.signal}const e=t=>this.emit("loading",t);i=yield x.fetchBlob(t,e,s);if(this._isDestroyed||o!==this._loadVersion)return;const n=this.options.blobMimeType;if(n){i=new Blob([i],{type:n})}}if(this._isDestroyed||o!==this._loadVersion)return;this.setSrc(t,i);const r=yield new Promise((t=>{const i=e||this.getDuration();if(i){t(i)}else{this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",(()=>t(this.getDuration())),{once:true}))}}));if(this._isDestroyed||o!==this._loadVersion)return;if(!t&&!i){const t=this.getMediaElement();if(t instanceof ct){t.duration=r}}if(s){this.decodedData=f.createBuffer(s,r||0)}else if(i){const t=yield i.arrayBuffer();if(this._isDestroyed||o!==this._loadVersion)return;this.decodedData=yield f.decode(t,this.options.sampleRate)}if(this._isDestroyed||o!==this._loadVersion)return;if(this.decodedData){this.emit("decode",this.getDuration());this.renderer.render(this.decodedData)}this.emit("ready",this.getDuration())}))}load(t,i,s){return dt(this,void 0,void 0,(function*(){try{return yield this.loadAudio(t,undefined,i,s)}catch(t){this.emit("error",t);throw t}}))}loadBlob(t,i,s){return dt(this,void 0,void 0,(function*(){try{return yield this.loadAudio("",t,i,s)}catch(t){this.emit("error",t);throw t}}))}zoom(t){if(!this.decodedData){throw new Error("No audio loaded")}this.renderer.zoom(t);this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:i=8e3,precision:s=1e4}={}){if(!this.decodedData){throw new Error("The audio has not been decoded yet")}const e=Math.min(t,this.decodedData.numberOfChannels);const n=[];for(let t=0;t<e;t++){const e=this.decodedData.getChannelData(t);const o=[];const r=e.length/i;for(let t=0;t<i;t++){const i=e.slice(Math.floor(t*r),Math.ceil((t+1)*r));let n=0;for(let t=0;t<i.length;t++){const s=i[t];if(Math.abs(s)>Math.abs(n))n=s}o.push(Math.round(n*s)/s)}n.push(o)}return n}getDuration(){let t=super.getDuration()||0;if((t===0||t===Infinity)&&this.decodedData){t=this.decodedData.duration}return t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null;super.setTime(t);this.updateProgress(t);this.emit("timeupdate",t)}seekTo(t){const i=this.getDuration()*t;this.setTime(i)}play(t,i){const s=Object.create(null,{play:{get:()=>super.play}});return dt(this,void 0,void 0,(function*(){if(t!=null){this.setTime(t)}const e=yield s.play.call(this);if(i!=null){if(this.media instanceof ct){this.media.stopAt(i)}else{this.stopAtPosition=i}}return e}))}playPause(){return dt(this,void 0,void 0,(function*(){return this.isPlaying()?this.pause():this.play()}))}stop(){this.pause();this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents();super.setMediaElement(t);this.initPlayerEvents()}exportImage(){return dt(this,arguments,void 0,(function*(t="image/png",i=1,s="dataURL"){return this.renderer.exportImage(t,i,s)}))}destroy(){var t;this._isDestroyed=true;this.emit("destroy");(t=this.abortController)===null||t===void 0?void 0:t.abort();this.plugins.forEach((t=>t.destroy()));this.subscriptions.forEach((t=>t()));this.unsubscribePlayerEvents();this.reactiveCleanups.forEach((t=>t()));this.reactiveCleanups=[];this.timer.destroy();this.renderer.destroy();super.destroy()}}pt.BasePlugin=a;pt.dom=v;class gt extends t{static get properties(){return{isPlaying:{type:Boolean},audioDuration:{type:String},isSelf:{type:Boolean},isDelivered:{type:Boolean},isRead:{type:Boolean},showFooter:{type:Boolean},textColor:{type:String},timeColor:{type:String},time:{type:String},bgColor:{type:String},borderRadius:{type:String},playAudioHandler:{type:Function},pauseAudioHandler:{type:Function},messageId:{type:String},reactions:{type:Object},showConfirmationPopup:{type:Boolean},selectedEmojiToRemove:{type:Object},showAllReactionsPopup:{type:Boolean},showReactionButton:{type:Boolean},showEmojiReactions:{type:Boolean},messageType:{type:Number},showReactionOnHover:{type:Boolean}}}static get styles(){return i`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
reaction-container {
|
|
7
|
+
display: block;
|
|
8
|
+
min-height: 150px;
|
|
9
|
+
max-height: fit-content;
|
|
10
|
+
min-width: 300px;
|
|
11
|
+
max-width: 400px;
|
|
12
|
+
position: absolute;
|
|
13
|
+
z-index: 100;
|
|
14
|
+
}
|
|
15
|
+
.audio-bubble-wrapper {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
gap: 0.5rem;
|
|
20
|
+
padding: 10px 10px 20px 10px;
|
|
21
|
+
margin: 0.25rem 0px 0.25rem auto;
|
|
22
|
+
border-radius: var(--radius-bubble);
|
|
23
|
+
width: 336px;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.sender-bg {
|
|
28
|
+
background-color: var(--bg-outgoing-message);
|
|
29
|
+
border: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.receiver-bg {
|
|
33
|
+
background-color: var(--bg-incoming-message);
|
|
34
|
+
border: 1px solid var(--bubble-border, var(--primary));
|
|
35
|
+
}
|
|
36
|
+
.sender-text {
|
|
37
|
+
color: var(--text-outgoing-message);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.receiver-text {
|
|
41
|
+
color: var(--text-incoming-message);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.sender-icon svg {
|
|
45
|
+
stroke: var(--text-outgoing-message);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.receiver-icon svg {
|
|
49
|
+
stroke: var(--text-incoming-message);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.audio-content {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
width: 100%;
|
|
56
|
+
gap: 10px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.wavesurfer-timeline-progress {
|
|
60
|
+
width: 10px !important;
|
|
61
|
+
height: 10px !important;
|
|
62
|
+
border-radius: 50% !important;
|
|
63
|
+
background-color: red !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.user_profile_picture {
|
|
67
|
+
width: 55px;
|
|
68
|
+
height: 55px;
|
|
69
|
+
object-fit: cover;
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media (max-width: 768px) {
|
|
74
|
+
.audio-bubble-wrapper {
|
|
75
|
+
width: 280px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.chat_audio_play_pause {
|
|
80
|
+
width: 24px;
|
|
81
|
+
height: 24px;
|
|
82
|
+
min-width: 24px;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.wave_container {
|
|
90
|
+
flex: 1;
|
|
91
|
+
height: 40px;
|
|
92
|
+
min-height: 40px;
|
|
93
|
+
border-radius: 4px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.audio-info {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: space-between;
|
|
100
|
+
width: 100%;
|
|
101
|
+
font-size: 10px;
|
|
102
|
+
margin-top: 4px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.audio-time {
|
|
106
|
+
font-size: 10px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.userContact_image {
|
|
110
|
+
width: 55px;
|
|
111
|
+
height: 55px;
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
background-color: #ccc;
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
font-size: 24px;
|
|
118
|
+
font-weight: bold;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.pointer {
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.message-footer {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: flex-end;
|
|
129
|
+
gap: 4px;
|
|
130
|
+
width: 100%;
|
|
131
|
+
margin-top: auto;
|
|
132
|
+
font-size: 12px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.emoji-slider {
|
|
136
|
+
position: absolute;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
emoji-reactions {
|
|
140
|
+
position: absolute;
|
|
141
|
+
top: 15px;
|
|
142
|
+
z-index: 99;
|
|
143
|
+
left: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.reaction-button {
|
|
147
|
+
position: absolute;
|
|
148
|
+
top: 50%;
|
|
149
|
+
right: -25px;
|
|
150
|
+
transform: translateY(-50%);
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
z-index: 100;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.remaining-count {
|
|
156
|
+
background-color: var(--bg-primary-light);
|
|
157
|
+
font-size: 14px;
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
color: var(--text-primary-color);
|
|
161
|
+
width: 25px;
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.reactions-display {
|
|
166
|
+
position: absolute;
|
|
167
|
+
bottom: -10px;
|
|
168
|
+
right: 10px;
|
|
169
|
+
display: grid;
|
|
170
|
+
grid-template-columns: repeat(3, auto);
|
|
171
|
+
gap: 0;
|
|
172
|
+
margin-top: 4px;
|
|
173
|
+
background-color: transparent;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.reaction-item {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
gap: 2px;
|
|
180
|
+
border-radius: 12px;
|
|
181
|
+
background: var(--bg-secondary-color);
|
|
182
|
+
font-size: 20px;
|
|
183
|
+
cursor: pointer;
|
|
184
|
+
}
|
|
185
|
+
`}constructor(){super();this.isPlaying=false;this.audioDuration="0:00";this.isSelf=false;this.showReactionButton=false;this.showEmojiReactions=false;this.reactions={};this.showAllReactionsPopup=false;this.showReactionOnHover=false}firstUpdated(){setTimeout((()=>{const t=this.shadowRoot.querySelector(".wave_container");if(t){this.dispatchEvent(new CustomEvent("waveformReady",{detail:t,bubbles:true,composed:true}))}else{console.error("Wave container element not found in shadowRoot")}}),50)}handleMouseEnter(){if(this.showReactionOnHover){this.showReactionButton=true}}handleReactionRemove(t){this.showEmojiReactions=false;this.showConfirmationPopup=true;this.selectedEmojiToRemove=t;setTimeout((()=>{document.addEventListener("click",this.handleOutsideClick)}),100)}handleMouseLeave(t){const i=this.renderRoot.querySelector(".message-container");const s=this.renderRoot.querySelector("emoji-reactions");const e=this.renderRoot.querySelector(".reaction-button");const n=this.showEmojiReactions;const o=i?.contains(t.relatedTarget);const r=s&&s?.contains(t.relatedTarget);const h=e&&e?.contains(t.relatedTarget);if(!o&&!r&&!h){this.showReactionButton=false;if(!n){this.showEmojiReactions=false}}}handleOutsideClick=t=>{const i=this.renderRoot.querySelector("emoji-reactions");const s=this.renderRoot.querySelector(".message-container");const e=this.renderRoot.querySelector("reaction-container");const n=t.composedPath();if(this.showEmojiReactions&&!n.includes(i)&&!n.includes(s)||this.showConfirmationPopup&&!n.includes(e)&&!n.includes(s)){this.showEmojiReactions=false;this.showConfirmationPopup=false;document.removeEventListener("click",this.handleOutsideClick)}};toggleEmojiReactions(){this.showConfirmationPopup=false;this.showEmojiReactions=!this.showEmojiReactions;if(this.showEmojiReactions){setTimeout((()=>{document.addEventListener("click",this.handleOutsideClick)}),100)}}handleEmojiClick(t){const i=this.userMetaData?.userId;const s=this.reactions[t.id]||[];const e=s.includes(i);let n=null;for(const[t,s]of Object.entries(this.reactions)){if(s.includes(i)){n=t;break}}if(n&&n!==t.id){this.dispatchEvent(new CustomEvent("reaction-removed",{detail:{messageId:this.messageId,emojiId:n},bubbles:true,composed:true}))}if(e){this.dispatchEvent(new CustomEvent("reaction-removed",{detail:{messageId:this.messageId,emojiId:t.id},bubbles:true,composed:true}))}else{this.dispatchEvent(new CustomEvent("reaction-added",{detail:{messageId:this.messageId,emojiId:t.id},bubbles:true,composed:true}))}this.showEmojiReactions=false;document.removeEventListener("click",this.handleOutsideClick)}handleConfirmRemove(){if(this.selectedEmojiToRemove){this.dispatchEvent(new CustomEvent("reaction-removed",{detail:{messageId:this.messageId,emojiId:this.selectedEmojiToRemove.emojiId},bubbles:true,composed:true}))}this.closeConfirmationPopup()}closeConfirmationPopup(){this.showConfirmationPopup=false;this.selectedEmojiToRemove=null}render(){const t=`audio-bubble-wrapper ${this.isSelf?"sender-bg":"receiver-bg"}`;const i=this.isSelf?"sender-text":"receiver-text";const e=document.createElement("emoji-reactions").emojis;const n=Object.keys(this.reactions).map((t=>{const i=e.find((i=>i.id===t));return{emojiId:t,messageId:this.reactions[t],src:i?.src}})).filter((t=>Array.isArray(t.messageId)&&t.messageId.length>0));const o=n.slice(0,2);const r=n.length>2?n.length-2:0;return s`
|
|
186
|
+
<div class=${t} @mouseover="${()=>this.handleMouseEnter()}"
|
|
187
|
+
@mouseout="${t=>this.handleMouseLeave(t)}">
|
|
188
|
+
${this.messageType===1?s`
|
|
189
|
+
${this.messageType===1?s`
|
|
190
|
+
<forward-ui></forward-ui>
|
|
191
|
+
`:null}
|
|
192
|
+
`:null}
|
|
193
|
+
<div class="audio-content">
|
|
194
|
+
${this._renderPlayPauseIcon()}
|
|
195
|
+
<div class="wave_container" id="waveform-container"></div>
|
|
196
|
+
</div>
|
|
197
|
+
${!this.isSelf&&this.showReactionButton?s`
|
|
198
|
+
<div class="reaction-button" @click="${()=>this.toggleEmojiReactions()}" ">
|
|
199
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="var(--text-primary-color)">
|
|
200
|
+
<path d="M612-516q25 0 42.5-17.5T672-576q0-25-17.5-42.5T612-636q-25 0-42.5 17.5T552-576q0 25 17.5 42.5T612-516Zm-264 0q25 0 42.5-17.5T408-576q0-25-17.5-42.5T348-636q-25 0-42.5 17.5T288-576q0 25 17.5 42.5T348-516Zm132 228q60 0 110.5-31t79.5-84H290q29 53 79.5 84T480-288Zm.28 192Q401-96 331-126t-122.5-82.5Q156-261 126-330.96t-30-149.5Q96-560 126-629.5q30-69.5 82.5-122T330.96-834q69.96-30 149.5-30t149.04 30q69.5 30 122 82.5T834-629.28q30 69.73 30 149Q864-401 834-331t-82.5 122.5Q699-156 629.28-126q-69.73 30-149 30ZM480-480Zm0 312q130 0 221-91t91-221q0-130-91-221t-221-91q-130 0-221 91t-91 221q0 130 91 221t221 91Z"/>
|
|
201
|
+
</svg>
|
|
202
|
+
</div>
|
|
203
|
+
`:""}
|
|
204
|
+
|
|
205
|
+
${this.showConfirmationPopup?s` <reaction-container .messageId=${this.messageId} .userMetaData=${this.userMetaData} .reactions=${n}></reaction-container> `:""}
|
|
206
|
+
${this.showEmojiReactions?s`
|
|
207
|
+
<emoji-reactions .isOpen="${this.showEmojiReactions}" .onEmojiSelect="${t=>this.handleEmojiClick(t)}" .selectedEmojis="${this.reactions}"></emoji-reactions>
|
|
208
|
+
`:""}
|
|
209
|
+
|
|
210
|
+
<div class="reactions-display">
|
|
211
|
+
${o?.map((t=>s`
|
|
212
|
+
<span class="reaction-item" @click="${()=>this.handleReactionRemove(t)}"> ${t.src?s`<span>${t.src}</span>`:""} </span>
|
|
213
|
+
`))}
|
|
214
|
+
${r>0?s`
|
|
215
|
+
<span @click="${()=>this.handleReactionRemove(o[0])}" class="reaction-item remaining-count" "> +${r} </span>
|
|
216
|
+
|
|
217
|
+
`:""}
|
|
218
|
+
</div>
|
|
219
|
+
<div class="audio-info">
|
|
220
|
+
<span class="audio-time ${i}">${this.audioDuration}</span>
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
${this.showFooter?s`
|
|
224
|
+
<div class="message-footer">
|
|
225
|
+
<timestamp-element time="${this.time||(new Date).toISOString()}" color="${this.timeColor}" ></timestamp-element>
|
|
226
|
+
${this.isSelf?this.isRead?s`<blue-read-mark></blue-read-mark>`:this.isDelivered==="true"?s`<double-mark></double-mark>`:this.isDelivered==="pending"?s`<clock-mark></clock-mark>`:s`<single-mark></single-mark>`:""}
|
|
227
|
+
</div>`:null}
|
|
228
|
+
</div>
|
|
229
|
+
`}_renderPlayPauseIcon(){const t=`chat_audio_play_pause pointer ${this.isSelf?"sender-icon":"receiver-icon"}`;if(this.isPlaying){return s`
|
|
230
|
+
<div @click=${this.pauseAudioHandler} class=${t}>
|
|
231
|
+
<svg
|
|
232
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
233
|
+
width="24"
|
|
234
|
+
height="24"
|
|
235
|
+
viewBox="0 0 24 24"
|
|
236
|
+
fill="none"
|
|
237
|
+
stroke="currentColor"
|
|
238
|
+
stroke-width="2"
|
|
239
|
+
stroke-linecap="round"
|
|
240
|
+
stroke-linejoin="round"
|
|
241
|
+
>
|
|
242
|
+
<rect x="6" y="4" width="4" height="16"></rect>
|
|
243
|
+
<rect x="14" y="4" width="4" height="16"></rect>
|
|
244
|
+
</svg>
|
|
245
|
+
</div>
|
|
246
|
+
`}else{return s`
|
|
247
|
+
<div @click=${this.playAudioHandler} class=${t}>
|
|
248
|
+
<svg
|
|
249
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
250
|
+
width="24"
|
|
251
|
+
height="24"
|
|
252
|
+
viewBox="0 0 24 24"
|
|
253
|
+
fill="none"
|
|
254
|
+
stroke="currentColor"
|
|
255
|
+
stroke-width="2"
|
|
256
|
+
stroke-linecap="round"
|
|
257
|
+
stroke-linejoin="round"
|
|
258
|
+
>
|
|
259
|
+
<polygon points="5 3 19 12 5 21 5 3"></polygon>
|
|
260
|
+
</svg>
|
|
261
|
+
</div>
|
|
262
|
+
`}}}customElements.define("audio-bubble-ui",gt);class mt extends t{static properties={allAttachments:{type:Array,hasChanged(t,i){return JSON.stringify(t)!==JSON.stringify(i)}},mainImageIndex:{type:Number},topbarBgColor:{type:String},iconColor:{type:String},galleryImageSize:{type:String},isZoomed:{type:Boolean},loadingMediaGallery:{type:Boolean},zoomLevel:{type:Number},isSharePopupOpen:{type:Boolean},shareLink:{type:String}};static styles=i`
|
|
263
|
+
:host {
|
|
264
|
+
display: block;
|
|
265
|
+
font-family: Arial, sans-serif;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.media-gallery-container {
|
|
269
|
+
width: 100%;
|
|
270
|
+
height: 100%;
|
|
271
|
+
z-index: 1000;
|
|
272
|
+
display: flex;
|
|
273
|
+
flex-direction: column;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.topbar {
|
|
277
|
+
display: flex;
|
|
278
|
+
justify-content: flex-end;
|
|
279
|
+
background-color: var(--bg-secondary-color);
|
|
280
|
+
padding: 10px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.topbar-icon-container {
|
|
284
|
+
display: flex;
|
|
285
|
+
align-items: center;
|
|
286
|
+
gap: 10px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.icon {
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
color: var(--text-primary-color);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.popup-overlay {
|
|
295
|
+
position: fixed;
|
|
296
|
+
top: 0;
|
|
297
|
+
left: 0;
|
|
298
|
+
height: 100%;
|
|
299
|
+
width: 100%;
|
|
300
|
+
background-color: var(--overlay-color);
|
|
301
|
+
z-index: 999;
|
|
302
|
+
display: flex;
|
|
303
|
+
justify-content: center;
|
|
304
|
+
align-items: center;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.main-image-container {
|
|
308
|
+
text-align: center;
|
|
309
|
+
padding: 10px;
|
|
310
|
+
background-color: var(--bg-primary-color);
|
|
311
|
+
height: 50%;
|
|
312
|
+
position: relative;
|
|
313
|
+
touch-action: pan-y pinch-zoom;
|
|
314
|
+
flex: 1;
|
|
315
|
+
cursor: zoom-in;
|
|
316
|
+
overflow: hidden;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.main-image-container.zoomed {
|
|
320
|
+
cursor: move;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.main-image {
|
|
324
|
+
max-width: 100%;
|
|
325
|
+
height: 100%;
|
|
326
|
+
border-radius: 5px;
|
|
327
|
+
transition: transform 0.2s ease;
|
|
328
|
+
object-fit: contain;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.zoom-controls {
|
|
332
|
+
position: absolute;
|
|
333
|
+
bottom: 20px;
|
|
334
|
+
left: 50%;
|
|
335
|
+
transform: translateX(-50%);
|
|
336
|
+
background: rgba(0, 0, 0, 0.6);
|
|
337
|
+
border-radius: 20px;
|
|
338
|
+
padding: 5px 10px;
|
|
339
|
+
display: flex;
|
|
340
|
+
align-items: center;
|
|
341
|
+
gap: 10px;
|
|
342
|
+
z-index: 10;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.zoom-btn {
|
|
346
|
+
background: none;
|
|
347
|
+
border: none;
|
|
348
|
+
color: white;
|
|
349
|
+
font-size: 20px;
|
|
350
|
+
cursor: pointer;
|
|
351
|
+
width: 30px;
|
|
352
|
+
height: 30px;
|
|
353
|
+
display: flex;
|
|
354
|
+
align-items: center;
|
|
355
|
+
justify-content: center;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.zoom-level {
|
|
359
|
+
color: white;
|
|
360
|
+
font-size: 14px;
|
|
361
|
+
min-width: 50px;
|
|
362
|
+
text-align: center;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.nav-arrow {
|
|
366
|
+
position: absolute;
|
|
367
|
+
top: 50%;
|
|
368
|
+
transform: translateY(-50%);
|
|
369
|
+
background: rgba(0, 0, 0, 0.5);
|
|
370
|
+
color: white;
|
|
371
|
+
padding: 15px 10px;
|
|
372
|
+
cursor: pointer;
|
|
373
|
+
border: none;
|
|
374
|
+
border-radius: 4px;
|
|
375
|
+
font-size: 20px;
|
|
376
|
+
z-index: 1;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.nav-arrow:hover {
|
|
380
|
+
background: rgba(0, 0, 0, 0.7);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.nav-arrow.left {
|
|
384
|
+
left: 10px;
|
|
385
|
+
}
|
|
386
|
+
.nav-arrow.right {
|
|
387
|
+
right: 10px;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.gallery {
|
|
391
|
+
display: flex;
|
|
392
|
+
gap: 10px;
|
|
393
|
+
background-color: var(--bg-secondary-color);
|
|
394
|
+
padding: 10px;
|
|
395
|
+
overflow-x: auto;
|
|
396
|
+
scrollbar-width: thin;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.gallery::-webkit-scrollbar {
|
|
400
|
+
height: 6px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.gallery::-webkit-scrollbar-thumb {
|
|
404
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
405
|
+
border-radius: 3px;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.gallery-image,
|
|
409
|
+
.gallery-video-container {
|
|
410
|
+
width: var(--gallery-image-size, 70px);
|
|
411
|
+
height: var(--gallery-image-size, 70px);
|
|
412
|
+
flex-shrink: 0;
|
|
413
|
+
border-radius: 5px;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.gallery-image {
|
|
417
|
+
object-fit: cover;
|
|
418
|
+
cursor: pointer;
|
|
419
|
+
transition: transform 0.2s;
|
|
420
|
+
background-color: var(--base-color);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.gallery-image:hover,
|
|
424
|
+
.gallery-video-container:hover {
|
|
425
|
+
transform: scale(1.05);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.gallery-image.selected,
|
|
429
|
+
.gallery-video-container.selected {
|
|
430
|
+
transform: scale(1.1);
|
|
431
|
+
outline: 3px solid var(--base-color);
|
|
432
|
+
outline-offset: 2px;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.unsupported-media {
|
|
436
|
+
display: flex;
|
|
437
|
+
justify-content: center;
|
|
438
|
+
align-items: center;
|
|
439
|
+
height: 100%;
|
|
440
|
+
font-size: 20px;
|
|
441
|
+
color: #808080;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.video-thumbnail {
|
|
445
|
+
width: 70px;
|
|
446
|
+
height: 70px;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.spinner-wrapper {
|
|
450
|
+
position: absolute;
|
|
451
|
+
top: 50%;
|
|
452
|
+
left: 50%;
|
|
453
|
+
transform: translate(-50%, -50%);
|
|
454
|
+
display: flex;
|
|
455
|
+
justify-content: center;
|
|
456
|
+
align-items: center;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.audio-wrapper{
|
|
460
|
+
height: 100%;
|
|
461
|
+
display: flex;
|
|
462
|
+
align-items: center;
|
|
463
|
+
justify-content: center;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
@media (max-width: 768px) {
|
|
467
|
+
.main-image { max-height: 100%; }
|
|
468
|
+
.gallery-image, .gallery-video-container {
|
|
469
|
+
width: calc(var(--gallery-image-size, 70px) - 10px);
|
|
470
|
+
height: calc(var(--gallery-image-size, 70px) - 10px);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
`;constructor(){super();this.mainImageIndex=0;this.topbarBgColor="#f1f1f1";this.iconColor="var(--text-primary-color)";this.galleryImageSize="70px";this.isZoomed=false;this.loadingMediaGallery=false;this._mediaItems=null;this._boundKeyHandler=this.handleKeyPress.bind(this);this._attachmentsHash="";this.zoomLevel=1;this.minZoom=1;this.maxZoom=5;this.zoomStep=.5;this.isDragging=false;this.startX=0;this.startY=0;this.translateX=0;this.translateY=0;this.initialPinchDistance=0;this.imageBounds={width:0,height:0};this.containerBounds={width:0,height:0}}connectedCallback(){super.connectedCallback();window.addEventListener("keydown",this._boundKeyHandler)}disconnectedCallback(){super.disconnectedCallback();window.removeEventListener("keydown",this._boundKeyHandler);this._removeZoomListeners()}updated(t){super.updated(t);if(t.has("allAttachments")){this.resetMediaItemsCache()}if(t.has("mainImageIndex")){this.resetZoom()}if(t.has("isZoomed")){const t=this.shadowRoot.querySelector(".main-image-container");if(this.isZoomed){t.classList.add("zoomed");this._setupZoomListeners();this._updateBoundingBoxes()}else{t.classList.remove("zoomed");this._removeZoomListeners();this.resetZoom()}}if(t.has("zoomLevel")){this._updateBoundingBoxes()}}_updateBoundingBoxes(){requestAnimationFrame((()=>{const t=this.shadowRoot.querySelector(".main-image-container");const i=this.shadowRoot.querySelector(".main-image");if(!t||!i)return;const s=i.offsetWidth/this.zoomLevel;const e=i.offsetHeight/this.zoomLevel;this.imageBounds={width:s*this.zoomLevel,height:e*this.zoomLevel};this.containerBounds={width:t.clientWidth,height:t.clientHeight}}))}_calculateAttachmentsHash(t){return JSON.stringify(t)}_processAttachments(){if(!this.allAttachments)return[];return this.allAttachments.reduce(((t,i)=>{if(i.attachments?.length){const s=i.attachments.filter((t=>t.mimeType?.match(/^(image|video|audio)\//)));return[...t,...s]}return t}),[])}get mediaItems(){const t=this._calculateAttachmentsHash(this.allAttachments);if(this._mediaItems===null||t!==this._attachmentsHash){this._attachmentsHash=t;this._mediaItems=this._processAttachments()}return this._mediaItems}resetMediaItemsCache(){this._mediaItems=null;this._attachmentsHash=""}handleKeyPress(t){const i=this.mediaItems[this.mainImageIndex];const s=i?.mimeType?.startsWith("image/");switch(t.key){case"ArrowLeft":this.navigateImage("prev");break;case"ArrowRight":this.navigateImage("next");break;case"Escape":if(this.isZoomed){this.resetZoom()}else{this.closeGallery()}break;case"+":if(s)this.zoomIn();break;case"-":if(s)this.zoomOut();break;case" ":case"Enter":if(s)this.toggleZoom();break}}navigateImage(t){const i=t==="next"?Math.min(this.mainImageIndex+1,this.mediaItems.length-1):Math.max(this.mainImageIndex-1,0);if(i!==this.mainImageIndex){this.isZoomed=false;this.mainImageIndex=i}}toggleZoom(){this.isZoomed=!this.isZoomed;if(this.isZoomed){this.zoomLevel=1.5;this._updateBoundingBoxes();this.updateZoomStyle()}else{this.resetZoom()}}resetZoom(){this.zoomLevel=1;this.translateX=0;this.translateY=0;this.isZoomed=false;this.updateZoomStyle()}zoomIn(t){if(t)t.stopPropagation();if(this.zoomLevel<this.maxZoom){this.zoomLevel=Math.min(this.zoomLevel+this.zoomStep,this.maxZoom);this._updateBoundingBoxes();this.constrainTranslation();this.updateZoomStyle()}}zoomOut(t){if(t)t.stopPropagation();if(this.zoomLevel>this.minZoom){this.zoomLevel=Math.max(this.zoomLevel-this.zoomStep,this.minZoom);if(this.zoomLevel===this.minZoom){this.translateX=0;this.translateY=0}else{this._updateBoundingBoxes();this.constrainTranslation()}this.updateZoomStyle()}}constrainTranslation(){const t=Math.max(0,this.imageBounds.width-this.containerBounds.width);const i=Math.max(0,this.imageBounds.height-this.containerBounds.height);const s=this.containerBounds.width*.2;const e=this.containerBounds.height*.2;const n=t/2+(this.containerBounds.width-s)/2;const o=i/2+(this.containerBounds.height-e)/2;this.translateX=Math.max(-n,Math.min(n,this.translateX));this.translateY=Math.max(-o,Math.min(o,this.translateY))}updateZoomStyle(){const t=this.shadowRoot.querySelector(".main-image");if(!t)return;t.style.transform=`translate(${this.translateX}px, ${this.translateY}px) scale(${this.zoomLevel})`;const i=this.shadowRoot.querySelector(".main-image-container");if(i){if(this.zoomLevel>1){i.classList.add("zoomed")}else{i.classList.remove("zoomed")}}this.requestUpdate()}_setupZoomListeners(){const t=this.shadowRoot.querySelector(".main-image-container");const i=this.shadowRoot.querySelector(".main-image");if(!t||!i)return;this._boundMouseDown=this.handleMouseDown.bind(this);this._boundMouseMove=this.handleMouseMove.bind(this);this._boundMouseUp=this.handleMouseUp.bind(this);this._boundWheel=this.handleWheel.bind(this);this._boundTouchStart=this.handleTouchStart.bind(this);this._boundTouchMove=this.handleTouchMove.bind(this);this._boundTouchEnd=this.handleTouchEnd.bind(this);t.addEventListener("mousedown",this._boundMouseDown);window.addEventListener("mousemove",this._boundMouseMove);window.addEventListener("mouseup",this._boundMouseUp);t.addEventListener("wheel",this._boundWheel);t.addEventListener("touchstart",this._boundTouchStart,{passive:false});t.addEventListener("touchmove",this._boundTouchMove,{passive:false});t.addEventListener("touchend",this._boundTouchEnd);this._boundResizeHandler=this._updateBoundingBoxes.bind(this);window.addEventListener("resize",this._boundResizeHandler);this._updateBoundingBoxes()}_removeZoomListeners(){const t=this.shadowRoot.querySelector(".main-image-container");if(!t)return;if(this._boundMouseDown){t.removeEventListener("mousedown",this._boundMouseDown);window.removeEventListener("mousemove",this._boundMouseMove);window.removeEventListener("mouseup",this._boundMouseUp);t.removeEventListener("wheel",this._boundWheel);t.removeEventListener("touchstart",this._boundTouchStart);t.removeEventListener("touchmove",this._boundTouchMove);t.removeEventListener("touchend",this._boundTouchEnd)}if(this._boundResizeHandler){window.removeEventListener("resize",this._boundResizeHandler)}}handleMouseDown(t){const i=this.mediaItems[this.mainImageIndex];const s=i?.mimeType?.startsWith("image/");if(!s||this.zoomLevel<=1)return;this.isDragging=true;this.startX=t.clientX-this.translateX;this.startY=t.clientY-this.translateY;t.preventDefault()}handleMouseMove(t){if(!this.isDragging)return;const i=t.clientX-this.startX;const s=t.clientY-this.startY;this.translateX=i;this.translateY=s;this.constrainTranslation();this.updateZoomStyle();t.preventDefault()}handleMouseUp(){this.isDragging=false}handleWheel(t){t.preventDefault();const i=this.mediaItems[this.mainImageIndex];const s=i?.mimeType?.startsWith("image/");if(!s)return;const e=this.shadowRoot.querySelector(".main-image-container");e.getBoundingClientRect();const n=this.zoomLevel;if(t.deltaY<0){this.zoomIn()}else{this.zoomOut()}if(n!==this.zoomLevel&&this.zoomLevel>1){this.constrainTranslation()}}handleTouchStart(t){const i=this.mediaItems[this.mainImageIndex];const s=i?.mimeType?.startsWith("image/");if(!s)return;t.preventDefault();if(t.touches.length===1){this.isDragging=true;this.startX=t.touches[0].clientX-this.translateX;this.startY=t.touches[0].clientY-this.translateY}else if(t.touches.length===2){this.isDragging=false;const i=t.touches[0];const s=t.touches[1];this.initialPinchDistance=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)}}handleTouchMove(t){const i=this.mediaItems[this.mainImageIndex];const s=i?.mimeType?.startsWith("image/");if(!s||this.zoomLevel<=1&&t.touches.length===1)return;t.preventDefault();if(t.touches.length===1&&this.isDragging){this.translateX=t.touches[0].clientX-this.startX;this.translateY=t.touches[0].clientY-this.startY;this.constrainTranslation();this.updateZoomStyle()}else if(t.touches.length===2){const i=t.touches[0];const s=t.touches[1];const e=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY);if(this.initialPinchDistance>0){const t=e/this.initialPinchDistance;const i=Math.max(this.minZoom,Math.min(this.maxZoom,this.zoomLevel*t));this.zoomLevel=i;this.initialPinchDistance=e;this._updateBoundingBoxes();this.constrainTranslation();this.updateZoomStyle()}}}handleTouchEnd(t){this.isDragging=false;this.initialPinchDistance=0;if(this.zoomLevel<=this.minZoom){this.resetZoom()}}handleShare(){const t=this.mediaItems[this.mainImageIndex];if(!t)return;e.openDialog("share-popup",{titleColor:"var(--text-primary-color)",ctaColor:"var(--bg-primary-color)",title:n.POPUP_MESSAGES.SHARE_MEDIA_LABEL,shareLink:t.mediaUrl})}async handleDownload(){const t=this.mediaItems[this.mainImageIndex];if(!t)return;const i=t.mimeType?.includes("/")?"."+t.mimeType.split("/")[1]:".jpg";try{const s=await fetch(t.mediaUrl);const e=await s.blob();const n=URL.createObjectURL(e);const o=document.createElement("a");o.href=n;o.download=`chat-media${i}`;document.body.appendChild(o);o.click();document.body.removeChild(o);URL.revokeObjectURL(n)}catch(t){console.error("Download failed:",t)}}openShareWindow(t){window.open(`mailto:?body=${encodeURIComponent(t)}`,"_blank")}closeGallery(){this.dispatchEvent(new CustomEvent("close",{bubbles:true,composed:true}))}render(){const t=this.mediaItems;if(this.loadingMediaGallery&&!t.length){return s`<div class="spinner-wrapper">
|
|
474
|
+
<spinner-loader
|
|
475
|
+
height="15px"
|
|
476
|
+
width="15px"
|
|
477
|
+
spinTime="1s"
|
|
478
|
+
spinnerPrimaryColor="var(--bg-primary-color)"
|
|
479
|
+
spinnerSecondaryColor="var(--text-primary-color)"
|
|
480
|
+
spinnerBorderWidth="2px"
|
|
481
|
+
></spinner-loader>
|
|
482
|
+
</div>`}if(!this.loadingMediaGallery&&!t.length){return s`<div class="unsupported-media">${n.PLACEHOLDER_CONTENT.UNSUPPORTED_MEDIA}</div>`}const i=t[this.mainImageIndex];const e=i?.mimeType?.startsWith("image/");const h=i?.mimeType?.startsWith("video/");const a=i?.mimeType?.startsWith("audio/");return s`
|
|
483
|
+
<div class="media-gallery-container">
|
|
484
|
+
<div class="topbar">
|
|
485
|
+
<div class="topbar-icon-container">
|
|
486
|
+
${!a?s` <span class="icon" @click=${this.handleShare}>
|
|
487
|
+
<svg width="20" height="20" fill="var(--text-primary-color)" viewBox="0 0 1920 1920">
|
|
488
|
+
<path
|
|
489
|
+
d="M1513.827 1278.28c-96.772 0-182.634 43.765-241.415 111.531l-564.2-325.737c11.807-33.498 19.508-69.049 19.508-106.654 0-34.91-7.06-68.022-17.327-99.595l563.815-325.48c58.782 66.482 143.746 109.35 239.619 109.35 177.243 0 320.86-143.618 320.86-320.86 0-177.244-143.617-320.86-320.86-320.86-177.243 0-320.86 143.616-320.86 320.86 0 35.165 7.059 68.407 17.454 99.98l-563.686 325.48C587.953 679.554 502.86 636.56 406.86 636.56 229.617 636.56 86 780.177 86 957.42c0 177.243 143.617 320.86 320.86 320.86 93.434 0 176.601-40.428 235.254-104.215l567.537 327.662c-9.882 30.803-16.684 63.145-16.684 97.413 0 177.243 143.617 320.86 320.86 320.86 177.243 0 320.86-143.617 320.86-320.86 0-177.243-143.617-320.86-320.86-320.86"
|
|
490
|
+
/>
|
|
491
|
+
</svg>
|
|
492
|
+
</span>`:null}
|
|
493
|
+
<span class="icon" @click=${this.handleDownload}>
|
|
494
|
+
<svg width="24" fill="var(--text-primary-color)" height="24" viewBox="0 0 24 24">
|
|
495
|
+
<path
|
|
496
|
+
d="M9.163 2.819C9 3.139 9 3.559 9 4.4V11H7.803c-.883 0-1.325 0-1.534.176a.75.75 0 0 0-.266.62c.017.274.322.593.931 1.232l4.198 4.401c.302.318.453.476.63.535a.749.749 0 0 0 .476 0c.177-.059.328-.217.63-.535l4.198-4.4c.61-.64.914-.96.93-1.233a.75.75 0 0 0-.265-.62C17.522 11 17.081 11 16.197 11H15V4.4c0-.84 0-1.26-.164-1.581a1.5 1.5 0 0 0-.655-.656C13.861 2 13.441 2 12.6 2h-1.2c-.84 0-1.26 0-1.581.163a1.5 1.5 0 0 0-.656.656zM5 21a1 1 0 0 0 1 1h12a1 1 0 1 0 0-2H6a1 1 0 0 0-1 1z"
|
|
497
|
+
/>
|
|
498
|
+
</svg>
|
|
499
|
+
</span>
|
|
500
|
+
<span class="icon" @click=${this.closeGallery}>
|
|
501
|
+
<svg width="24" height="24" fill="var(--text-primary-color)" viewBox="0 0 24 24">
|
|
502
|
+
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
|
503
|
+
</svg>
|
|
504
|
+
</span>
|
|
505
|
+
</div>
|
|
506
|
+
</div>
|
|
507
|
+
|
|
508
|
+
<div class="main-image-container">
|
|
509
|
+
${this.mainImageIndex>0?s`<button class="nav-arrow left" @click=${t=>(t.stopPropagation(),this.navigateImage("prev"))}>←</button>`:""}
|
|
510
|
+
|
|
511
|
+
${e?s`
|
|
512
|
+
<img src="${i.mediaUrl}" alt="Main Image" class="main-image" @dblclick=${this.toggleZoom} />
|
|
513
|
+
${this.isZoomed&&e?s`
|
|
514
|
+
<div class="zoom-controls">
|
|
515
|
+
<button class="zoom-btn" @click=${this.zoomOut}>−</button>
|
|
516
|
+
<span class="zoom-level">${Math.round(this.zoomLevel*100)}%</span>
|
|
517
|
+
<button class="zoom-btn" @click=${this.zoomIn}>+</button>
|
|
518
|
+
</div>
|
|
519
|
+
`:""}
|
|
520
|
+
`:h?s`<video src="${i.mediaUrl}" class="main-image" controls autoplay></video>`:a?s`
|
|
521
|
+
<div class='audio-wrapper' key=${i?.mediaUrl}>
|
|
522
|
+
<audio-bubble
|
|
523
|
+
.audioUrl=${i?.mediaUrl}
|
|
524
|
+
.showFooter=${false}
|
|
525
|
+
></audio-bubble>
|
|
526
|
+
</div>
|
|
527
|
+
`:s`<div class="unsupported-media">${n.UNSUPPORTED_MEDIA_TYPES}</div>`}
|
|
528
|
+
|
|
529
|
+
${this.mainImageIndex<t.length-1?s`<button class="nav-arrow right" @click=${t=>(t.stopPropagation(),this.navigateImage("next"))}>→</button>`:""}
|
|
530
|
+
</div>
|
|
531
|
+
|
|
532
|
+
<div class="gallery">
|
|
533
|
+
${t.map(((t,i)=>{const e=t.mimeType?.startsWith("video/");const n=t.mimeType?.startsWith("audio/");return e?s`
|
|
534
|
+
<div class="gallery-video-container ${i===this.mainImageIndex?"selected":""}"
|
|
535
|
+
@click=${()=>this.mainImageIndex=i}>
|
|
536
|
+
<img class='video-thumbnail' src="${o}"></img>
|
|
537
|
+
</div>`:n?s`
|
|
538
|
+
<img src="${r}"
|
|
539
|
+
alt="Gallery Image ${i+1}"
|
|
540
|
+
class="gallery-image ${i===this.mainImageIndex?"selected":""}"
|
|
541
|
+
@click=${()=>this.mainImageIndex=i} />`:s`
|
|
542
|
+
<img src="${t.mediaUrl}"
|
|
543
|
+
alt="Gallery Image ${i+1}"
|
|
544
|
+
class="gallery-image ${i===this.mainImageIndex?"selected":""}"
|
|
545
|
+
@click=${()=>this.mainImageIndex=i} />`}))}
|
|
546
|
+
</div>
|
|
547
|
+
</div>
|
|
548
|
+
`}}customElements.define("media-gallery",mt);const vt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIEdlbmVyYXRvcjogU1ZHIFJlcG8gTWl4ZXIgVG9vbHMgLS0+CjxzdmcgZmlsbD0iIzAwMDAwMCIgd2lkdGg9IjgwMHB4IiBoZWlnaHQ9IjgwMHB4IiB2aWV3Qm94PSIwIDAgMzUgMzUiIGRhdGEtbmFtZT0iTGF5ZXIgMiIgaWQ9ImY3YjlkMzFiLTNkYjQtNDhkYi05NjMwLTViNDYyNDk5NmY1OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMjkuNDY3LDM0Ljc0OUg1LjUzQTUuMjg4LDUuMjg4LDAsMCwxLC4yNSwyOS40NjdWNS41MzJBNS4yODYsNS4yODYsMCwwLDEsNS41My4yNTJIMjkuNDY3YTUuMjg2LDUuMjg2LDAsMCwxLDUuMjgsNS4yOFYyOS40NjdBNS4yODgsNS4yODgsMCwwLDEsMjkuNDY3LDM0Ljc0OVpNNS41MywyLjc1MmEyLjc4MywyLjc4MywwLDAsMC0yLjc4LDIuNzhWMjkuNDY3YTIuNzg0LDIuNzg0LDAsMCwwLDIuNzgsMi43ODJIMjkuNDY3YTIuNzg0LDIuNzg0LDAsMCwwLDIuNzgtMi43ODJWNS41MzJhMi43ODMsMi43ODMsMCwwLDAtMi43OC0yLjc4WiIvPjxwYXRoIGQ9Ik0xMS44NiwxNy4yMjZhNC40NjgsNC40NjgsMCwxLDEsNC40NjgtNC40NjhBNC40NzMsNC40NzMsMCwwLDEsMTEuODYsMTcuMjI2Wm0wLTYuNDM1YTEuOTY4LDEuOTY4LDAsMSwwLDEuOTY4LDEuOTY3QTEuOTcsMS45NywwLDAsMCwxMS44NiwxMC43OTFaIi8+PHBhdGggZD0iTTIuNjY0LDMxLjkyYTEuMjUsMS4yNSwwLDAsMS0uOTI5LTIuMDg1bDUuODc2LTYuNTQ3YTMuMjg4LDMuMjg4LDAsMCwxLDQuNTUzLS4zNDFsMi41MjUsMi4wODRhLjc3Ljc3LDAsMCwwLC42LjE3OC43OTQuNzk0LDAsMCwwLC41NDMtLjNsNi42NDQtOC41ODRhMy4yNzcsMy4yNzcsMCwwLDEsMi42LTEuMjc5aC4wMTJBMy4yODIsMy4yODIsMCwwLDEsMjcuNjczLDE2LjNsNi4zNzIsOC4xMDdhMS4yNSwxLjI1LDAsMCwxLTEuOTY2LDEuNTQ1bC02LjM3Mi04LjEwN2EuNzg1Ljc4NSwwLDAsMC0uNjI3LS4zLjg2NC44NjQsMCwwLDAtLjYzMS4zMDlMMTcuOCwyNi40MzRhMy4zLDMuMywwLDAsMS00LjcwNy41MjVsLTIuNTI1LTIuMDg0YS43OTQuNzk0LDAsMCwwLTEuMS4wODNMMy42LDMxLjVBMS4yNDUsMS4yNDUsMCwwLDEsMi42NjQsMzEuOTJaIi8+PC9zdmc+";export{pt as W,r as e,vt as i,o as v};
|
|
549
|
+
//# sourceMappingURL=p-12e56271.js.map
|