@8wave/ai-elements 0.75.0 → 0.78.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.
Files changed (141) hide show
  1. package/dist/_chunks/{PkStreamingMarkdown-rIdQh5_D.js → PkStreamingMarkdown-gIAvEY1t.js} +372 -303
  2. package/dist/_chunks/PkStreamingMarkdown-gIAvEY1t.js.map +1 -0
  3. package/dist/_chunks/{PkToolShowArtifact-CeLgwZBA.js → PkToolShowArtifact-BwW4Yn6k.js} +5 -5
  4. package/dist/_chunks/{PkToolShowArtifact-CeLgwZBA.js.map → PkToolShowArtifact-BwW4Yn6k.js.map} +1 -1
  5. package/dist/_chunks/{PkToolShowCalendarEvent-cQpAAE3a.js → PkToolShowCalendarEvent-BEqn5iEb.js} +6 -6
  6. package/dist/_chunks/{PkToolShowCalendarEvent-cQpAAE3a.js.map → PkToolShowCalendarEvent-BEqn5iEb.js.map} +1 -1
  7. package/dist/_chunks/{PkToolShowComparison-Cu-zT8-Z.js → PkToolShowComparison-p34r0Hhd.js} +4 -4
  8. package/dist/_chunks/{PkToolShowComparison-Cu-zT8-Z.js.map → PkToolShowComparison-p34r0Hhd.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShowContactForm-CqoSVvjG.js → PkToolShowContactForm-DTE-iF_c.js} +18 -18
  10. package/dist/_chunks/{PkToolShowContactForm-CqoSVvjG.js.map → PkToolShowContactForm-DTE-iF_c.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowEmail-oLGym0R9.js → PkToolShowEmail-Be8FvWjw.js} +4 -4
  12. package/dist/_chunks/{PkToolShowEmail-oLGym0R9.js.map → PkToolShowEmail-Be8FvWjw.js.map} +1 -1
  13. package/dist/_chunks/PkToolShowImageGallery-CGL-HL6v.js +60 -0
  14. package/dist/_chunks/PkToolShowImageGallery-CGL-HL6v.js.map +1 -0
  15. package/dist/_chunks/{PkToolShowLocation-BtRUdoEw.js → PkToolShowLocation-DOoLCHzS.js} +6 -6
  16. package/dist/_chunks/{PkToolShowLocation-BtRUdoEw.js.map → PkToolShowLocation-DOoLCHzS.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowMessage-tJQGRhce.js → PkToolShowMessage-DgeULbdQ.js} +4 -4
  18. package/dist/_chunks/{PkToolShowMessage-tJQGRhce.js.map → PkToolShowMessage-DgeULbdQ.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowMultipleChoice-CtVvdyDg.js → PkToolShowMultipleChoice-CpGyn_bZ.js} +3 -3
  20. package/dist/_chunks/{PkToolShowMultipleChoice-CtVvdyDg.js.map → PkToolShowMultipleChoice-CpGyn_bZ.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowProductList-D_k6CDdb.js → PkToolShowProductList-C8YIh0Dw.js} +4 -4
  22. package/dist/_chunks/{PkToolShowProductList-D_k6CDdb.js.map → PkToolShowProductList-C8YIh0Dw.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowQrCode-S1j_T8wQ.js → PkToolShowQrCode-UE4uSyvJ.js} +4 -4
  24. package/dist/_chunks/{PkToolShowQrCode-S1j_T8wQ.js.map → PkToolShowQrCode-UE4uSyvJ.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowSources-CroItMtG.js → PkToolShowSources-TSjtd1ps.js} +7 -7
  26. package/dist/_chunks/PkToolShowSources-TSjtd1ps.js.map +1 -0
  27. package/dist/_chunks/{PkToolShowSuggestedReply-BRa5Lpti.js → PkToolShowSuggestedReply-c9sLv4n4.js} +4 -4
  28. package/dist/_chunks/{PkToolShowSuggestedReply-BRa5Lpti.js.map → PkToolShowSuggestedReply-c9sLv4n4.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowWeather-CUpCJ8Nj.js → PkToolShowWeather-ChJ5lB4K.js} +51 -51
  30. package/dist/_chunks/PkToolShowWeather-ChJ5lB4K.js.map +1 -0
  31. package/dist/_chunks/{PkToolShowWebPages-f-dHyxfD.js → PkToolShowWebPages-CL2mYxh-.js} +5 -5
  32. package/dist/_chunks/{PkToolShowWebPages-f-dHyxfD.js.map → PkToolShowWebPages-CL2mYxh-.js.map} +1 -1
  33. package/dist/_chunks/{PkUrl-CI17WkYu.js → PkUrl-CvztUywv.js} +3 -3
  34. package/dist/_chunks/{PkUrl-CI17WkYu.js.map → PkUrl-CvztUywv.js.map} +1 -1
  35. package/dist/_chunks/{VvCheckbox.es-BF8Mdg0O.js → VvCheckbox.es-ohF87NOe.js} +3 -3
  36. package/dist/_chunks/{VvCheckbox.es-BF8Mdg0O.js.map → VvCheckbox.es-ohF87NOe.js.map} +1 -1
  37. package/dist/_chunks/{VvCheckboxGroup.es-BJc8MmJ3.js → VvCheckboxGroup.es-DZCbyLN0.js} +4 -4
  38. package/dist/_chunks/{VvCheckboxGroup.es-BJc8MmJ3.js.map → VvCheckboxGroup.es-DZCbyLN0.js.map} +1 -1
  39. package/dist/_chunks/{VvCombobox.es-ILRHqAye.js → VvCombobox.es-YLPD7MpO.js} +6 -6
  40. package/dist/_chunks/{VvCombobox.es-ILRHqAye.js.map → VvCombobox.es-YLPD7MpO.js.map} +1 -1
  41. package/dist/_chunks/{VvInputText.es-CDnMeO26.js → VvInputText.es-DAnAXfBO.js} +7 -7
  42. package/dist/_chunks/{VvInputText.es-CDnMeO26.js.map → VvInputText.es-DAnAXfBO.js.map} +1 -1
  43. package/dist/_chunks/{VvRadio.es-C2p5vvAx.js → VvRadio.es-Do9oyNtV.js} +3 -3
  44. package/dist/_chunks/{VvRadio.es-C2p5vvAx.js.map → VvRadio.es-Do9oyNtV.js.map} +1 -1
  45. package/dist/_chunks/{VvRadioGroup.es-6GlWuDjY.js → VvRadioGroup.es-BHcqcJFC.js} +4 -4
  46. package/dist/_chunks/{VvRadioGroup.es-6GlWuDjY.js.map → VvRadioGroup.es-BHcqcJFC.js.map} +1 -1
  47. package/dist/_chunks/{VvSelect.es-i4lO9onq.js → VvSelect.es-CP_y02fy.js} +5 -5
  48. package/dist/_chunks/{VvSelect.es-i4lO9onq.js.map → VvSelect.es-CP_y02fy.js.map} +1 -1
  49. package/dist/_chunks/{VvTextarea.es-CGpiCS4S.js → VvTextarea.es-DetA_2DM.js} +6 -6
  50. package/dist/_chunks/{VvTextarea.es-CGpiCS4S.js.map → VvTextarea.es-DetA_2DM.js.map} +1 -1
  51. package/dist/_chunks/{dist-BTnzL-m0.js → dist-yqV26MWM.js} +4 -4
  52. package/dist/_chunks/{dist-BTnzL-m0.js.map → dist-yqV26MWM.js.map} +1 -1
  53. package/dist/_chunks/{esm-0nyRYwmP.js → esm-DLxNpT06.js} +7 -7
  54. package/dist/_chunks/{esm-0nyRYwmP.js.map → esm-DLxNpT06.js.map} +1 -1
  55. package/dist/_chunks/{floating-ui.vue-B5ZV-j8C.js → floating-ui.vue-tVPpNXUc.js} +3 -3
  56. package/dist/_chunks/{floating-ui.vue-B5ZV-j8C.js.map → floating-ui.vue-tVPpNXUc.js.map} +1 -1
  57. package/dist/_chunks/{iconify-C1EOwL90.js → iconify-y0w2FIJH.js} +3 -3
  58. package/dist/_chunks/{iconify-C1EOwL90.js.map → iconify-y0w2FIJH.js.map} +1 -1
  59. package/dist/_chunks/{index.es-CUjDCkXD.js → index.es-7fUi-rc0.js} +7 -7
  60. package/dist/_chunks/{index.es-CUjDCkXD.js.map → index.es-7fUi-rc0.js.map} +1 -1
  61. package/dist/_chunks/{src-C_wl-KYN.js → src-BfoQF6Z3.js} +2 -2
  62. package/dist/_chunks/{src-C_wl-KYN.js.map → src-BfoQF6Z3.js.map} +1 -1
  63. package/dist/_chunks/{useLightbox-CH1KeVqr.js → useLightbox-Ddvue042.js} +7 -5
  64. package/dist/_chunks/{useLightbox-CH1KeVqr.js.map → useLightbox-Ddvue042.js.map} +1 -1
  65. package/dist/_chunks/{vue-i18n-KvYvoek4.js → vue-i18n-DAH6nDTN.js} +3 -3
  66. package/dist/_chunks/{vue-i18n-KvYvoek4.js.map → vue-i18n-DAH6nDTN.js.map} +1 -1
  67. package/dist/_chunks/{vue.runtime.esm-bundler-BmggS4HU.js → vue.runtime.esm-bundler-Dq29dQrz.js} +16 -10
  68. package/dist/_chunks/vue.runtime.esm-bundler-Dq29dQrz.js.map +1 -0
  69. package/dist/ai-elements.es.js +3138 -3039
  70. package/dist/ai-elements.es.js.map +1 -1
  71. package/dist-vue/PkChatbot.js +1 -1
  72. package/dist-vue/PkChatbotFeedbackForm.js +1 -1
  73. package/dist-vue/PkChatbotFilePreview.js +1 -1
  74. package/dist-vue/PkChatbotInput.js +1 -1
  75. package/dist-vue/PkChatbotMessages.js +1 -1
  76. package/dist-vue/PkChatbotViewChat.js +1 -1
  77. package/dist-vue/PkChatbotViewConversations.js +1 -1
  78. package/dist-vue/PkChatbotViewProfile.js +1 -1
  79. package/dist-vue/_chunks/{Media-CXQSoKqt.js → Media-kK7BnZGr.js} +2 -2
  80. package/dist-vue/_chunks/Media-kK7BnZGr.js.map +1 -0
  81. package/dist-vue/_chunks/{PkChatbot-DAzGc7al.js → PkChatbot-BEJTYq-D.js} +7 -7
  82. package/dist-vue/_chunks/{PkChatbot-DAzGc7al.js.map → PkChatbot-BEJTYq-D.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkChatbotFeedbackForm-DvUzirPP.js → PkChatbotFeedbackForm-lj9CHdhn.js} +2 -2
  84. package/dist-vue/_chunks/{PkChatbotFeedbackForm-DvUzirPP.js.map → PkChatbotFeedbackForm-lj9CHdhn.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkChatbotFilePreview-DHzuGtz5.js → PkChatbotFilePreview-hRNtv2OJ.js} +2 -2
  86. package/dist-vue/_chunks/{PkChatbotFilePreview-DHzuGtz5.js.map → PkChatbotFilePreview-hRNtv2OJ.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkChatbotInput-C5QSmt21.js → PkChatbotInput-BbGLBVim.js} +124 -116
  88. package/dist-vue/_chunks/PkChatbotInput-BbGLBVim.js.map +1 -0
  89. package/dist-vue/_chunks/PkChatbotMessages-j3ALQmGG.js +467 -0
  90. package/dist-vue/_chunks/PkChatbotMessages-j3ALQmGG.js.map +1 -0
  91. package/dist-vue/_chunks/{PkChatbotViewChat-CjoezIyz.js → PkChatbotViewChat-Z05fqNFE.js} +6 -6
  92. package/dist-vue/_chunks/{PkChatbotViewChat-CjoezIyz.js.map → PkChatbotViewChat-Z05fqNFE.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkChatbotViewConversations-DSQu6vY1.js → PkChatbotViewConversations-2xc0o-fO.js} +2 -2
  94. package/dist-vue/_chunks/{PkChatbotViewConversations-DSQu6vY1.js.map → PkChatbotViewConversations-2xc0o-fO.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkChatbotViewProfile-BJJiaG9H.js → PkChatbotViewProfile-CoT1JnMk.js} +2 -2
  96. package/dist-vue/_chunks/{PkChatbotViewProfile-BJJiaG9H.js.map → PkChatbotViewProfile-CoT1JnMk.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkStreamingMarkdown-BAhC3uGK.js → PkStreamingMarkdown-BBTAwHd_.js} +311 -252
  98. package/dist-vue/_chunks/PkStreamingMarkdown-BBTAwHd_.js.map +1 -0
  99. package/dist-vue/_chunks/{PkToolShowArtifact-RzrDPcEQ.js → PkToolShowArtifact-CbqpjzCA.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowArtifact-RzrDPcEQ.js.map → PkToolShowArtifact-CbqpjzCA.js.map} +1 -1
  101. package/dist-vue/_chunks/{PkToolShowContactForm-r_GgO-ZX.js → PkToolShowContactForm-BkgfSyw7.js} +3 -3
  102. package/dist-vue/_chunks/{PkToolShowContactForm-r_GgO-ZX.js.map → PkToolShowContactForm-BkgfSyw7.js.map} +1 -1
  103. package/dist-vue/_chunks/{PkToolShowImageGallery-B7Bt6ZGv.js → PkToolShowImageGallery-Ckyxa0mx.js} +18 -21
  104. package/dist-vue/_chunks/PkToolShowImageGallery-Ckyxa0mx.js.map +1 -0
  105. package/dist-vue/_chunks/{PkToolShowSources-DK2DCvU3.js → PkToolShowSources-7Xt3iK2Z.js} +3 -3
  106. package/dist-vue/_chunks/{PkToolShowSources-DK2DCvU3.js.map → PkToolShowSources-7Xt3iK2Z.js.map} +1 -1
  107. package/dist-vue/_chunks/{PkToolShowWeather-Coq6H0iv.js → PkToolShowWeather-B5Wp8WAt.js} +26 -26
  108. package/dist-vue/_chunks/PkToolShowWeather-B5Wp8WAt.js.map +1 -0
  109. package/dist-vue/_chunks/{createChatbotApiClient-f86KwRcq.js → createChatbotApiClient-CvDRMmDa.js} +2 -2
  110. package/dist-vue/_chunks/{createChatbotApiClient-f86KwRcq.js.map → createChatbotApiClient-CvDRMmDa.js.map} +1 -1
  111. package/dist-vue/_chunks/{index.es-_14zrNZB.js → index.es-Dk_HaA08.js} +2 -2
  112. package/dist-vue/_chunks/{index.es-_14zrNZB.js.map → index.es-Dk_HaA08.js.map} +1 -1
  113. package/dist-vue/_chunks/{useChatbotStore-CJlkoNn7.js → useChatbotStore-DMDbzuub.js} +5 -5
  114. package/dist-vue/_chunks/{useChatbotStore-CJlkoNn7.js.map → useChatbotStore-DMDbzuub.js.map} +1 -1
  115. package/dist-vue/_chunks/{useLightbox-1sB7fmFb.js → useLightbox-Cl8REkfc.js} +5 -3
  116. package/dist-vue/_chunks/{useLightbox-1sB7fmFb.js.map → useLightbox-Cl8REkfc.js.map} +1 -1
  117. package/dist-vue/api.js +1 -1
  118. package/dist-vue/composables.js +2 -2
  119. package/dist-vue/index.js +24 -24
  120. package/dist-vue/index.js.map +1 -1
  121. package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +4 -5
  122. package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +9 -1
  123. package/dist-vue/packages/components/src/chat/useChatScroll.d.ts +15 -0
  124. package/dist-vue/packages/models/src/schema/AgentEndpoint.d.ts +1 -1
  125. package/dist-vue/packages/models/src/schema/constants.d.ts +3 -1
  126. package/dist-vue/style.css +1 -1
  127. package/package.json +2 -2
  128. package/dist/_chunks/PkStreamingMarkdown-rIdQh5_D.js.map +0 -1
  129. package/dist/_chunks/PkToolShowImageGallery-CDXSL1Mg.js +0 -63
  130. package/dist/_chunks/PkToolShowImageGallery-CDXSL1Mg.js.map +0 -1
  131. package/dist/_chunks/PkToolShowSources-CroItMtG.js.map +0 -1
  132. package/dist/_chunks/PkToolShowWeather-CUpCJ8Nj.js.map +0 -1
  133. package/dist/_chunks/vue.runtime.esm-bundler-BmggS4HU.js.map +0 -1
  134. package/dist-vue/_chunks/Media-CXQSoKqt.js.map +0 -1
  135. package/dist-vue/_chunks/PkChatbotInput-C5QSmt21.js.map +0 -1
  136. package/dist-vue/_chunks/PkChatbotMessages-dsjB0-26.js +0 -388
  137. package/dist-vue/_chunks/PkChatbotMessages-dsjB0-26.js.map +0 -1
  138. package/dist-vue/_chunks/PkStreamingMarkdown-BAhC3uGK.js.map +0 -1
  139. package/dist-vue/_chunks/PkToolShowImageGallery-B7Bt6ZGv.js.map +0 -1
  140. package/dist-vue/_chunks/PkToolShowWeather-Coq6H0iv.js.map +0 -1
  141. /package/dist/_chunks/{_plugin-vue_export-helper-BI3pHb34.js → _plugin-vue_export-helper-C6kC663S.js} +0 -0
