@8wave/ai-elements 0.125.0-beta.16 → 0.125.0-beta.18

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.
Files changed (145) hide show
  1. package/README.md +24 -0
  2. package/dist/_chunks/{PkChatbotFilePreview-xDlDvl5m.js → PkChatbotFilePreview-CFGqa-tX.js} +2 -2
  3. package/dist/_chunks/{PkChatbotFilePreview-xDlDvl5m.js.map → PkChatbotFilePreview-CFGqa-tX.js.map} +1 -1
  4. package/dist/_chunks/{PkFilePreview-8nVPKv8k.js → PkFilePreview-BIFkMsAC.js} +559 -718
  5. package/dist/_chunks/PkFilePreview-BIFkMsAC.js.map +1 -0
  6. package/dist/_chunks/{PkFilePreviewDialog-BHPcGlnF.js → PkFilePreviewDialog-NLk4gZMd.js} +8 -8
  7. package/dist/_chunks/{PkFilePreviewDialog-BHPcGlnF.js.map → PkFilePreviewDialog-NLk4gZMd.js.map} +1 -1
  8. package/dist/_chunks/PkSelectionActions-CUymhwsG.js +168 -0
  9. package/dist/_chunks/PkSelectionActions-CUymhwsG.js.map +1 -0
  10. package/dist/_chunks/{PkStreamingMarkdown-BFTTLuPc.js → PkStreamingMarkdown-CqLpNWQv.js} +2 -2
  11. package/dist/_chunks/{PkStreamingMarkdown-BFTTLuPc.js.map → PkStreamingMarkdown-CqLpNWQv.js.map} +1 -1
  12. package/dist/_chunks/{PkToolChatFile-Buv7Qkes.js → PkToolChatFile-iE4ZokYD.js} +2 -2
  13. package/dist/_chunks/{PkToolChatFile-Buv7Qkes.js.map → PkToolChatFile-iE4ZokYD.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShareDocument-kB0qoQda.js → PkToolShareDocument-lTHNZodf.js} +2 -2
  15. package/dist/_chunks/{PkToolShareDocument-kB0qoQda.js.map → PkToolShareDocument-lTHNZodf.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowArtifact-ClYqvIqB.js → PkToolShowArtifact-BNQrM5fY.js} +2 -2
  17. package/dist/_chunks/{PkToolShowArtifact-ClYqvIqB.js.map → PkToolShowArtifact-BNQrM5fY.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowContactForm-C0ABjvtZ.js → PkToolShowContactForm-CvQoLumn.js} +2 -2
  19. package/dist/_chunks/{PkToolShowContactForm-C0ABjvtZ.js.map → PkToolShowContactForm-CvQoLumn.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowDiagram-BZbHtEs5.js → PkToolShowDiagram-COt1Z3q9.js} +2 -2
  21. package/dist/_chunks/{PkToolShowDiagram-BZbHtEs5.js.map → PkToolShowDiagram-COt1Z3q9.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowForm-DUjR-9o1.js → PkToolShowForm-DcPccCEU.js} +2 -2
  23. package/dist/_chunks/{PkToolShowForm-DUjR-9o1.js.map → PkToolShowForm-DcPccCEU.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowImageGallery-CNU2Zvso.js → PkToolShowImageGallery-DefXra8-.js} +2 -2
  25. package/dist/_chunks/{PkToolShowImageGallery-CNU2Zvso.js.map → PkToolShowImageGallery-DefXra8-.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowSources-DhDjNIFa.js → PkToolShowSources-BE3Zv_uz.js} +2 -2
  27. package/dist/_chunks/{PkToolShowSources-DhDjNIFa.js.map → PkToolShowSources-BE3Zv_uz.js.map} +1 -1
  28. package/dist/_chunks/{useLightbox-BEEzZ0qT.js → useLightbox-D2Zi-Fpe.js} +72 -13
  29. package/dist/_chunks/useLightbox-D2Zi-Fpe.js.map +1 -0
  30. package/dist/ai-elements.es.js +4692 -4268
  31. package/dist/ai-elements.es.js.map +1 -1
  32. package/dist-vue/PkChatbot.js +1 -1
  33. package/dist-vue/PkChatbotEmptyState.js +1 -1
  34. package/dist-vue/PkChatbotFilePreview.js +1 -1
  35. package/dist-vue/PkChatbotInput.js +1 -1
  36. package/dist-vue/PkChatbotMessages.js +1 -1
  37. package/dist-vue/PkChatbotStepPayload.js +1 -1
  38. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  39. package/dist-vue/PkChatbotSteps.js +1 -1
  40. package/dist-vue/PkChatbotViewChat.js +1 -1
  41. package/dist-vue/PkChatbotViewConversations.js +1 -1
  42. package/dist-vue/PkChatbotViewFiles.js +1 -1
  43. package/dist-vue/PkChatbotViewProfile.js +1 -1
  44. package/dist-vue/_chunks/{Agent-DmxsItHG.js → Agent-Cm1LrkYm.js} +162 -162
  45. package/dist-vue/_chunks/{Agent-DmxsItHG.js.map → Agent-Cm1LrkYm.js.map} +1 -1
  46. package/dist-vue/_chunks/{Document-CXfJxfu6.js → Document-DHBTrCuO.js} +10 -10
  47. package/dist-vue/_chunks/{Document-CXfJxfu6.js.map → Document-DHBTrCuO.js.map} +1 -1
  48. package/dist-vue/_chunks/{PkChatbot-Bpo22_yE.js → PkChatbot-DCGQnndK.js} +10 -9
  49. package/dist-vue/_chunks/PkChatbot-DCGQnndK.js.map +1 -0
  50. package/dist-vue/_chunks/{PkChatbotEmptyState-CQ_Qdkge.js → PkChatbotEmptyState-COya3H3C.js} +2 -2
  51. package/dist-vue/_chunks/{PkChatbotEmptyState-CQ_Qdkge.js.map → PkChatbotEmptyState-COya3H3C.js.map} +1 -1
  52. package/dist-vue/_chunks/{PkChatbotFilePreview-BpVM850N.js → PkChatbotFilePreview-BsvT6orx.js} +2 -2
  53. package/dist-vue/_chunks/{PkChatbotFilePreview-BpVM850N.js.map → PkChatbotFilePreview-BsvT6orx.js.map} +1 -1
  54. package/dist-vue/_chunks/{PkChatbotInput-BVu1b2Te.js → PkChatbotInput-D0KUEkAs.js} +5 -4
  55. package/dist-vue/_chunks/PkChatbotInput-D0KUEkAs.js.map +1 -0
  56. package/dist-vue/_chunks/{PkChatbotMessages-DftNL5ZQ.js → PkChatbotMessages-l-IzEWsN.js} +21 -21
  57. package/dist-vue/_chunks/{PkChatbotMessages-DftNL5ZQ.js.map → PkChatbotMessages-l-IzEWsN.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkChatbotStepPayload-AiDZPbds.js → PkChatbotStepPayload-cuYclK_2.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-AiDZPbds.js.map → PkChatbotStepPayload-cuYclK_2.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CALZDpfQ.js → PkChatbotStepToolDetail-Yd8cUQJP.js} +3 -3
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CALZDpfQ.js.map → PkChatbotStepToolDetail-Yd8cUQJP.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotSteps-CY7pN2Gl.js → PkChatbotSteps-_Aqft0em.js} +5 -5
  63. package/dist-vue/_chunks/{PkChatbotSteps-CY7pN2Gl.js.map → PkChatbotSteps-_Aqft0em.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotViewChat-Drp0At_n.js → PkChatbotViewChat-CHvtUHuO.js} +180 -178
  65. package/dist-vue/_chunks/PkChatbotViewChat-CHvtUHuO.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotViewConversations-C0KqM_Wq.js → PkChatbotViewConversations-7JU_5-F2.js} +3 -3
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-C0KqM_Wq.js.map → PkChatbotViewConversations-7JU_5-F2.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotViewFiles-B9mYRoNK.js → PkChatbotViewFiles-D53wtRPS.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-B9mYRoNK.js.map → PkChatbotViewFiles-D53wtRPS.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotViewProfile-BfNE3d7F.js → PkChatbotViewProfile-BRlLIofM.js} +2 -2
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-BfNE3d7F.js.map → PkChatbotViewProfile-BRlLIofM.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkFilePreview-z7JcRtjP.js → PkFilePreview-DLo9nI2g.js} +426 -426
  73. package/dist-vue/_chunks/PkFilePreview-DLo9nI2g.js.map +1 -0
  74. package/dist-vue/_chunks/{PkFilePreviewDialog-zVon3aPY.js → PkFilePreviewDialog-CgDJQgIJ.js} +2 -2
  75. package/dist-vue/_chunks/{PkFilePreviewDialog-zVon3aPY.js.map → PkFilePreviewDialog-CgDJQgIJ.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkStreamingMarkdown-bJEDk-kM.js → PkStreamingMarkdown-2FN4WMQD.js} +4 -4
  77. package/dist-vue/_chunks/{PkStreamingMarkdown-bJEDk-kM.js.map → PkStreamingMarkdown-2FN4WMQD.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkSvgViewer-DmkElalq.js → PkSvgViewer-BsdSOBpH.js} +2 -2
  79. package/dist-vue/_chunks/{PkSvgViewer-DmkElalq.js.map → PkSvgViewer-BsdSOBpH.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkToolChatFile-DqLGwJxp.js → PkToolChatFile-DAT1tv52.js} +4 -4
  81. package/dist-vue/_chunks/{PkToolChatFile-DqLGwJxp.js.map → PkToolChatFile-DAT1tv52.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkToolRequestGeolocation-BnV7A6SW.js → PkToolRequestGeolocation-p7Ip17F7.js} +2 -2
  83. package/dist-vue/_chunks/{PkToolRequestGeolocation-BnV7A6SW.js.map → PkToolRequestGeolocation-p7Ip17F7.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-QCbQ7bnl.js → PkToolRequestOAuthConnection-CtXSzKzM.js} +2 -2
  85. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-QCbQ7bnl.js.map → PkToolRequestOAuthConnection-CtXSzKzM.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolShareDocument-BIZkgcJ3.js → PkToolShareDocument-Qb2Lu5vh.js} +2 -2
  87. package/dist-vue/_chunks/{PkToolShareDocument-BIZkgcJ3.js.map → PkToolShareDocument-Qb2Lu5vh.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolShowArtifact-DanzULWt.js → PkToolShowArtifact-Bskomw05.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolShowArtifact-DanzULWt.js.map → PkToolShowArtifact-Bskomw05.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowContactForm-DzttQBG6.js → PkToolShowContactForm-iQrlqv7j.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolShowContactForm-DzttQBG6.js.map → PkToolShowContactForm-iQrlqv7j.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowDiagram-BNa89wcw.js → PkToolShowDiagram-C-43uUoh.js} +3 -3
  93. package/dist-vue/_chunks/{PkToolShowDiagram-BNa89wcw.js.map → PkToolShowDiagram-C-43uUoh.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowForm-BXol1WE3.js → PkToolShowForm-CKXpqQxy.js} +4 -4
  95. package/dist-vue/_chunks/{PkToolShowForm-BXol1WE3.js.map → PkToolShowForm-CKXpqQxy.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowImageGallery-Dmr5zXTj.js → PkToolShowImageGallery-DLTn6JmU.js} +3 -3
  97. package/dist-vue/_chunks/{PkToolShowImageGallery-Dmr5zXTj.js.map → PkToolShowImageGallery-DLTn6JmU.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowLocation-DCPaDtBI.js → PkToolShowLocation-B8FE_Sqd.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowLocation-DCPaDtBI.js.map → PkToolShowLocation-B8FE_Sqd.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowProductList-C_uIUG_G.js → PkToolShowProductList-hhSBAQVC.js} +2 -2
  101. package/dist-vue/_chunks/{PkToolShowProductList-C_uIUG_G.js.map → PkToolShowProductList-hhSBAQVC.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowSources-BHRNGn4s.js → PkToolShowSources-BiP9fVV2.js} +3 -3
  103. package/dist-vue/_chunks/{PkToolShowSources-BHRNGn4s.js.map → PkToolShowSources-BiP9fVV2.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DHCqxA1P.js → PkToolShowSuggestedReply-BRIzGNwx.js} +2 -2
  105. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DHCqxA1P.js.map → PkToolShowSuggestedReply-BRIzGNwx.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowVideo-P4H5A7ke.js → PkToolShowVideo-DJhsbDuX.js} +2 -2
  107. package/dist-vue/_chunks/{PkToolShowVideo-P4H5A7ke.js.map → PkToolShowVideo-DJhsbDuX.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkToolShowWebPages-BzNZHR7Q.js → PkToolShowWebPages-BAv66f5H.js} +2 -2
  109. package/dist-vue/_chunks/{PkToolShowWebPages-BzNZHR7Q.js.map → PkToolShowWebPages-BAv66f5H.js.map} +1 -1
  110. package/dist-vue/_chunks/{createChatbotApiClient-CQjxHqLr.js → createChatbotApiClient-DO4_I5hT.js} +21 -14
  111. package/dist-vue/_chunks/createChatbotApiClient-DO4_I5hT.js.map +1 -0
  112. package/dist-vue/_chunks/{useChatbotStore-CyZha9pf.js → useChatbotStore-Bj00X4yT.js} +1255 -1242
  113. package/dist-vue/_chunks/useChatbotStore-Bj00X4yT.js.map +1 -0
  114. package/dist-vue/_chunks/{useLightbox-gSzoBgNv.js → useLightbox-FDyQrPWe.js} +72 -13
  115. package/dist-vue/_chunks/useLightbox-FDyQrPWe.js.map +1 -0
  116. package/dist-vue/_chunks/{utils-8lO2Gj-m.js → utils-RwaXl9-x.js} +4 -4
  117. package/dist-vue/_chunks/{utils-8lO2Gj-m.js.map → utils-RwaXl9-x.js.map} +1 -1
  118. package/dist-vue/api.js +1 -1
  119. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
  120. package/dist-vue/apps/web-component/src/composables/usePagePointer.d.ts +14 -9
  121. package/dist-vue/apps/web-component/src/composables/usePendingMessage.d.ts +29 -15
  122. package/dist-vue/apps/web-component/src/composables/useSelectionActions.d.ts +77 -0
  123. package/dist-vue/composables.js +40 -8
  124. package/dist-vue/composables.js.map +1 -1
  125. package/dist-vue/index.js +5401 -5321
  126. package/dist-vue/index.js.map +1 -1
  127. package/dist-vue/locales.js +28 -2
  128. package/dist-vue/packages/components/src/chat/PkAgentSelectionActionsSettings.d.ts +25 -0
  129. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +23 -3
  130. package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +2 -1
  131. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +2 -0
  132. package/dist-vue/packages/components/src/chat/PkSelectionActions.d.ts +2 -12
  133. package/dist-vue/packages/components/src/chat/PkSelectionAnswerCard.d.ts +41 -0
  134. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +6 -0
  135. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +4 -1
  136. package/package.json +1 -1
  137. package/dist/_chunks/PkFilePreview-8nVPKv8k.js.map +0 -1
  138. package/dist/_chunks/useLightbox-BEEzZ0qT.js.map +0 -1
  139. package/dist-vue/_chunks/PkChatbot-Bpo22_yE.js.map +0 -1
  140. package/dist-vue/_chunks/PkChatbotInput-BVu1b2Te.js.map +0 -1
  141. package/dist-vue/_chunks/PkChatbotViewChat-Drp0At_n.js.map +0 -1
  142. package/dist-vue/_chunks/PkFilePreview-z7JcRtjP.js.map +0 -1
  143. package/dist-vue/_chunks/createChatbotApiClient-CQjxHqLr.js.map +0 -1
  144. package/dist-vue/_chunks/useChatbotStore-CyZha9pf.js.map +0 -1
  145. package/dist-vue/_chunks/useLightbox-gSzoBgNv.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLightbox-gSzoBgNv.js","names":["loaded","loadCdnCss","target","root","set","href","link","getShadowRoot","el","PHOTOSWIPE_CSS","DEFAULT_IMAGE_SIZE","MAX_ZOOM_LAYER_WIDTH","ZOOM_KEYS","SHARED_LIGHTBOX","SHARED_ITEMS","useLightbox","options","lightbox","shallowRef","sharedLightbox","shared","useSharedLightbox","$t","useI18n","unmounted","onBeforeUnmount","gallery","injectPhotoSwipeOverrides","PhotoSwipeLightbox","zoomLevel","linkEl","itemData","element","src","caption","pswp","openInNewTab","downloadable","ui","url","getCurrentSlideUrl","downloadImage","event","factor","key","slide","ctrlKey","metaKey","altKey","inject","provideSharedLightbox","container","joined","started","start","init","provide","onMounted","useImageSizes","sizes","ref","image","images","img","downloadUrl","toDownloadUrl","anchor","getFilenameFromUrl","name","overridesInjected","style"],"sources":["../../../../packages/utils/src/cdn-css.ts","../../../../packages/components/src/composables/useLightbox.ts"],"sourcesContent":["const loaded = new WeakMap<Node, Set<string>>()\n\n/**\n * Injects a CDN stylesheet `<link>` once per URL per root.\n * When a `ShadowRoot` is passed, the link is appended there so that\n * custom-element (Shadow DOM) encapsulation is respected.\n * Falls back to `document.head` for regular DOM usage.\n */\nexport function loadCdnCss(href: string, root?: ShadowRoot) {\n const target: Node = root ?? document.head\n let set = loaded.get(target)\n if (!set) {\n set = new Set()\n loaded.set(target, set)\n }\n if (set.has(href)) {\n return\n }\n const link = document.createElement('link')\n link.rel = 'stylesheet'\n link.href = href\n target.appendChild(link)\n set.add(href)\n}\n\n/** Returns the `ShadowRoot` ancestor of `el`, or `undefined` in regular DOM. */\nexport function getShadowRoot(el?: Element | null): ShadowRoot | undefined {\n const root = el?.getRootNode?.()\n return root instanceof ShadowRoot ? root : undefined\n}\n","import {\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n type InjectionKey,\n type Ref,\n type ShallowRef,\n} from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport type PhotoSwipeLightbox from 'photoswipe/lightbox'\nimport type PhotoSwipe from 'photoswipe'\nimport { loadCdnCss } from 'utils'\n\nconst PHOTOSWIPE_CSS =\n 'https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe.css'\n\nconst DEFAULT_IMAGE_SIZE = { width: 1200, height: 800 }\n\n// The widest layer a zoom may draw, PhotoSwipe's own cap for its default\n// secondary zoom level: past it a very large image stops short of 100%.\nconst MAX_ZOOM_LAYER_WIDTH = 4000\n\n// The zoom factor of one press of `+` or `-`, with or without Shift.\nconst ZOOM_KEYS: Record<string, number | undefined> = {\n '+': 1.25,\n '=': 1.25,\n '-': 0.8,\n _: 0.8,\n}\n\n/** The shared lightbox of a container, as the components inside see it. */\nexport interface SharedLightbox {\n /** An item joined: the first one starts the lightbox. */\n join: () => void\n}\n\n/** Lets the components inside a container join its shared lightbox. */\nconst SHARED_LIGHTBOX: InjectionKey<SharedLightbox> = Symbol('sharedLightbox')\n\n/**\n * The items of a shared lightbox: the anchors of the components that joined\n * it, and the images of a markdown that joined it, except an image inside a\n * link, which opens the link.\n */\nconst SHARED_ITEMS =\n 'a[data-pswp-src][data-pswp-shared], [data-pswp-images] img:not(a img)'\n\nexport interface LightboxImage {\n url: string\n caption?: string\n alt?: string\n /** Natural width in px, used by PhotoSwipe for proper sizing. */\n width?: number\n /** Natural height in px, used by PhotoSwipe for proper sizing. */\n height?: number\n}\n\nexport interface LightboxOptions {\n /** Container element whose child anchors are the gallery items */\n gallery: Readonly<Ref<HTMLElement | null | undefined>>\n /** CSS selector for gallery items inside the container (default: `'a[data-pswp-src]'`) */\n children?: string\n loop?: boolean\n /** Show a download button in the lightbox toolbar */\n downloadable?: boolean\n /** Show an open-in-new-tab button in the lightbox toolbar */\n openInNewTab?: boolean\n /**\n * Hands the items to the shared lightbox of a container above\n * (`provideSharedLightbox`), when there is one.\n */\n shared?: boolean\n}\n\nexport interface UseLightboxReturn {\n lightbox: ShallowRef<PhotoSwipeLightbox | null>\n /** Initialises PhotoSwipe. Call this inside `onMounted`. */\n init: () => Promise<void>\n /**\n * The items went to a shared lightbox: their anchors carry\n * `data-pswp-shared`, and `init` starts that lightbox instead.\n */\n shared: boolean\n}\n\n/**\n * Encapsulates PhotoSwipe 5 initialisation, toolbar customisation, and lifecycle cleanup.\n * CSS is injected into `document.head` so the overlay works in both regular DOM and Shadow DOM.\n *\n * Usage:\n * ```ts\n * const { init } = useLightbox({ gallery: galleryRef, downloadable: true })\n * onMounted(init)\n * ```\n */\nexport function useLightbox(options: LightboxOptions): UseLightboxReturn {\n const {\n gallery,\n children = 'a[data-pswp-src]',\n loop = true,\n downloadable = true,\n openInNewTab = true,\n shared = false,\n } = options\n\n const lightbox = shallowRef<PhotoSwipeLightbox | null>(null)\n const sharedLightbox = shared ? useSharedLightbox() : undefined\n const { t: $t } = useI18n({ useScope: 'global' })\n let unmounted = false\n\n const init = async () => {\n if (sharedLightbox) {\n sharedLightbox.join()\n return\n }\n if (!gallery.value) {\n return\n }\n\n // PhotoSwipe renders its overlay into document.body, so CSS must be in\n // document.head, not inside a shadow root.\n loadCdnCss(PHOTOSWIPE_CSS)\n injectPhotoSwipeOverrides()\n\n const { default: PhotoSwipeLightbox } =\n await import('photoswipe/lightbox')\n // Unmounted while PhotoSwipe loaded: nothing left to destroy it\n if (unmounted) {\n return\n }\n\n lightbox.value = new PhotoSwipeLightbox({\n gallery: gallery.value,\n children,\n pswpModule: () => import('photoswipe'),\n loop,\n // The wheel zooms around the pointer, as an image viewer does;\n // a drag pans\n wheelToZoom: true,\n // A click, a double tap, the zoom button and Z go from fit to the\n // real pixels, where PhotoSwipe stops at three times fit\n secondaryZoomLevel: (zoomLevel) =>\n Math.min(\n 1,\n MAX_ZOOM_LAYER_WIDTH /\n (zoomLevel.elementSize?.x || MAX_ZOOM_LAYER_WIDTH),\n ),\n closeTitle: $t('action.close'),\n zoomTitle: $t('lightbox.zoom'),\n arrowPrevTitle: $t('action.previous'),\n arrowNextTitle: $t('action.next'),\n errorMsg: $t('label.imageLoadError'),\n arrowPrevSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10.828 12l4.95 4.95l-1.414 1.415L8 12l6.364-6.364l1.414 1.414z\"/></svg>',\n arrowNextSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"/></svg>',\n closeSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z\"/></svg>',\n zoomSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g class=\"pswp__icn--zoom-in\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM10 10V7h2v3h3v2h-3v3h-2v-3H7v-2z\"/></g><g class=\"pswp__icn--zoom-out\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM7 10h8v2H7z\"/></g></svg>',\n })\n\n // A markdown image is the `<img>` itself, already loaded: its source\n // and natural size stand in for the data attributes of an anchor\n lightbox.value.addFilter('domItemData', (itemData, element, linkEl) => {\n if (linkEl) {\n return { ...itemData, caption: linkEl.dataset.pswpCaption }\n }\n if (!(element instanceof HTMLImageElement)) {\n return itemData\n }\n const src = element.currentSrc || element.src\n return {\n ...itemData,\n src,\n msrc: src,\n width: element.naturalWidth || DEFAULT_IMAGE_SIZE.width,\n height: element.naturalHeight || DEFAULT_IMAGE_SIZE.height,\n alt: element.alt,\n caption: element.alt,\n }\n })\n\n // The caption under the image, as text: the agent or a page it read\n // may have written it\n lightbox.value.on('uiRegister', () => {\n lightbox.value?.pswp?.ui?.registerElement({\n name: 'caption',\n className: 'pswp__caption pswp__hide-on-close',\n appendTo: 'root',\n onInit: (element, pswp) => {\n pswp.on('change', () => {\n const caption = pswp.currSlide?.data.caption ?? ''\n element.textContent = caption\n element.hidden = !caption\n })\n },\n })\n })\n\n if (openInNewTab || downloadable) {\n lightbox.value.on('uiRegister', () => {\n const ui = lightbox.value!.pswp?.ui\n if (!ui) {\n return\n }\n\n if (openInNewTab) {\n ui.registerElement({\n name: 'open-in-new-tab-button',\n order: 8,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z\"/></svg>',\n title: $t('lightbox.openInNewTab'),\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n window.open(\n url,\n '_blank',\n 'noopener,noreferrer',\n )\n }\n },\n })\n }\n\n if (downloadable) {\n ui.registerElement({\n name: 'download-button',\n order: 9,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z\"/></svg>',\n title: $t('action.download'),\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n downloadImage(url)\n }\n },\n })\n }\n })\n }\n\n // `+` and `-` zoom by a step around the center of the screen\n lightbox.value.on('keydown', (event) => {\n const { key, ctrlKey, metaKey, altKey } = event.originalEvent\n const factor = ZOOM_KEYS[key]\n const pswp = lightbox.value?.pswp\n const slide = pswp?.currSlide\n if (\n !factor ||\n ctrlKey ||\n metaKey ||\n altKey ||\n !slide?.isZoomable()\n ) {\n return\n }\n // The first stops PhotoSwipe's own handling, the second the browser's\n event.preventDefault()\n event.originalEvent.preventDefault()\n slide.zoomTo(\n slide.currZoomLevel * factor,\n undefined,\n pswp?.options.zoomAnimationDuration,\n )\n })\n\n lightbox.value.init()\n }\n\n onBeforeUnmount(() => {\n unmounted = true\n lightbox.value?.destroy()\n lightbox.value = null\n })\n\n return { lightbox, init, shared: Boolean(sharedLightbox) }\n}\n\n/**\n * The shared lightbox above that takes this component's images, if any: a\n * markdown marks its container with `data-pswp-images` and joins when it\n * shows an image.\n */\nexport function useSharedLightbox(): SharedLightbox | undefined {\n return inject(SHARED_LIGHTBOX, undefined)\n}\n\n/**\n * One lightbox over the images of a container, a conversation: the arrows go\n * through all of them in page order instead of stopping at the card that was\n * clicked. The components inside that pass `shared` to `useLightbox` skip a\n * lightbox of their own and mark their anchors with `data-pswp-shared`; the\n * others, such as a diagram's, keep theirs. It starts when the first image\n * joins, so a conversation without images loads no PhotoSwipe.\n */\nexport function provideSharedLightbox(\n container: Readonly<Ref<HTMLElement | null | undefined>>,\n): void {\n const { init } = useLightbox({\n gallery: container,\n children: SHARED_ITEMS,\n loop: false,\n })\n let joined = false\n let started = false\n const start = async () => {\n if (!joined || started || !container.value) {\n return\n }\n started = true\n try {\n await init()\n } catch {\n // PhotoSwipe did not load: the next image that joins tries again\n started = false\n }\n }\n provide(SHARED_LIGHTBOX, {\n join: () => {\n joined = true\n void start()\n },\n })\n // An image may join before the container is in place\n onMounted(start)\n}\n\n// ---------------------------------------------------------------------------\n// Image size preloading\n// ---------------------------------------------------------------------------\n\nexport interface UseImageSizesReturn {\n preload: (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => void\n getSize: (url: string) => { width: number; height: number }\n}\n\n/**\n * Preloads natural image dimensions so PhotoSwipe can size its slides correctly.\n * When `width`/`height` are already provided they are used as-is;\n * otherwise the image is loaded in the background to read `naturalWidth`/`naturalHeight`.\n */\nexport function useImageSizes(): UseImageSizesReturn {\n const sizes = ref(new Map<string, { width: number; height: number }>())\n\n const preload = (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => {\n for (const image of images) {\n if (image.width && image.height) {\n sizes.value.set(image.url, {\n width: image.width,\n height: image.height,\n })\n continue\n }\n const img = new Image()\n img.onload = () => {\n sizes.value.set(image.url, {\n width: img.naturalWidth,\n height: img.naturalHeight,\n })\n }\n img.src = image.url\n }\n }\n\n const getSize = (url: string) => sizes.value.get(url) ?? DEFAULT_IMAGE_SIZE\n\n return { preload, getSize }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction getCurrentSlideUrl(pswp: PhotoSwipe): string | undefined {\n return (\n pswp.currSlide?.data?.src ??\n pswp.currSlide?.data?.element\n ?.querySelector('img')\n ?.getAttribute('src') ??\n pswp.currSlide?.data?.element\n ?.querySelector('source')\n ?.getAttribute('srcset') ??\n pswp.currSlide?.data?.element?.getAttribute('src') ??\n undefined\n )\n}\n\n/**\n * Triggers a client-side download for an image URL.\n *\n * For backend media URLs (.../media/:file/view), navigates to the\n * corresponding /download endpoint which redirects to an Azure SAS URL\n * with `Content-Disposition: attachment`, so no CORS issues.\n *\n * For blob: URLs (in-session uploads), uses the fetch → blob approach.\n *\n * For data: URLs (inline SVGs, etc.), use the download attribute.\n *\n * Falls back to opening in a new tab for all other cases.\n */\nfunction downloadImage(url: string): void {\n const downloadUrl = toDownloadUrl(url)\n\n const anchor = document.createElement('a')\n anchor.href = downloadUrl\n anchor.target = '_blank'\n anchor.rel = 'noopener noreferrer'\n // `download` attribute works for same-origin, data: and blob: URLs; for\n // cross-origin it is ignored but the browser still follows Content-Disposition.\n anchor.download = getFilenameFromUrl(url)\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n}\n\n/**\n * Converts a `/view` media URL to its `/download` counterpart.\n * Leaves blob:, data: and all other URLs untouched.\n */\nfunction toDownloadUrl(url: string): string {\n return url.replace(/\\/view(\\?|$)/, '/download$1')\n}\n\nfunction getFilenameFromUrl(url: string): string {\n if (url.startsWith('data:image/svg+xml')) {\n return 'diagram.svg'\n }\n if (url.startsWith('data:')) {\n const mime = url.split(':')[1].split(';')[0]\n const ext = mime.split('/')[1] || 'bin'\n return `image.${ext}`\n }\n try {\n const pathname = new URL(url).pathname\n const name = pathname.split('/').pop()\n return name && name.includes('.') ? name : 'image'\n } catch {\n return 'image'\n }\n}\n\nlet overridesInjected = false\n\n/**\n * Injects a one-time `<style>` into `document.head` that raises\n * PhotoSwipe's z-index above any host UI (e.g. floating chat widgets\n * that use `z-index: 2147483647`), sizes its icons, lays a checkerboard\n * under transparent images and places the caption.\n */\nfunction injectPhotoSwipeOverrides(): void {\n if (overridesInjected) {\n return\n }\n overridesInjected = true\n const style = document.createElement('style')\n style.textContent = [\n '.pswp__counter { font-family: sans-serif; }',\n '.pswp { z-index: 2147483647 !important; }',\n '.pswp__icn { width: 20px; height: 20px; }',\n '.pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }',\n '.pswp__icn--zoom-out { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-in { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-out { display: block; }',\n '.pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; }',\n // A checkerboard under the transparent parts of an image, where a\n // dark logo would vanish into the dark backdrop\n '.pswp__img { background: repeating-conic-gradient(#e6e6e6 0% 25%, #ffffff 0% 50%) 50% / 16px 16px; }',\n '.pswp__caption { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(720px, calc(100% - 32px)); padding: 6px 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #ffffff; font: 14px/1.4 sans-serif; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }',\n '.pswp__caption[hidden] { display: none; }',\n ].join(' ')\n document.head.appendChild(style)\n}\n"],"mappings":";;;;AAAA,IAAMA,oBAAS,IAAI,QAA2B;AAQ9C,SAAgBC,EAAW,GAAc,GAAmB;CACxD,IAAMC,IAAeC,KAAQ,SAAS,MAClCC,IAAMJ,EAAO,IAAIE,CAAM;CAK3B,IAJKE,MACD,oBAAM,IAAI,IAAI,GACdJ,EAAO,IAAIE,GAAQE,CAAG,IAEtBA,EAAI,IAAIC,CAAI,GACZ;CAEJ,IAAMC,IAAO,SAAS,cAAc,MAAM;CAI1C,AAHA,EAAK,MAAM,cACX,EAAK,OAAOD,GACZH,EAAO,YAAYI,CAAI,GACvBF,EAAI,IAAIC,CAAI;AAChB;AAGA,SAAgBE,EAAc,GAA6C;CACvE,IAAMJ,IAAOK,GAAI,cAAc;CAC/B,OAAOL,aAAgB,aAAaA,IAAO,KAAA;AAC/C;;ACbA,IAAMM,IACF,iEAEEC,IAAqB;CAAE,OAAO;CAAM,QAAQ;AAAI,GAIhDC,IAAuB,KAGvBC,IAAgD;CAClD,KAAK;CACL,KAAK;CACL,KAAK;CACL,GAAG;AACP,GASMC,IAAgD,OAAO,gBAAgB,GAOvEC,IACF;AAkDJ,SAAgBC,EAAY,GAA6C;CACrE,IAAM,EACF,YACA,cAAW,oBACX,UAAO,IACP,kBAAe,IACf,kBAAe,IACf,YAAS,OACTC,GAEEC,IAAWC,EAAs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