@@ -99,15 +99,17 @@ function p() {
99
99
  f = !0;
100
100
  let e = document.createElement("style");
101
101
  e.textContent = [
102
+ ".pswp__counter { font-family: sans-serif; }",
102
103
  ".pswp { z-index: 2147483647 !important; }",
103
104
  ".pswp__icn { width: 20px; height: 20px; }",
104
- ".pswp__button { width: 40px; height: 40px; }",
105
+ ".pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }",
105
106
  ".pswp__icn--zoom-out { display: none; }",
106
107
  ".pswp--zoomed-in .pswp__icn--zoom-in { display: none; }",
107
- ".pswp--zoomed-in .pswp__icn--zoom-out { display: block; }"
108
+ ".pswp--zoomed-in .pswp__icn--zoom-out { display: block; }",
109
+ ".pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; }"
108
110
  ].join(" "), document.head.appendChild(e);
109
111
  }
110
112
  //#endregion
111
113
  export { o as n, s as t };
112
114
 
113
- //# sourceMappingURL=useLightbox-1sB7fmFb.js.map
115
+ //# sourceMappingURL=useLightbox-Cl8REkfc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLightbox-1sB7fmFb.js","names":[],"sources":["../../../../packages/components/src/composables/useLightbox.ts"],"sourcesContent":["import {\n onBeforeUnmount,\n ref,\n shallowRef,\n type Ref,\n type ShallowRef,\n} from 'vue'\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\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: Ref<HTMLElement | 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\nexport interface UseLightboxReturn {\n lightbox: ShallowRef<PhotoSwipeLightbox | null>\n /** Initialises PhotoSwipe. Call this inside `onMounted`. */\n init: () => Promise<void>\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 } = options\n\n const lightbox = shallowRef<PhotoSwipeLightbox | null>(null)\n\n const init = async () => {\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\n lightbox.value = new PhotoSwipeLightbox({\n gallery: gallery.value,\n children,\n pswpModule: () => import('photoswipe'),\n loop,\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 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: 'Open in new tab',\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: 'Download',\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n downloadImage(url)\n }\n },\n })\n }\n })\n }\n\n lightbox.value.init()\n }\n\n onBeforeUnmount(() => {\n lightbox.value?.destroy()\n lightbox.value = null\n })\n\n return { lightbox, init }\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 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` — no CORS issues.\n *\n * For blob: URLs (in-session uploads), uses the fetch → blob approach.\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 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: 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 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`).\n */\nfunction injectPhotoSwipeOverrides(): void {\n if (overridesInjected) {\n return\n }\n overridesInjected = true\n const style = document.createElement('style')\n style.textContent = [\n '.pswp { z-index: 2147483647 !important; }',\n '.pswp__icn { width: 20px; height: 20px; }',\n '.pswp__button { width: 40px; height: 40px; }',\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 ].join(' ')\n document.head.appendChild(style)\n}\n"],"mappings":";;;AAWA,IAAM,IACF,iEAEE,IAAqB;CAAE,OAAO;CAAM,QAAQ;CAAK;AAwCvD,SAAgB,EAAY,GAA6C;CACrE,IAAM,EACF,YACA,cAAW,oBACX,UAAO,IACP,kBAAe,IACf,kBAAe,OACf,GAEE,IAAW,EAAsC,KAAK;AAmF5D,QALA,QAAsB;AAElB,EADA,EAAS,OAAO,SAAS,EACzB,EAAS,QAAQ;GACnB,EAEK;EAAE;EAAU,kBAjFM;AACrB,OAAI,CAAC,EAAQ,MACT;AAMJ,GADA,EAAW,EAAe,EAC1B,GAA2B;GAE3B,IAAM,EAAE,SAAS,MACb,MAAM,OAAO;AA8DjB,GA5DA,EAAS,QAAQ,IAAI,EAAmB;IACpC,SAAS,EAAQ;IACjB;IACA,kBAAkB,OAAO;IACzB;IACA,cACI;IACJ,cACI;IACJ,UACI;IACJ,SACI;IACP,CAAC,GAEE,KAAgB,MAChB,EAAS,MAAM,GAAG,oBAAoB;IAClC,IAAM,IAAK,EAAS,MAAO,MAAM;AAC5B,UAID,KACA,EAAG,gBAAgB;KACf,MAAM;KACN,OAAO;KACP,UAAU;KACV,MAAM;KACN,OAAO;KACP,UAAU,GAAG,GAAI,MAAS;MACtB,IAAM,IAAM,EAAmB,EAAK;AACpC,MAAI,KACA,OAAO,KACH,GACA,UACA,sBACH;;KAGZ,CAAC,EAGF,KACA,EAAG,gBAAgB;KACf,MAAM;KACN,OAAO;KACP,UAAU;KACV,MAAM;KACN,OAAO;KACP,UAAU,GAAG,GAAI,MAAS;MACtB,IAAM,IAAM,EAAmB,EAAK;AACpC,MAAI,KACA,EAAc,EAAI;;KAG7B,CAAC;KAER,EAGN,EAAS,MAAM,MAAM;;EAQA;;AAmB7B,SAAgB,IAAqC;CACjD,IAAM,IAAQ,kBAAI,IAAI,KAAgD,CAAC;AA0BvE,QAAO;EAAE,UAvBL,MACC;AACD,QAAK,IAAM,KAAS,GAAQ;AACxB,QAAI,EAAM,SAAS,EAAM,QAAQ;AAC7B,OAAM,MAAM,IAAI,EAAM,KAAK;MACvB,OAAO,EAAM;MACb,QAAQ,EAAM;MACjB,CAAC;AACF;;IAEJ,IAAM,IAAM,IAAI,OAAO;AAOvB,IANA,EAAI,eAAe;AACf,OAAM,MAAM,IAAI,EAAM,KAAK;MACvB,OAAO,EAAI;MACX,QAAQ,EAAI;MACf,CAAC;OAEN,EAAI,MAAM,EAAM;;;EAMN,UAFD,MAAgB,EAAM,MAAM,IAAI,EAAI,IAAI;EAE9B;;AAO/B,SAAS,EAAmB,GAAsC;AAC9D,QACI,EAAK,WAAW,MAAM,OACtB,EAAK,WAAW,MAAM,SAChB,cAAc,MAAM,EACpB,aAAa,MAAM,IACzB,KAAA;;AAeR,SAAS,EAAc,GAAmB;CACtC,IAAM,IAAc,EAAc,EAAI,EAEhC,IAAS,SAAS,cAAc,IAAI;AAS1C,CARA,EAAO,OAAO,GACd,EAAO,SAAS,UAChB,EAAO,MAAM,uBAGb,EAAO,WAAW,EAAmB,EAAI,EACzC,SAAS,KAAK,YAAY,EAAO,EACjC,EAAO,OAAO,EACd,SAAS,KAAK,YAAY,EAAO;;AAOrC,SAAS,EAAc,GAAqB;AACxC,QAAO,EAAI,QAAQ,gBAAgB,cAAc;;AAGrD,SAAS,EAAmB,GAAqB;AAC7C,KAAI;EAEA,IAAM,IADW,IAAI,IAAI,EAAI,CAAC,SACR,MAAM,IAAI,CAAC,KAAK;AACtC,SAAO,KAAQ,EAAK,SAAS,IAAI,GAAG,IAAO;SACvC;AACJ,SAAO;;;AAIf,IAAI,IAAoB;AAOxB,SAAS,IAAkC;AACvC,KAAI,EACA;AAEJ,KAAoB;CACpB,IAAM,IAAQ,SAAS,cAAc,QAAQ;AAS7C,CARA,EAAM,cAAc;EAChB;EACA;EACA;EACA;EACA;EACA;EACH,CAAC,KAAK,IAAI,EACX,SAAS,KAAK,YAAY,EAAM"}
1
+ {"version":3,"file":"useLightbox-Cl8REkfc.js","names":[],"sources":["../../../../packages/components/src/composables/useLightbox.ts"],"sourcesContent":["import {\n onBeforeUnmount,\n ref,\n shallowRef,\n type Ref,\n type ShallowRef,\n} from 'vue'\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\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: Ref<HTMLElement | 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\nexport interface UseLightboxReturn {\n lightbox: ShallowRef<PhotoSwipeLightbox | null>\n /** Initialises PhotoSwipe. Call this inside `onMounted`. */\n init: () => Promise<void>\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 } = options\n\n const lightbox = shallowRef<PhotoSwipeLightbox | null>(null)\n\n const init = async () => {\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\n lightbox.value = new PhotoSwipeLightbox({\n gallery: gallery.value,\n children,\n pswpModule: () => import('photoswipe'),\n loop,\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 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: 'Open in new tab',\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: 'Download',\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n downloadImage(url)\n }\n },\n })\n }\n })\n }\n\n lightbox.value.init()\n }\n\n onBeforeUnmount(() => {\n lightbox.value?.destroy()\n lightbox.value = null\n })\n\n return { lightbox, init }\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 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` — no CORS issues.\n *\n * For blob: URLs (in-session uploads), uses the fetch → blob approach.\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 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: 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 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`).\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 ].join(' ')\n document.head.appendChild(style)\n}\n"],"mappings":";;;AAWA,IAAM,IACF,iEAEE,IAAqB;CAAE,OAAO;CAAM,QAAQ;CAAK;AAwCvD,SAAgB,EAAY,GAA6C;CACrE,IAAM,EACF,YACA,cAAW,oBACX,UAAO,IACP,kBAAe,IACf,kBAAe,OACf,GAEE,IAAW,EAAsC,KAAK;AAmF5D,QALA,QAAsB;AAElB,EADA,EAAS,OAAO,SAAS,EACzB,EAAS,QAAQ;GACnB,EAEK;EAAE;EAAU,kBAjFM;AACrB,OAAI,CAAC,EAAQ,MACT;AAMJ,GADA,EAAW,EAAe,EAC1B,GAA2B;GAE3B,IAAM,EAAE,SAAS,MACb,MAAM,OAAO;AA8DjB,GA5DA,EAAS,QAAQ,IAAI,EAAmB;IACpC,SAAS,EAAQ;IACjB;IACA,kBAAkB,OAAO;IACzB;IACA,cACI;IACJ,cACI;IACJ,UACI;IACJ,SACI;IACP,CAAC,GAEE,KAAgB,MAChB,EAAS,MAAM,GAAG,oBAAoB;IAClC,IAAM,IAAK,EAAS,MAAO,MAAM;AAC5B,UAID,KACA,EAAG,gBAAgB;KACf,MAAM;KACN,OAAO;KACP,UAAU;KACV,MAAM;KACN,OAAO;KACP,UAAU,GAAG,GAAI,MAAS;MACtB,IAAM,IAAM,EAAmB,EAAK;AACpC,MAAI,KACA,OAAO,KACH,GACA,UACA,sBACH;;KAGZ,CAAC,EAGF,KACA,EAAG,gBAAgB;KACf,MAAM;KACN,OAAO;KACP,UAAU;KACV,MAAM;KACN,OAAO;KACP,UAAU,GAAG,GAAI,MAAS;MACtB,IAAM,IAAM,EAAmB,EAAK;AACpC,MAAI,KACA,EAAc,EAAI;;KAG7B,CAAC;KAER,EAGN,EAAS,MAAM,MAAM;;EAQA;;AAmB7B,SAAgB,IAAqC;CACjD,IAAM,IAAQ,kBAAI,IAAI,KAAgD,CAAC;AA0BvE,QAAO;EAAE,UAvBL,MACC;AACD,QAAK,IAAM,KAAS,GAAQ;AACxB,QAAI,EAAM,SAAS,EAAM,QAAQ;AAC7B,OAAM,MAAM,IAAI,EAAM,KAAK;MACvB,OAAO,EAAM;MACb,QAAQ,EAAM;MACjB,CAAC;AACF;;IAEJ,IAAM,IAAM,IAAI,OAAO;AAOvB,IANA,EAAI,eAAe;AACf,OAAM,MAAM,IAAI,EAAM,KAAK;MACvB,OAAO,EAAI;MACX,QAAQ,EAAI;MACf,CAAC;OAEN,EAAI,MAAM,EAAM;;;EAMN,UAFD,MAAgB,EAAM,MAAM,IAAI,EAAI,IAAI;EAE9B;;AAO/B,SAAS,EAAmB,GAAsC;AAC9D,QACI,EAAK,WAAW,MAAM,OACtB,EAAK,WAAW,MAAM,SAChB,cAAc,MAAM,EACpB,aAAa,MAAM,IACzB,KAAA;;AAeR,SAAS,EAAc,GAAmB;CACtC,IAAM,IAAc,EAAc,EAAI,EAEhC,IAAS,SAAS,cAAc,IAAI;AAS1C,CARA,EAAO,OAAO,GACd,EAAO,SAAS,UAChB,EAAO,MAAM,uBAGb,EAAO,WAAW,EAAmB,EAAI,EACzC,SAAS,KAAK,YAAY,EAAO,EACjC,EAAO,OAAO,EACd,SAAS,KAAK,YAAY,EAAO;;AAOrC,SAAS,EAAc,GAAqB;AACxC,QAAO,EAAI,QAAQ,gBAAgB,cAAc;;AAGrD,SAAS,EAAmB,GAAqB;AAC7C,KAAI;EAEA,IAAM,IADW,IAAI,IAAI,EAAI,CAAC,SACR,MAAM,IAAI,CAAC,KAAK;AACtC,SAAO,KAAQ,EAAK,SAAS,IAAI,GAAG,IAAO;SACvC;AACJ,SAAO;;;AAIf,IAAI,IAAoB;AAOxB,SAAS,IAAkC;AACvC,KAAI,EACA;AAEJ,KAAoB;CACpB,IAAM,IAAQ,SAAS,cAAc,QAAQ;AAW7C,CAVA,EAAM,cAAc;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACH,CAAC,KAAK,IAAI,EACX,SAAS,KAAK,YAAY,EAAM"}
package/dist-vue/api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as e } from "./_chunks/createChatbotApiClient-f86KwRcq.js";
1
+ import { t as e } from "./_chunks/createChatbotApiClient-CvDRMmDa.js";
2
2
  export { e as createChatbotApiClient };
@@ -1,6 +1,6 @@
1
- import { t as e } from "./_chunks/createChatbotApiClient-f86KwRcq.js";
1
+ import { t as e } from "./_chunks/createChatbotApiClient-CvDRMmDa.js";
2
2
  import { h as t } from "./_chunks/src-EtGd6cRz.js";
3
- import { t as n } from "./_chunks/useChatbotStore-CJlkoNn7.js";
3
+ import { t as n } from "./_chunks/useChatbotStore-DMDbzuub.js";
4
4
  import { o as r } from "./_chunks/utils-BegUBK7s.js";
5
5
  import { computed as i, getCurrentInstance as a, onBeforeUnmount as o, onMounted as s, ref as c, toValue as l, watch as u } from "vue";
6
6
  import { createAuthClient as d } from "better-auth/vue";
package/dist-vue/index.js CHANGED
@@ -1,33 +1,33 @@
1
1
  import { n as e } from "./_chunks/rolldown-runtime-D9KsE1-l.js";
2
- import { a as t, c as n, i as r, n as i, o as a, r as o, s } from "./_chunks/createChatbotApiClient-f86KwRcq.js";
2
+ import { a as t, c as n, i as r, n as i, o as a, r as o, s } from "./_chunks/createChatbotApiClient-CvDRMmDa.js";
3
3
  import { C as c, S as l, _ as u, a as d, b as f, c as p, d as m, g as h, i as g, m as _, n as v, o as y, p as b, r as x, s as ee, u as S, v as C, y as w } from "./_chunks/schemas-Clx4oKCB.js";
4
- import { o as T, r as te } from "./_chunks/Media-CXQSoKqt.js";
5
- import { a as ne, i as re, r as ie, t as ae } from "./_chunks/PkToolShowSources-DK2DCvU3.js";
4
+ import { o as T, r as te } from "./_chunks/Media-kK7BnZGr.js";
5
+ import { a as ne, i as re, r as ie, t as ae } from "./_chunks/PkToolShowSources-7Xt3iK2Z.js";
6
6
  import { t as oe } from "./_chunks/PkChatbotError-CvZxHGlI.js";
7
7
  import { a as se, f as ce, i as le, l as ue, o as de, p as fe } from "./_chunks/src-EtGd6cRz.js";
8
- import { a as E, i as pe, n as me, r as he } from "./_chunks/useChatbotStore-CJlkoNn7.js";
8
+ import { a as E, i as pe, n as me, r as he } from "./_chunks/useChatbotStore-DMDbzuub.js";
9
9
  import { t as ge } from "./_chunks/useSafeLocalStorage-BDPvGrtd.js";
10
- import { n as _e, t as ve } from "./_chunks/PkChatbotViewConversations-DSQu6vY1.js";
10
+ import { n as _e, t as ve } from "./_chunks/PkChatbotViewConversations-2xc0o-fO.js";
11
11
  import { n as ye, t as be } from "./_chunks/PkRelativeTime-WZ2aPcp_.js";
12
12
  import { $ as xe, A as Se, Ct as Ce, D as we, F as Te, G as Ee, H as De, J as Oe, K as ke, N as D, Q as Ae, S as je, St as Me, T as Ne, Tt as Pe, U as Fe, W as Ie, X as Le, _t as Re, a as ze, at as Be, bt as Ve, ct as He, dt as Ue, et as We, f as Ge, gt as Ke, it as qe, k as Je, l as O, lt as k, mt as Ye, nt as Xe, o as Ze, ot as Qe, pt as $e, q as et, rt as tt, st as nt, tt as rt, u as it, ut as at, vt as ot, w as st, wt as ct, x as lt, xt as ut, yt as dt } from "./_chunks/dist-CIN_Avbm.js";
13
13
  import { n as ft } from "./_chunks/dist-DFvVVU0-.js";
14
14
  import { n as pt } from "./_chunks/dist-CGNGkvWf.js";
15
15
  import { t as mt } from "./_chunks/PkUrl-CGbSBfuP.js";
16
- import { t as ht } from "./_chunks/PkStreamingMarkdown-BAhC3uGK.js";
17
- import { n as gt, t as _t } from "./_chunks/useLightbox-1sB7fmFb.js";
18
- import { r as vt, t as yt } from "./_chunks/PkToolShowArtifact-RzrDPcEQ.js";
19
- import { n as bt, t as xt } from "./_chunks/PkChatbotViewProfile-BJJiaG9H.js";
20
- import { t as St } from "./_chunks/PkChatbotFeedbackForm-DvUzirPP.js";
21
- import { t as Ct } from "./_chunks/PkChatbotFilePreview-DHzuGtz5.js";
22
- import { n as wt, t as Tt } from "./_chunks/PkChatbotMessages-dsjB0-26.js";
16
+ import { t as ht } from "./_chunks/PkStreamingMarkdown-BBTAwHd_.js";
17
+ import { n as gt, t as _t } from "./_chunks/useLightbox-Cl8REkfc.js";
18
+ import { r as vt, t as yt } from "./_chunks/PkToolShowArtifact-CbqpjzCA.js";
19
+ import { n as bt, t as xt } from "./_chunks/PkChatbotViewProfile-CoT1JnMk.js";
20
+ import { t as St } from "./_chunks/PkChatbotFeedbackForm-lj9CHdhn.js";
21
+ import { t as Ct } from "./_chunks/PkChatbotFilePreview-hRNtv2OJ.js";
22
+ import { n as wt, t as Tt } from "./_chunks/PkChatbotMessages-j3ALQmGG.js";
23
23
  import { i as Et, t as Dt } from "./_chunks/utils-BegUBK7s.js";
24
- import { t as Ot } from "./_chunks/PkChatbotInput-C5QSmt21.js";
24
+ import { t as Ot } from "./_chunks/PkChatbotInput-BbGLBVim.js";
25
25
  import { t as kt } from "./_chunks/PkToolShowMultipleChoice-DZXfWtQp.js";
26
- import { r as At, t as jt } from "./_chunks/PkToolShowContactForm-r_GgO-ZX.js";
26
+ import { r as At, t as jt } from "./_chunks/PkToolShowContactForm-BkgfSyw7.js";
27
27
  import { t as Mt } from "./_chunks/PkToolShowSuggestedReply-30m9yWDL.js";
28
- import { t as Nt } from "./_chunks/PkChatbotViewChat-CjoezIyz.js";
28
+ import { t as Nt } from "./_chunks/PkChatbotViewChat-Z05fqNFE.js";
29
29
  import { t as Pt } from "./_chunks/PkToolShowLocation-DteWf0Cs.js";
30
- import { t as Ft } from "./_chunks/PkChatbot-DAzGc7al.js";
30
+ import { t as Ft } from "./_chunks/PkChatbot-BEJTYq-D.js";
31
31
  import { t as It } from "./_chunks/PkToolShowEmail-B7YiliCE.js";
32
32
  import { t as Lt } from "./_chunks/PkToolShowMessage-ujP26Ae3.js";
33
33
  import { t as Rt } from "./_chunks/PkToolShowWebPages-DZIdrdWs.js";
@@ -35,7 +35,7 @@ import { t as zt } from "./_chunks/PkToolShowProductList-CtqWK0x4.js";
35
35
  import { t as Bt } from "./_chunks/PkToolShowCalendarEvent-DXRAzzKm.js";
36
36
  import { t as Vt } from "./_chunks/PkToolShowComparison-CqN_pqBW.js";
37
37
  import { t as Ht } from "./_chunks/PkToolShowQrCode-B4ex3m8i.js";
38
- import { t as Ut } from "./_chunks/PkToolShowImageGallery-B7Bt6ZGv.js";
38
+ import { t as Ut } from "./_chunks/PkToolShowImageGallery-Ckyxa0mx.js";
39
39
  import { Fragment as A, Teleport as Wt, Transition as Gt, TransitionGroup as Kt, cloneVNode as qt, computed as j, createApp as Jt, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createSlots as Yt, createStaticVNode as Xt, createTextVNode as Zt, createVNode as I, defineComponent as L, effectScope as Qt, guardReactiveProps as $t, h as en, inject as R, isRef as tn, isVNode as nn, mergeModels as rn, mergeProps as an, nextTick as on, normalizeClass as sn, normalizeProps as cn, normalizeStyle as ln, onBeforeUnmount as un, onMounted as z, onUnmounted as dn, openBlock as B, provide as fn, reactive as pn, readonly as mn, ref as V, renderList as hn, renderSlot as gn, resolveComponent as _n, resolveDynamicComponent as vn, shallowRef as yn, toDisplayString as H, toRef as bn, toRefs as xn, toValue as Sn, unref as U, useId as Cn, useModel as W, useSlots as wn, useTemplateRef as Tn, vModelSelect as En, vModelText as Dn, vShow as On, watch as G, withCtx as K, withDirectives as kn, withModifiers as An } from "vue";
40
40
  import { VvAccordion as jn, VvButton as Mn, VvButtonGroup as Nn, VvCheckbox as Pn, VvCombobox as Fn, VvDialog as In, VvIcon as Ln, VvInputFile as Rn, VvInputText as zn, VvRadio as Bn, VvRadioGroup as Vn, VvTab as Hn } from "@volverjs/ui-vue/components";
41
41
  import { EditorContent as Un, useEditor as Wn } from "@tiptap/vue-3";
@@ -223,7 +223,7 @@ fr("settings", () => {
223
223
  };
224
224
  });
225
225
  //#endregion
226
- //#region ../../node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.33_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
226
+ //#region ../../node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.34_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
227
227
  function Dr(e = {}) {
228
228
  function t(e) {
229
229
  return typeof e == "function";
@@ -1074,7 +1074,7 @@ var { getRawOptions: Br } = { getRawOptions: async (e) => Ir(e) ? await zr(e) :
1074
1074
  });
1075
1075
  Ei.install = (e) => (e.component(Ei.name, Ei), e);
1076
1076
  //#endregion
1077
- //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.33_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/chunks/event-bus.mjs
1077
+ //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.34_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/chunks/event-bus.mjs
1078
1078
  var Di = "onSave", Oi = "changeCatalogVisible", ki = "changeFullscreen", Ai = "pageFullscreenChanged", ji = "fullscreenChanged", Mi = "previewChanged", Ni = "previewOnlyChanged", Pi = "htmlPreviewChanged", Fi = "catalogVisibleChanged", Ii = "buildFinished", Li = "errorCatcher", J = "replace", Ri = "uploadImage", zi = "ctrlZ", Bi = "ctrlShiftZ", Vi = "catalogChanged", Hi = "pushCatalog", Ui = "rerender", Wi = "eventListener", Gi = "taskStateChanged", Ki = "sendEditorView", qi = "getEditorView", Y = new class {
1079
1079
  pools = {};
1080
1080
  remove(e, t, n) {
@@ -1490,7 +1490,7 @@ async function ia(e) {
1490
1490
  }
1491
1491
  }
1492
1492
  //#endregion
1493
- //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.33_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/chunks/dom.mjs
1493
+ //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.34_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/chunks/dom.mjs
1494
1494
  var aa = {
1495
1495
  copy: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy ${q}-icon"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`,
1496
1496
  "collapse-tips": `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle-chevron-left ${q}-icon"><circle cx="12" cy="12" r="10"/><path d="m14 16-4-4 4-4"/></svg>`,
@@ -4547,7 +4547,7 @@ function Hl(e, t) {
4547
4547
  }
4548
4548
  Hl(".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}");
4549
4549
  //#endregion
4550
- //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.33_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/chunks/index3.mjs
4550
+ //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.34_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/chunks/index3.mjs
4551
4551
  var Ul = {
4552
4552
  hljs: `${q}-hljs`,
4553
4553
  hlcss: `${q}-hlCss`,
@@ -6061,7 +6061,7 @@ var Ul = {
6061
6061
  });
6062
6062
  Gu.install = (e) => (e.component(Gu.name, Gu), e);
6063
6063
  //#endregion
6064
- //#region ../../node_modules/.pnpm/lucide-vue-next@0.543.0_vue@3.5.33_typescript@6.0.3_/node_modules/lucide-vue-next/dist/esm/shared/src/utils.js
6064
+ //#region ../../node_modules/.pnpm/lucide-vue-next@0.543.0_vue@3.5.34_typescript@6.0.3_/node_modules/lucide-vue-next/dist/esm/shared/src/utils.js
6065
6065
  var Ku = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), qu = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), Ju = (e) => {
6066
6066
  let t = qu(e);
6067
6067
  return t.charAt(0).toUpperCase() + t.slice(1);
@@ -6767,7 +6767,7 @@ var Ku = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), qu = (e)
6767
6767
  });
6768
6768
  jd.install = (e) => (e.component(jd.name, jd), e);
6769
6769
  //#endregion
6770
- //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.33_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/ModalToolbar.mjs
6770
+ //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.34_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/ModalToolbar.mjs
6771
6771
  function Md(e) {
6772
6772
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !nn(e);
6773
6773
  }
@@ -6907,7 +6907,7 @@ var Nd = /* @__PURE__ */ L({
6907
6907
  });
6908
6908
  Nd.install = (e) => (e.component(Nd.name, Nd), e);
6909
6909
  //#endregion
6910
- //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.33_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/NormalToolbar.mjs
6910
+ //#region ../../node_modules/.pnpm/md-editor-v3@6.5.0_vue@3.5.34_typescript@6.0.3_/node_modules/md-editor-v3/lib/es/NormalToolbar.mjs
6911
6911
  var Pd = /* @__PURE__ */ L({
6912
6912
  name: "NormalToolbar",
6913
6913
  props: {