@8wave/ai-elements 0.126.0-beta.32 → 0.126.0-beta.34

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 (147) hide show
  1. package/dist/_chunks/{Agent-COa7L9GK.js → Agent-DZEyfr8D.js} +2 -1
  2. package/dist/_chunks/Agent-DZEyfr8D.js.map +1 -0
  3. package/dist/_chunks/{PkFilePreview-SBGa95Ca.js → PkFilePreview-C6ZZablL.js} +3 -3
  4. package/dist/_chunks/{PkFilePreview-SBGa95Ca.js.map → PkFilePreview-C6ZZablL.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-Cc7iZWCl.js → PkFilePreviewDialog-BzBHAt8l.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-Cc7iZWCl.js.map → PkFilePreviewDialog-BzBHAt8l.js.map} +1 -1
  7. package/dist/_chunks/{PkImageEditorDialog-D13bWv-N.js → PkImageEditorDialog-Dm34WFmS.js} +2 -2
  8. package/dist/_chunks/{PkImageEditorDialog-D13bWv-N.js.map → PkImageEditorDialog-Dm34WFmS.js.map} +1 -1
  9. package/dist/_chunks/{PkSelectionActions-BaX_rsCt.js → PkSelectionActions-CYqbMEjg.js} +2 -2
  10. package/dist/_chunks/{PkSelectionActions-BaX_rsCt.js.map → PkSelectionActions-CYqbMEjg.js.map} +1 -1
  11. package/dist/_chunks/{PkStreamingMarkdown-GRB3Gg_x.js → PkStreamingMarkdown-B8rZbprU.js} +3 -3
  12. package/dist/_chunks/{PkStreamingMarkdown-GRB3Gg_x.js.map → PkStreamingMarkdown-B8rZbprU.js.map} +1 -1
  13. package/dist/_chunks/{PkToolChatFile-DTm5-CE4.js → PkToolChatFile-C0emIVfS.js} +3 -3
  14. package/dist/_chunks/{PkToolChatFile-DTm5-CE4.js.map → PkToolChatFile-C0emIVfS.js.map} +1 -1
  15. package/dist/_chunks/{PkToolRequestGeolocation-DZenn1az.js → PkToolRequestGeolocation-DNzNRszE.js} +2 -2
  16. package/dist/_chunks/{PkToolRequestGeolocation-DZenn1az.js.map → PkToolRequestGeolocation-DNzNRszE.js.map} +1 -1
  17. package/dist/_chunks/{PkToolRequestOAuthConnection-Dz0qfYu5.js → PkToolRequestOAuthConnection-BDxYXz4s.js} +2 -2
  18. package/dist/_chunks/{PkToolRequestOAuthConnection-Dz0qfYu5.js.map → PkToolRequestOAuthConnection-BDxYXz4s.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowArtifact-C9_DHr5Y.js → PkToolShowArtifact-B_KIIjEn.js} +2 -2
  20. package/dist/_chunks/{PkToolShowArtifact-C9_DHr5Y.js.map → PkToolShowArtifact-B_KIIjEn.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowContactForm-DhyelktO.js → PkToolShowContactForm-DiHb3fRQ.js} +2 -2
  22. package/dist/_chunks/{PkToolShowContactForm-DhyelktO.js.map → PkToolShowContactForm-DiHb3fRQ.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowForm-Dz2Hnzts.js → PkToolShowForm-BmUAhIQy.js} +4 -4
  24. package/dist/_chunks/{PkToolShowForm-Dz2Hnzts.js.map → PkToolShowForm-BmUAhIQy.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowImageGallery-CiDfIboY.js → PkToolShowImageGallery-CZ394fdT.js} +2 -2
  26. package/dist/_chunks/{PkToolShowImageGallery-CiDfIboY.js.map → PkToolShowImageGallery-CZ394fdT.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowProductList-CY96IGWn.js → PkToolShowProductList-uNvUr2s9.js} +2 -2
  28. package/dist/_chunks/{PkToolShowProductList-CY96IGWn.js.map → PkToolShowProductList-uNvUr2s9.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowSources-CRk-MOoE.js → PkToolShowSources-Dm0L4prK.js} +3 -3
  30. package/dist/_chunks/{PkToolShowSources-CRk-MOoE.js.map → PkToolShowSources-Dm0L4prK.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowSuggestedReply-DKuV4mmV.js → PkToolShowSuggestedReply-B_dRrZfj.js} +2 -2
  32. package/dist/_chunks/{PkToolShowSuggestedReply-DKuV4mmV.js.map → PkToolShowSuggestedReply-B_dRrZfj.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowVideo-DI6ohcVU.js → PkToolShowVideo-DLgQjTq_.js} +2 -2
  34. package/dist/_chunks/{PkToolShowVideo-DI6ohcVU.js.map → PkToolShowVideo-DLgQjTq_.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowWebPages-Dh6L_n9T.js → PkToolShowWebPages-Cj2mJrs5.js} +2 -2
  36. package/dist/_chunks/{PkToolShowWebPages-Dh6L_n9T.js.map → PkToolShowWebPages-Cj2mJrs5.js.map} +1 -1
  37. package/dist/_chunks/{chatImagePolicy-Ckz-KAHA.js → chatImagePolicy-DMt6O5iK.js} +2 -2
  38. package/dist/_chunks/{chatImagePolicy-Ckz-KAHA.js.map → chatImagePolicy-DMt6O5iK.js.map} +1 -1
  39. package/dist/_chunks/{markdown-DHayRAiy.js → markdown-nw5sXwU0.js} +2 -2
  40. package/dist/_chunks/{markdown-DHayRAiy.js.map → markdown-nw5sXwU0.js.map} +1 -1
  41. package/dist/_chunks/{utils-3jpXeGGy.js → utils-DPGBO-HU.js} +2 -2
  42. package/dist/_chunks/{utils-3jpXeGGy.js.map → utils-DPGBO-HU.js.map} +1 -1
  43. package/dist/ai-elements.es.js +3927 -3858
  44. package/dist/ai-elements.es.js.map +1 -1
  45. package/dist-vue/PkChatbot.js +1 -1
  46. package/dist-vue/PkChatbotEmptyState.js +1 -1
  47. package/dist-vue/PkChatbotInput.js +1 -1
  48. package/dist-vue/PkChatbotMessages.js +1 -1
  49. package/dist-vue/PkChatbotStepPayload.js +1 -1
  50. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  51. package/dist-vue/PkChatbotSteps.js +1 -1
  52. package/dist-vue/PkChatbotViewChat.js +1 -1
  53. package/dist-vue/PkChatbotViewConversations.js +1 -1
  54. package/dist-vue/PkChatbotViewFiles.js +1 -1
  55. package/dist-vue/PkChatbotViewProfile.js +1 -1
  56. package/dist-vue/_chunks/{Agent-CRwhrv5Z.js → Agent-CBAd3F7k.js} +2 -1
  57. package/dist-vue/_chunks/Agent-CBAd3F7k.js.map +1 -0
  58. package/dist-vue/_chunks/{Document-Bp-qpa8v.js → Document-B3w5H0R0.js} +2 -2
  59. package/dist-vue/_chunks/{Document-Bp-qpa8v.js.map → Document-B3w5H0R0.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbot-CtrcDgBe.js → PkChatbot-CXpftmWm.js} +8 -8
  61. package/dist-vue/_chunks/{PkChatbot-CtrcDgBe.js.map → PkChatbot-CXpftmWm.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotEmptyState-BF3Odn3v.js → PkChatbotEmptyState-vA2v4FES.js} +2 -2
  63. package/dist-vue/_chunks/{PkChatbotEmptyState-BF3Odn3v.js.map → PkChatbotEmptyState-vA2v4FES.js.map} +1 -1
  64. package/dist-vue/_chunks/PkChatbotInput-CIIJ1bpF.js +584 -0
  65. package/dist-vue/_chunks/PkChatbotInput-CIIJ1bpF.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotMessages-10eBKpC5.js → PkChatbotMessages-15R8RxAq.js} +18 -18
  67. package/dist-vue/_chunks/{PkChatbotMessages-10eBKpC5.js.map → PkChatbotMessages-15R8RxAq.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotStepPayload-C4ahOq6Z.js → PkChatbotStepPayload-BbNSav-U.js} +2 -2
  69. package/dist-vue/_chunks/{PkChatbotStepPayload-C4ahOq6Z.js.map → PkChatbotStepPayload-BbNSav-U.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CkIX0aKu.js → PkChatbotStepToolDetail-B_4pmbLe.js} +3 -3
  71. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CkIX0aKu.js.map → PkChatbotStepToolDetail-B_4pmbLe.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkChatbotSteps-BalLo6DZ.js → PkChatbotSteps-h4E6DH_g.js} +5 -5
  73. package/dist-vue/_chunks/{PkChatbotSteps-BalLo6DZ.js.map → PkChatbotSteps-h4E6DH_g.js.map} +1 -1
  74. package/dist-vue/_chunks/PkChatbotViewChat-CLQ0J9_f.js +1382 -0
  75. package/dist-vue/_chunks/PkChatbotViewChat-CLQ0J9_f.js.map +1 -0
  76. package/dist-vue/_chunks/{PkChatbotViewConversations-D0vDYTyo.js → PkChatbotViewConversations-DFBbypGg.js} +3 -3
  77. package/dist-vue/_chunks/{PkChatbotViewConversations-D0vDYTyo.js.map → PkChatbotViewConversations-DFBbypGg.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkChatbotViewFiles-BwfAnywk.js → PkChatbotViewFiles-PHdrHZOf.js} +3 -3
  79. package/dist-vue/_chunks/{PkChatbotViewFiles-BwfAnywk.js.map → PkChatbotViewFiles-PHdrHZOf.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkChatbotViewProfile-GW0WuMOy.js → PkChatbotViewProfile-B0AZvHTr.js} +2 -2
  81. package/dist-vue/_chunks/{PkChatbotViewProfile-GW0WuMOy.js.map → PkChatbotViewProfile-B0AZvHTr.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkFilePreview-qizsvSVW.js → PkFilePreview-Cb-1YRPN.js} +616 -666
  83. package/dist-vue/_chunks/PkFilePreview-Cb-1YRPN.js.map +1 -0
  84. package/dist-vue/_chunks/{PkFilePreviewDialog-WsVzH9hg.js → PkFilePreviewDialog-Bd7kEoCB.js} +2 -2
  85. package/dist-vue/_chunks/{PkFilePreviewDialog-WsVzH9hg.js.map → PkFilePreviewDialog-Bd7kEoCB.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkImageEditorDialog-NQFpdqCU.js → PkImageEditorDialog-Bj4sUHXM.js} +2 -2
  87. package/dist-vue/_chunks/{PkImageEditorDialog-NQFpdqCU.js.map → PkImageEditorDialog-Bj4sUHXM.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkStreamingMarkdown-CMxiJTMR.js → PkStreamingMarkdown-BcUq4ThC.js} +3 -3
  89. package/dist-vue/_chunks/{PkStreamingMarkdown-CMxiJTMR.js.map → PkStreamingMarkdown-BcUq4ThC.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolChatFile-Bd6Ci7i1.js → PkToolChatFile-BOexrlLt.js} +3 -3
  91. package/dist-vue/_chunks/{PkToolChatFile-Bd6Ci7i1.js.map → PkToolChatFile-BOexrlLt.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolRequestGeolocation-C2OmF31d.js → PkToolRequestGeolocation-CyL_M1Rm.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolRequestGeolocation-C2OmF31d.js.map → PkToolRequestGeolocation-CyL_M1Rm.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CgD-o99C.js → PkToolRequestOAuthConnection-DWkeVLpx.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-CgD-o99C.js.map → PkToolRequestOAuthConnection-DWkeVLpx.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowArtifact-rlZ-AGWh.js → PkToolShowArtifact-C4gHB6lH.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowArtifact-rlZ-AGWh.js.map → PkToolShowArtifact-C4gHB6lH.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowChart-B8xJi1yY.js → PkToolShowChart-CsPXNAb9.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowChart-B8xJi1yY.js.map → PkToolShowChart-CsPXNAb9.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowContactForm-BVBL7Unx.js → PkToolShowContactForm-2_HBPZaa.js} +2 -2
  101. package/dist-vue/_chunks/{PkToolShowContactForm-BVBL7Unx.js.map → PkToolShowContactForm-2_HBPZaa.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkToolShowDiagram-Bs39QQZ3.js → PkToolShowDiagram-cCbeL6MK.js} +2 -2
  103. package/dist-vue/_chunks/{PkToolShowDiagram-Bs39QQZ3.js.map → PkToolShowDiagram-cCbeL6MK.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkToolShowForm-D-RJeA2F.js → PkToolShowForm-DjB3fji5.js} +4 -4
  105. package/dist-vue/_chunks/{PkToolShowForm-D-RJeA2F.js.map → PkToolShowForm-DjB3fji5.js.map} +1 -1
  106. package/dist-vue/_chunks/{PkToolShowImageGallery-CrkkKCVI.js → PkToolShowImageGallery-C22TCUKW.js} +2 -2
  107. package/dist-vue/_chunks/{PkToolShowImageGallery-CrkkKCVI.js.map → PkToolShowImageGallery-C22TCUKW.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkToolShowProductList-BwfUG41_.js → PkToolShowProductList-BvtmiHBf.js} +2 -2
  109. package/dist-vue/_chunks/{PkToolShowProductList-BwfUG41_.js.map → PkToolShowProductList-BvtmiHBf.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowSources-q9gQIuam.js → PkToolShowSources-uKO4MQgd.js} +3 -3
  111. package/dist-vue/_chunks/{PkToolShowSources-q9gQIuam.js.map → PkToolShowSources-uKO4MQgd.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkToolShowSuggestedReply-75Kc8-OQ.js → PkToolShowSuggestedReply-wKgwHTRO.js} +2 -2
  113. package/dist-vue/_chunks/{PkToolShowSuggestedReply-75Kc8-OQ.js.map → PkToolShowSuggestedReply-wKgwHTRO.js.map} +1 -1
  114. package/dist-vue/_chunks/{PkToolShowVideo-BK-jDVJd.js → PkToolShowVideo-DKj5N1vo.js} +2 -2
  115. package/dist-vue/_chunks/{PkToolShowVideo-BK-jDVJd.js.map → PkToolShowVideo-DKj5N1vo.js.map} +1 -1
  116. package/dist-vue/_chunks/{PkToolShowWebPages-K3Jml1f7.js → PkToolShowWebPages-BNZmbCSf.js} +2 -2
  117. package/dist-vue/_chunks/{PkToolShowWebPages-K3Jml1f7.js.map → PkToolShowWebPages-BNZmbCSf.js.map} +1 -1
  118. package/dist-vue/_chunks/{createChatbotApiClient-Pb7_cU2s.js → createChatbotApiClient-DBKfGL6y.js} +5 -2
  119. package/dist-vue/_chunks/{createChatbotApiClient-Pb7_cU2s.js.map → createChatbotApiClient-DBKfGL6y.js.map} +1 -1
  120. package/dist-vue/_chunks/{useChatbotStore-ChrZVIDt.js → useChatbotStore-Hb5EjISl.js} +94 -85
  121. package/dist-vue/_chunks/useChatbotStore-Hb5EjISl.js.map +1 -0
  122. package/dist-vue/_chunks/{utils-Bdk5kFfi.js → utils-waie4Gfn.js} +2 -2
  123. package/dist-vue/_chunks/{utils-Bdk5kFfi.js.map → utils-waie4Gfn.js.map} +1 -1
  124. package/dist-vue/api.js +1 -1
  125. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
  126. package/dist-vue/composables.js +8 -8
  127. package/dist-vue/index.js +408 -389
  128. package/dist-vue/index.js.map +1 -1
  129. package/dist-vue/locales.js +6 -0
  130. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +9 -2
  131. package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +6 -0
  132. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +5 -0
  133. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +10 -1
  134. package/dist-vue/packages/models/src/schema/Agent.d.ts +8 -0
  135. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
  136. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
  137. package/dist-vue/packages/models/src/schema/constants.d.ts +11 -2
  138. package/dist-vue/style.css +1 -1
  139. package/package.json +1 -1
  140. package/dist/_chunks/Agent-COa7L9GK.js.map +0 -1
  141. package/dist-vue/_chunks/Agent-CRwhrv5Z.js.map +0 -1
  142. package/dist-vue/_chunks/PkChatbotInput-DNXvFvyG.js +0 -520
  143. package/dist-vue/_chunks/PkChatbotInput-DNXvFvyG.js.map +0 -1
  144. package/dist-vue/_chunks/PkChatbotViewChat-U6T-gG-c.js +0 -1336
  145. package/dist-vue/_chunks/PkChatbotViewChat-U6T-gG-c.js.map +0 -1
  146. package/dist-vue/_chunks/PkFilePreview-qizsvSVW.js.map +0 -1
  147. package/dist-vue/_chunks/useChatbotStore-ChrZVIDt.js.map +0 -1
@@ -1,66 +1,16 @@
1
1
  import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
2
  import { t } from "./VvButtonLocalized-C-vx25u4.js";
3
- import { t as n } from "./PkEditorRadioButtons-Bw576DPQ.js";
4
- import { G as r, J as i, K as a, V as o, W as s, X as c, Y as l, Z as u, o as d, q as f, s as p } from "./utils-Bdk5kFfi.js";
5
- import { r as m } from "./PkChatbotViewChat-U6T-gG-c.js";
6
- import { i as h, n as g, r as _ } from "./excelNumberFormat-CJwdxpPX.js";
7
- import { VvIcon as v } from "@volverjs/ui-vue/components";
8
- import { Fragment as y, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createTextVNode as T, createVNode as E, defineAsyncComponent as D, defineComponent as O, inject as k, isMemoSame as A, mergeModels as j, nextTick as ee, normalizeClass as M, normalizeStyle as N, onBeforeUnmount as te, onMounted as ne, onScopeDispose as P, openBlock as F, provide as re, ref as I, renderList as L, shallowRef as ie, toDisplayString as R, unref as z, useModel as B, useTemplateRef as ae, vModelText as V, watch as H, withCtx as U, withDirectives as oe, withKeys as W, withModifiers as se } from "vue";
9
- import { useI18n as ce } from "vue-i18n";
10
- import { useElementSize as le, useEventListener as ue } from "@vueuse/core";
11
- // ../../packages/composable/src/useSettledSelection.ts
12
- var de = "(hover: hover) and (pointer: fine)", fe = "(hover: none) and (pointer: coarse)", G = 400;
13
- function pe() {
14
- return typeof matchMedia == "function" && matchMedia(fe).matches;
15
- }
16
- function me(e) {
17
- let t = document.getSelection();
18
- if (!t || t.rangeCount === 0) return;
19
- if (e.nodeType === Node.DOCUMENT_NODE) return t.getRangeAt(0).cloneRange();
20
- let n = e;
21
- if (t.getComposedRanges) {
22
- let e;
23
- try {
24
- e = t.getComposedRanges({ shadowRoots: [n] });
25
- } catch {
26
- e = t.getComposedRanges(n);
27
- }
28
- let [r] = e;
29
- if (!r) return;
30
- let i = document.createRange();
31
- return i.setStart(r.startContainer, r.startOffset), i.setEnd(r.endContainer, r.endOffset), i;
32
- }
33
- let r = n.getSelection?.();
34
- return r && r.rangeCount > 0 ? r.getRangeAt(0).cloneRange() : void 0;
35
- }
36
- function he({ root: e, enabled: t = () => !0, delay: n = 150, minChars: r = 2, touch: i = !1 }) {
37
- let a = ie(), o, s = () => {
38
- clearTimeout(o), a.value = void 0;
39
- }, c = () => {
40
- let n = e();
41
- if (!n || !t()) return;
42
- let i = me(n);
43
- if (!i || i.collapsed || i.toString().trim().length < r) return;
44
- let a = i.getBoundingClientRect();
45
- return {
46
- range: i,
47
- start: i.getClientRects()[0] ?? a,
48
- box: a
49
- };
50
- }, l = typeof document < "u" && typeof matchMedia == "function" && matchMedia(de).matches, u = i && typeof document < "u" && pe(), d = u ? Math.max(n, G) : n, f = () => {
51
- s(), o = setTimeout(() => {
52
- a.value = c();
53
- }, d);
54
- };
55
- return (l || u) && (document.addEventListener("selectionchange", f), P(() => {
56
- clearTimeout(o), document.removeEventListener("selectionchange", f);
57
- })), {
58
- selection: a,
59
- clear: s
60
- };
61
- }
3
+ import { i as n, r } from "./PkChatbotInput-CIIJ1bpF.js";
4
+ import { t as i } from "./PkEditorRadioButtons-Bw576DPQ.js";
5
+ import { G as a, J as o, K as s, V as c, W as l, X as u, Y as d, Z as f, o as p, q as m, s as h } from "./utils-waie4Gfn.js";
6
+ import { r as g } from "./PkChatbotViewChat-CLQ0J9_f.js";
7
+ import { i as _, n as v, r as y } from "./excelNumberFormat-CJwdxpPX.js";
8
+ import { VvIcon as b } from "@volverjs/ui-vue/components";
9
+ import { Fragment as x, computed as S, createBlock as C, createCommentVNode as w, createElementBlock as T, createElementVNode as E, createTextVNode as D, createVNode as O, defineAsyncComponent as ee, defineComponent as k, inject as A, isMemoSame as j, mergeModels as M, nextTick as te, normalizeClass as N, normalizeStyle as P, onBeforeUnmount as ne, onMounted as re, openBlock as F, provide as ie, ref as I, renderList as L, shallowRef as ae, toDisplayString as R, unref as z, useModel as B, useTemplateRef as oe, vModelText as V, watch as H, withCtx as se, withDirectives as U, withKeys as ce, withModifiers as W } from "vue";
10
+ import { useI18n as le } from "vue-i18n";
11
+ import { useElementSize as ue, useEventListener as de } from "@vueuse/core";
62
12
  // ../../packages/components/src/chat/selectionActionIcons.ts
63
- var K = {
13
+ var fe = {
64
14
  sparkles: "ri:sparkling-line",
65
15
  magic: "ri:magic-line",
66
16
  idea: "ri:lightbulb-line",
@@ -187,27 +137,27 @@ var K = {
187
137
  music: "ri:music-2-line",
188
138
  video: "ri:video-line",
189
139
  microphone: "ri:mic-line"
190
- }, q = (e) => K[e ?? "sparkles"], ge = 2e3, _e = 1e3, ve = 60, ye = 1400, be = 20, xe = 100, Se = (e) => Number(e.slice(1)), Ce = (e) => {
191
- let t = [...new Set(e)].sort((e, t) => Se(e) - Se(t)), n = [];
140
+ }, pe = (e) => fe[e ?? "sparkles"], G = 2e3, me = 1e3, he = 60, K = 1400, ge = 20, _e = 100, q = (e) => Number(e.slice(1)), ve = (e) => {
141
+ let t = [...new Set(e)].sort((e, t) => q(e) - q(t)), n = [];
192
142
  for (let e of t) {
193
143
  let t = n[n.length - 1];
194
- t && Se(e) === Se(t.to) + 1 ? t.to = e : n.push({
144
+ t && q(e) === q(t.to) + 1 ? t.to = e : n.push({
195
145
  from: e,
196
146
  to: e
197
147
  });
198
148
  }
199
149
  return n.slice(0, 100);
200
- }, we = (e, t) => {
150
+ }, ye = (e, t) => {
201
151
  let n = [];
202
152
  if (!t) return n;
203
153
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + 1)) n.push(r);
204
154
  return n;
205
- }, Te = (e, t, n) => {
206
- let r = we(e, e.slice(t, t + n));
155
+ }, be = (e, t, n) => {
156
+ let r = ye(e, e.slice(t, t + n));
207
157
  if (r.length < 2) return {};
208
158
  let i = t, a = t + n;
209
- for (let t = !0; a - i <= ye; t = !t) {
210
- if (we(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
159
+ for (let t = !0; a - i <= K; t = !t) {
160
+ if (ye(e, e.slice(i, a)).length === 1) return { find: e.slice(i, a) };
211
161
  if (t && i > 0) i = e.slice(0, i).replace(/\S*\s*$/, "").length;
212
162
  else if (a < e.length) {
213
163
  let t = e.slice(a).match(/^\s*\S*/)?.[0] ?? "";
@@ -218,23 +168,23 @@ var K = {
218
168
  index: r.indexOf(t) + 1 || 1,
219
169
  of: r.length
220
170
  } };
221
- }, Ee = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), De = (e) => e.length > _e ? `${e.slice(0, _e / 2)} […] ${e.slice(-500)}` : e, J = (e) => {
171
+ }, xe = (e) => (e.querySelectorAll("[data-quote-skip]").forEach((e) => e.remove()), e.querySelectorAll("[data-paragraph]").forEach((e) => e.append("\n")), e.textContent ?? ""), Se = (e) => e.length > me ? `${e.slice(0, me / 2)} […] ${e.slice(-500)}` : e, Ce = (e) => {
222
172
  let t = e.startContainer.getRootNode().getSelection?.() ?? document.getSelection();
223
173
  try {
224
174
  t?.setBaseAndExtent(e.startContainer, e.startOffset, e.endContainer, e.endOffset);
225
175
  } catch {}
226
- }, Y = (e, t, n) => {
176
+ }, we = (e, t, n) => {
227
177
  let r = t.commonAncestorContainer;
228
178
  if (!e.contains(r) || (r instanceof Element ? r : r.parentElement)?.closest("[data-quote-skip]")) return;
229
179
  let i = [...e.querySelectorAll("[data-paragraph]")].filter((e) => !e.closest(n) && t.intersectsNode(e));
230
180
  if (!i.length) return;
231
- let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = Ee(t.cloneContents()), s = o.trim();
181
+ let a = i.flatMap((e) => e.dataset.paragraph.split(" ")), o = xe(t.cloneContents()), s = o.trim();
232
182
  if (s.length < 2) return;
233
183
  let c = {
234
184
  format: "docx",
235
- runs: Ce(a),
185
+ runs: ve(a),
236
186
  paragraphCount: new Set(a).size,
237
- quote: De(s),
187
+ quote: Se(s),
238
188
  measure: () => {
239
189
  let e = t.getBoundingClientRect(), n = t.getClientRects()[0] ?? e;
240
190
  return {
@@ -245,22 +195,22 @@ var K = {
245
195
  bottom: e.bottom
246
196
  };
247
197
  },
248
- restore: () => J(t)
198
+ restore: () => Ce(t)
249
199
  };
250
200
  if (i.length === 1) {
251
201
  let e = i[0], n = document.createRange();
252
202
  n.selectNodeContents(e);
253
- let r = Ee(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
203
+ let r = xe(n.cloneContents()).replace(/\n$/, ""), a = document.createRange();
254
204
  a.setStart(e, 0), a.setEnd(t.startContainer, t.startOffset);
255
- let l = Ee(a.cloneContents()).length + (o.length - o.trimStart().length);
256
- c.before = r.slice(Math.max(0, l - ve), l), c.after = r.slice(l + s.length, l + s.length + ve), Object.assign(c, Te(r, l, s.length));
205
+ let l = xe(a.cloneContents()).length + (o.length - o.trimStart().length);
206
+ c.before = r.slice(Math.max(0, l - he), l), c.after = r.slice(l + s.length, l + s.length + he), Object.assign(c, be(r, l, s.length));
257
207
  }
258
208
  return c;
259
- }, X = (e) => {
209
+ }, Te = (e) => {
260
210
  let t = "";
261
211
  for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
262
212
  return t;
263
- }, Oe = (e, t) => {
213
+ }, Ee = (e, t) => {
264
214
  let n = { ...t }, r = e.rows.flatMap((e) => e.cells.filter((e) => e.span).map((t) => ({
265
215
  r1: e.row,
266
216
  r2: e.row + t.span.rows - 1,
@@ -271,7 +221,7 @@ var K = {
271
221
  e = !1;
272
222
  for (let t of r) t.r1 <= n.r2 && t.r2 >= n.r1 && t.c1 <= n.c2 && t.c2 >= n.c1 && (t.r1 < n.r1 || t.r2 > n.r2 || t.c1 < n.c1 || t.c2 > n.c2) && (n.r1 = Math.min(n.r1, t.r1), n.r2 = Math.max(n.r2, t.r2), n.c1 = Math.min(n.c1, t.c1), n.c2 = Math.max(n.c2, t.c2), e = !0);
273
223
  }
274
- let i = `${X(n.c1)}${n.r1}`, a = `${X(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, xe), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => X(e.col)).slice(0, xe), c = e.rows.filter((e) => e.row >= n.r1 && e.row <= n.r2).flatMap((e) => e.cells.filter((e) => e.col >= n.c1 && e.col <= n.c2 && e.value !== void 0 && e.value !== "")).slice(0, be).map((e) => String(e.value)).join("; ").slice(0, 500);
224
+ let i = `${Te(n.c1)}${n.r1}`, a = `${Te(n.c2)}${n.r2}`, o = (e.hiddenRows ?? []).filter((e) => e >= n.r1 && e <= n.r2).slice(0, _e), s = e.columns.filter((e) => e.hidden && e.col >= n.c1 && e.col <= n.c2).map((e) => Te(e.col)).slice(0, _e), c = e.rows.filter((e) => e.row >= n.r1 && e.row <= n.r2).flatMap((e) => e.cells.filter((e) => e.col >= n.c1 && e.col <= n.c2 && e.value !== void 0 && e.value !== "")).slice(0, ge).map((e) => String(e.value)).join("; ").slice(0, 500);
275
225
  return {
276
226
  format: "xlsx",
277
227
  sheet: e.name,
@@ -281,12 +231,12 @@ var K = {
281
231
  ...s.length ? { hiddenColumns: s } : {},
282
232
  ...c ? { sample: c } : {}
283
233
  };
284
- }, Z = ["placeholder", "aria-label"], ke = ["disabled"], Ae = ["aria-label"], je = { class: "pk-selection-actions__text" }, Q = {
234
+ }, De = ["placeholder", "aria-label"], Oe = ["disabled"], J = ["aria-label"], Y = { class: "pk-selection-actions__text" }, X = {
285
235
  key: 0,
286
236
  class: "pk-selection-actions__text"
287
- }, Me = ["onClick", "onTouchend"], Ne = /* @__PURE__ */ O({
237
+ }, Z = ["onClick", "onTouchend"], ke = /* @__PURE__ */ k({
288
238
  __name: "PkSelectionActions",
289
- props: /*@__PURE__*/ j({
239
+ props: /*@__PURE__*/ M({
290
240
  actions: {},
291
241
  anchor: {},
292
242
  strategy: {},
@@ -301,7 +251,7 @@ var K = {
301
251
  },
302
252
  askingModifiers: {}
303
253
  }),
304
- emits: /*@__PURE__*/ j([
254
+ emits: /*@__PURE__*/ M([
305
255
  "action",
306
256
  "ask",
307
257
  "note",
@@ -316,7 +266,7 @@ var K = {
316
266
  proofread: "ri:check-double-line",
317
267
  translate: "ri:translate-2",
318
268
  chart: "ri:bar-chart-2-line"
319
- }, r = e, i = t, a = B(e, "asking"), { t: s } = ce({ useScope: "global" }), c = ae("barEl"), l = ae("inputEl"), { width: u, height: d } = le(c, void 0, { box: "border-box" }), f = b(() => o({
269
+ }, r = e, i = t, a = B(e, "asking"), { t: o } = le({ useScope: "global" }), s = oe("barEl"), l = oe("inputEl"), { width: u, height: d } = ue(s, void 0, { box: "border-box" }), f = S(() => c({
320
270
  ...r.anchor,
321
271
  bar: {
322
272
  width: u.value,
@@ -327,39 +277,39 @@ var K = {
327
277
  p.value = {
328
278
  id: e,
329
279
  placeholder: t
330
- }, m.value = "", a.value = !0, await ee(), l.value?.focus();
280
+ }, m.value = "", a.value = !0, await te(), l.value?.focus();
331
281
  }, g = () => {
332
282
  p.value = void 0, a.value = !1;
333
- }, _ = () => h(void 0, s("selectionActions.askPlaceholder")), x = (e) => n[e.id] ?? q(e.icon), D = (e) => {
283
+ }, _ = () => h(void 0, o("selectionActions.askPlaceholder")), v = (e) => n[e.id] ?? pe(e.icon), y = (e) => {
334
284
  e.asks ? h(e.id, e.asks) : i("action", e.id);
335
- }, O = (e, t) => {
285
+ }, C = (e, t) => {
336
286
  let n = e.currentTarget, r = e.changedTouches[0], i = n.getRootNode(), a = r && i.elementFromPoint(r.clientX, r.clientY);
337
287
  a && n.contains(a) && t();
338
- }, k = () => {
288
+ }, ee = () => {
339
289
  let e = m.value.trim();
340
290
  e && p.value && (p.value.id ? i("action", p.value.id, e) : i("ask", e), g());
341
- }, A = (e) => {
291
+ }, k = (e) => {
342
292
  e.isComposing || (e.stopPropagation(), e.preventDefault(), p.value ? g() : i("close"));
343
293
  };
344
294
  return (t, n) => {
345
- let r = v;
346
- return F(), C("div", {
347
- class: M(["pk-selection-actions", {
295
+ let r = b;
296
+ return F(), T("div", {
297
+ class: N(["pk-selection-actions", {
348
298
  "pk-selection-actions--fixed": e.strategy === "fixed",
349
299
  "pk-selection-actions--asking": !!p.value
350
300
  }]),
351
- style: N({
301
+ style: P({
352
302
  top: `${f.value.top}px`,
353
303
  left: `${f.value.left}px`
354
304
  }),
355
- onKeydown: W(A, ["esc"])
356
- }, [p.value ? (F(), C("form", {
305
+ onKeydown: ce(k, ["esc"])
306
+ }, [p.value ? (F(), T("form", {
357
307
  key: 0,
358
308
  ref_key: "barEl",
359
- ref: c,
309
+ ref: s,
360
310
  class: "pk-selection-actions__menu pk-selection-actions__menu--field",
361
- onSubmit: se(k, ["prevent"])
362
- }, [oe(w("input", {
311
+ onSubmit: W(ee, ["prevent"])
312
+ }, [U(E("input", {
363
313
  ref_key: "inputEl",
364
314
  ref: l,
365
315
  "onUpdate:modelValue": n[0] ||= (e) => m.value = e,
@@ -368,70 +318,70 @@ var K = {
368
318
  maxlength: "500",
369
319
  placeholder: p.value.placeholder,
370
320
  "aria-label": p.value.placeholder
371
- }, null, 8, Z), [[V, m.value]]), w("button", {
321
+ }, null, 8, De), [[V, m.value]]), E("button", {
372
322
  type: "submit",
373
323
  class: "pk-selection-actions__button pk-selection-actions__button--send",
374
324
  disabled: !m.value.trim()
375
- }, R(z(s)("action.send")), 9, ke)], 544)) : (F(), C("div", {
325
+ }, R(z(o)("action.send")), 9, Oe)], 544)) : (F(), T("div", {
376
326
  key: 1,
377
327
  ref_key: "barEl",
378
- ref: c,
328
+ ref: s,
379
329
  class: "pk-selection-actions__menu",
380
330
  role: "toolbar",
381
331
  "aria-orientation": "vertical",
382
- "aria-label": z(s)("selectionActions.label"),
383
- onTouchstart: n[7] ||= se(() => {}, ["prevent"])
384
- }, [e.note ? (F(), C(y, { key: 0 }, [w("p", je, R(e.note), 1), e.noteAction ? (F(), C("button", {
332
+ "aria-label": z(o)("selectionActions.label"),
333
+ onTouchstart: n[7] ||= W(() => {}, ["prevent"])
334
+ }, [e.note ? (F(), T(x, { key: 0 }, [E("p", Y, R(e.note), 1), e.noteAction ? (F(), T("button", {
385
335
  key: 0,
386
336
  type: "button",
387
337
  class: "pk-selection-actions__button",
388
- onMousedown: n[1] ||= se(() => {}, ["prevent"]),
338
+ onMousedown: n[1] ||= W(() => {}, ["prevent"]),
389
339
  onClick: n[2] ||= (e) => i("note"),
390
- onTouchend: n[3] ||= (e) => O(e, () => i("note"))
391
- }, [E(r, {
340
+ onTouchend: n[3] ||= (e) => C(e, () => i("note"))
341
+ }, [O(r, {
392
342
  name: "ri:arrow-right-line",
393
343
  class: "pk-selection-actions__icon"
394
- }), T(" " + R(e.noteAction), 1)], 32)) : S("", !0)], 64)) : (F(), C(y, { key: 1 }, [
395
- e.hint ? (F(), C("p", Q, R(e.hint), 1)) : S("", !0),
396
- (F(!0), C(y, null, L(e.actions, (e) => (F(), C("button", {
344
+ }), D(" " + R(e.noteAction), 1)], 32)) : w("", !0)], 64)) : (F(), T(x, { key: 1 }, [
345
+ e.hint ? (F(), T("p", X, R(e.hint), 1)) : w("", !0),
346
+ (F(!0), T(x, null, L(e.actions, (e) => (F(), T("button", {
397
347
  key: e.id,
398
348
  type: "button",
399
349
  class: "pk-selection-actions__button",
400
- onMousedown: n[4] ||= se(() => {}, ["prevent"]),
401
- onClick: (t) => D(e),
402
- onTouchend: (t) => O(t, () => D(e))
403
- }, [E(r, {
404
- name: x(e),
350
+ onMousedown: n[4] ||= W(() => {}, ["prevent"]),
351
+ onClick: (t) => y(e),
352
+ onTouchend: (t) => C(t, () => y(e))
353
+ }, [O(r, {
354
+ name: v(e),
405
355
  class: "pk-selection-actions__icon"
406
- }, null, 8, ["name"]), T(" " + R(e.label), 1)], 40, Me))), 128)),
407
- n[8] ||= w("hr", { class: "pk-selection-actions__rule" }, null, -1),
408
- w("button", {
356
+ }, null, 8, ["name"]), D(" " + R(e.label), 1)], 40, Z))), 128)),
357
+ n[8] ||= E("hr", { class: "pk-selection-actions__rule" }, null, -1),
358
+ E("button", {
409
359
  type: "button",
410
360
  class: "pk-selection-actions__button",
411
- onMousedown: n[5] ||= se(() => {}, ["prevent"]),
361
+ onMousedown: n[5] ||= W(() => {}, ["prevent"]),
412
362
  onClick: _,
413
- onTouchend: n[6] ||= (e) => O(e, _)
414
- }, [E(r, {
363
+ onTouchend: n[6] ||= (e) => C(e, _)
364
+ }, [O(r, {
415
365
  name: "ri:chat-1-line",
416
366
  class: "pk-selection-actions__icon"
417
- }), T(" " + R(z(s)("selectionActions.ask")), 1)], 32)
418
- ], 64))], 40, Ae))], 38);
367
+ }), D(" " + R(z(o)("selectionActions.ask")), 1)], 32)
368
+ ], 64))], 40, J))], 38);
419
369
  };
420
370
  }
421
- }), Pe = {
371
+ }), Ae = {
422
372
  class: "pk-file-chart",
423
373
  "data-quote-skip": ""
424
- }, Fe = {
374
+ }, je = {
425
375
  key: 1,
426
376
  class: "pk-file-chart__placeholder"
427
- }, Ie = { class: "pk-file-chart__title" }, Le = /* @__PURE__ */ O({
377
+ }, Q = { class: "pk-file-chart__title" }, Me = /* @__PURE__ */ k({
428
378
  __name: "PkFileChart",
429
379
  props: { preview: {} },
430
380
  setup(e) {
431
- let t = D(() => import("./PkChart-CmrpyYAS.js")), { t: n } = ce({ useScope: "global" });
381
+ let t = ee(() => import("./PkChart-CmrpyYAS.js")), { t: n } = le({ useScope: "global" });
432
382
  return (r, i) => {
433
- let a = v;
434
- return F(), C("div", Pe, [e.preview.chart ? (F(), x(z(t), {
383
+ let a = b;
384
+ return F(), T("div", Ae, [e.preview.chart ? (F(), C(z(t), {
435
385
  key: 0,
436
386
  chart: e.preview.chart,
437
387
  colors: e.preview.colors,
@@ -441,28 +391,28 @@ var K = {
441
391
  "chart",
442
392
  "colors",
443
393
  "legend"
444
- ])) : (F(), C("div", Fe, [
445
- E(a, {
394
+ ])) : (F(), T("div", je, [
395
+ O(a, {
446
396
  name: "ri:bar-chart-2-line",
447
397
  class: "text-16"
448
398
  }),
449
- w("span", Ie, R(e.preview.title || z(n)("chatFilePreview.chart")), 1),
450
- w("span", null, R(z(n)("chatFilePreview.chartNotDrawn")), 1)
399
+ E("span", Q, R(e.preview.title || z(n)("chatFilePreview.chart")), 1),
400
+ E("span", null, R(z(n)("chatFilePreview.chartNotDrawn")), 1)
451
401
  ]))]);
452
402
  };
453
403
  }
454
- }), Re = (e, t, n, r) => {
404
+ }), Ne = (e, t, n, r) => {
455
405
  let i = e.numFmt === void 0 ? void 0 : n.numberFormats?.[e.numFmt];
456
406
  if (i !== void 0) try {
457
- return e.format === "date" || h(i) ? g(i, t, r, n.date1904) : _(i, t, r);
407
+ return e.format === "date" || _(i) ? v(i, t, r, n.date1904) : y(i, t, r);
458
408
  } catch {
459
409
  return;
460
410
  }
461
- }, ze = (e, t, n) => {
411
+ }, Pe = (e, t, n) => {
462
412
  let r = e.format === "date" ? e.serial : e.value;
463
- return typeof r == "number" ? Re(e, r, t, n) : void 0;
464
- }, Be = (e, t, n, r) => {
465
- let i = Re(e, t, n, r);
413
+ return typeof r == "number" ? Ne(e, r, t, n) : void 0;
414
+ }, Fe = (e, t, n, r) => {
415
+ let i = Ne(e, t, n, r);
466
416
  if (i) return i.text;
467
417
  let a = e.decimals === void 0 ? { maximumFractionDigits: 10 } : {
468
418
  minimumFractionDigits: e.decimals,
@@ -477,15 +427,15 @@ var K = {
477
427
  currency: e.currency
478
428
  } : {}
479
429
  }).format(t);
480
- }, Ve = (e, t, n) => {
430
+ }, Ie = (e, t, n) => {
481
431
  let r = 0, i = 0, a = 0, o;
482
432
  for (let t of e) t && (t.value !== void 0 || t.missing) && (r++, typeof t.value == "number" && (i += t.value, a++, o ??= t));
483
433
  if (r) return {
484
434
  count: r,
485
- sum: o ? Be(o, i, t, n) : void 0,
486
- average: o ? Be(o, i / a, t, n) : void 0
435
+ sum: o ? Fe(o, i, t, n) : void 0,
436
+ average: o ? Fe(o, i / a, t, n) : void 0
487
437
  };
488
- }, He = { class: "pk-spreadsheet-preview" }, Ue = { class: "pk-spreadsheet-preview__bar" }, We = ["aria-label"], Ge = ["aria-label"], Ke = ["aria-label"], qe = [
438
+ }, Le = { class: "pk-spreadsheet-preview" }, Re = { class: "pk-spreadsheet-preview__bar" }, ze = ["aria-label"], Be = ["aria-label"], Ve = ["aria-label"], He = [
489
439
  "rowspan",
490
440
  "colspan",
491
441
  "data-focus",
@@ -493,21 +443,21 @@ var K = {
493
443
  "title",
494
444
  "onMousedown",
495
445
  "onMouseenter"
496
- ], Je = {
446
+ ], Ue = {
497
447
  key: 1,
498
448
  class: "pk-spreadsheet-preview__charts"
499
- }, Ye = {
449
+ }, We = {
500
450
  key: 2,
501
451
  class: "pk-spreadsheet-preview__more"
502
- }, Xe = ["aria-label"], Ze = ["aria-current", "onClick"], Qe = { class: "pk-spreadsheet-preview__status" }, $e = { class: "pk-spreadsheet-preview__info" }, et = ["title"], tt = ["title"], nt = {
452
+ }, Ge = ["aria-label"], Ke = ["aria-current", "onClick"], qe = { class: "pk-spreadsheet-preview__status" }, Je = { class: "pk-spreadsheet-preview__info" }, Ye = ["title"], Xe = ["title"], Ze = {
503
453
  key: 2,
504
454
  class: "pk-spreadsheet-preview__stats"
505
- }, rt = {
455
+ }, Qe = {
506
456
  key: 0,
507
457
  class: "pk-spreadsheet-preview__average"
508
- }, it = { key: 1 }, at = { class: "pk-spreadsheet-preview__zoom" }, ot = { class: "pk-spreadsheet-preview__percent" }, st = 64, ct = 20, lt = 28, ut = 44, dt = 400, ft = 10, $ = /* @__PURE__ */ O({
458
+ }, $e = { key: 1 }, et = { class: "pk-spreadsheet-preview__zoom" }, tt = { class: "pk-spreadsheet-preview__percent" }, nt = 64, rt = 20, it = 28, at = 44, ot = 400, st = 10, ct = /* @__PURE__ */ k({
509
459
  __name: "PkSpreadsheetPreview",
510
- props: /*@__PURE__*/ j({
460
+ props: /*@__PURE__*/ M({
511
461
  preview: {},
512
462
  marked: {}
513
463
  }, {
@@ -516,72 +466,72 @@ var K = {
516
466
  zoom: { default: 1 },
517
467
  zoomModifiers: {}
518
468
  }),
519
- emits: /*@__PURE__*/ j(["select"], ["update:sheet", "update:zoom"]),
469
+ emits: /*@__PURE__*/ M(["select"], ["update:sheet", "update:zoom"]),
520
470
  setup(e, { emit: n }) {
521
- let r = e, i = n, { t: a, locale: o } = ce({ useScope: "global" }), s = B(e, "sheet"), c = B(e, "zoom"), l = ae("scrollEl"), { width: u, height: d } = le(l, {
471
+ let r = e, i = n, { t: a, locale: o } = le({ useScope: "global" }), s = B(e, "sheet"), c = B(e, "zoom"), l = oe("scrollEl"), { width: u, height: d } = ue(l, {
522
472
  width: 0,
523
473
  height: 0
524
- }, { box: "border-box" }), f = b(() => r.preview.sheets[s.value] ?? r.preview.sheets[0]);
474
+ }, { box: "border-box" }), f = S(() => r.preview.sheets[s.value] ?? r.preview.sheets[0]);
525
475
  H(() => r.preview, () => {
526
476
  s.value = 0;
527
477
  });
528
- let p = b(() => r.marked?.get(f.value?.name ?? "")), h = b(() => {
478
+ let p = S(() => r.marked?.get(f.value?.name ?? "")), m = S(() => {
529
479
  let e = /* @__PURE__ */ new Map();
530
480
  for (let t of p.value ?? []) {
531
481
  let [n, r] = t.split(":"), i = e.get(Number(n));
532
482
  e.set(Number(n), i ? `${i},${r}` : r);
533
483
  }
534
484
  return e;
535
- }), g = (e, t) => !!p.value?.has(`${e}:${t}`);
485
+ }), h = (e, t) => !!p.value?.has(`${e}:${t}`);
536
486
  H(() => r.marked, (e) => {
537
487
  if (!e || p.value) return;
538
488
  let t = r.preview.sheets.findIndex((t) => e.has(t.name));
539
489
  t >= 0 && (s.value = t);
540
490
  }, { immediate: !0 });
541
- let _ = () => m(l.value, ".pk-spreadsheet-preview__cell--marked");
542
- H(p, _, { flush: "post" }), ne(_);
491
+ let _ = () => g(l.value, ".pk-spreadsheet-preview__cell--marked");
492
+ H(p, _, { flush: "post" }), re(_);
543
493
  let v = (e) => {
544
494
  let t = "";
545
495
  for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
546
496
  return t;
547
- }, x = b(() => (f.value?.charts ?? []).reduce((e, t) => ({
497
+ }, y = S(() => (f.value?.charts ?? []).reduce((e, t) => ({
548
498
  col: Math.max(e.col, t.lastCol),
549
499
  row: Math.max(e.row, t.lastRow)
550
500
  }), {
551
501
  col: 0,
552
502
  row: 0
553
- })), D = b(() => {
503
+ })), b = S(() => {
554
504
  let e = f.value;
555
505
  if (!e) return [];
556
- let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i = ut, a = u.value / c.value;
557
- for (let o = 1; o <= e.lastColumn || o <= x.value.col || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
506
+ let t = new Set(e.columns.filter((e) => e.hidden).map((e) => e.col)), n = new Map(e.columns.map((e) => [e.col, e.width])), r = [], i = at, a = u.value / c.value;
507
+ for (let o = 1; o <= e.lastColumn || o <= y.value.col || !e.moreColumns && (o <= e.lastColumn + 2 || i < a); o++) {
558
508
  if (t.has(o)) continue;
559
- let e = n.get(o) ?? st;
509
+ let e = n.get(o) ?? nt;
560
510
  r.push({
561
511
  col: o,
562
512
  width: e
563
513
  }), i += e;
564
514
  }
565
515
  return r;
566
- }), O = b(() => D.value.reduce((e, t) => e + t.width, ut)), k = b(() => D.value.map((e) => `${e.col}:${e.width}`).join(",")), j = /* @__PURE__ */ new WeakMap(), P = b(() => {
516
+ }), C = S(() => b.value.reduce((e, t) => e + t.width, at)), ee = S(() => b.value.map((e) => `${e.col}:${e.width}`).join(",")), k = /* @__PURE__ */ new WeakMap(), A = S(() => {
567
517
  let e = f.value;
568
518
  if (!e) return [];
569
- let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((d.value / c.value - lt) / ct), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size, x.value.row), a = j.get(e);
570
- a || (a = /* @__PURE__ */ new Map(), j.set(e, a));
519
+ let t = new Set(e.hiddenRows ?? []), n = new Map(e.rows.map((e) => [e.row, e.height])), r = Math.ceil((d.value / c.value - it) / rt), i = e.moreRows ? e.lastRow : Math.max(e.lastRow + 5, r + t.size, y.value.row), a = k.get(e);
520
+ a || (a = /* @__PURE__ */ new Map(), k.set(e, a));
571
521
  let o = a;
572
522
  return Array.from({ length: i }, (e, t) => t + 1).filter((e) => !t.has(e)).map((e) => {
573
523
  let t = o.get(e);
574
524
  return t || (t = {
575
525
  row: e,
576
- height: n.get(e) ?? ct
526
+ height: n.get(e) ?? rt
577
527
  }, o.set(e, t)), t;
578
528
  });
579
- }), re = b(() => {
529
+ }), M = S(() => {
580
530
  let e = f.value?.charts ?? [];
581
531
  if (!e.length) return [];
582
532
  let t = c.value;
583
533
  return e.map((e, n) => {
584
- let r = D.value.reduce((t, n) => n.col < e.col ? t + n.width : t, ut + e.x), i = P.value.reduce((t, n) => n.row < e.row ? t + n.height : t, lt + e.y);
534
+ let r = b.value.reduce((t, n) => n.col < e.col ? t + n.width : t, at + e.x), i = A.value.reduce((t, n) => n.row < e.row ? t + n.height : t, it + e.y);
585
535
  return {
586
536
  key: `${f.value?.name}:${n}`,
587
537
  chart: e,
@@ -593,24 +543,24 @@ var K = {
593
543
  }
594
544
  };
595
545
  });
596
- }), ie = b(() => {
546
+ }), ie = S(() => {
597
547
  let e = /* @__PURE__ */ new Map();
598
548
  for (let t of f.value?.rows ?? []) for (let n of t.cells) e.set(`${t.row},${n.col}`, n);
599
549
  return e;
600
- }), V = b(() => {
550
+ }), ae = S(() => {
601
551
  let e = /* @__PURE__ */ new Map();
602
552
  for (let t of f.value?.rows ?? []) for (let n of t.cells) if (n.span) for (let r = 0; r < n.span.rows; r++) for (let i = 0; i < n.span.cols; i++) (r || i) && e.set(`${t.row + r},${n.col + i}`, {
603
553
  row: t.row,
604
554
  col: n.col
605
555
  });
606
556
  return e;
607
- }), U = (e, t) => ie.value.get(`${e},${t}`), oe = (e, t) => {
608
- let n = U(e, t)?.span;
557
+ }), V = (e, t) => ie.value.get(`${e},${t}`), se = (e, t) => {
558
+ let n = V(e, t)?.span;
609
559
  if (n) return {
610
- rows: P.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
611
- cols: D.value.filter((e) => e.col >= t && e.col < t + n.cols).length
560
+ rows: A.value.filter((t) => t.row >= e && t.row < e + n.rows).length,
561
+ cols: b.value.filter((e) => e.col >= t && e.col < t + n.cols).length
612
562
  };
613
- }, W = (e) => e?.style === void 0 ? void 0 : r.preview.styles[e.style], ue = (e) => ze(e, r.preview, o.value), de = (e) => {
563
+ }, U = (e) => e?.style === void 0 ? void 0 : r.preview.styles[e.style], ce = (e) => Pe(e, r.preview, o.value), de = (e) => {
614
564
  let t = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
615
565
  return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(o.value, {
616
566
  dateStyle: "short",
@@ -620,8 +570,8 @@ var K = {
620
570
  if (!e) return "";
621
571
  if (e.missing) return "—";
622
572
  let t = e.value;
623
- return t === void 0 ? "" : typeof t == "boolean" ? a(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? ue(e)?.text ?? de(t) : typeof t == "number" ? Be(e, t, r.preview, o.value) : t;
624
- }, G = (e) => {
573
+ return t === void 0 ? "" : typeof t == "boolean" ? a(t ? "chatFilePreview.true" : "chatFilePreview.false") : e.format === "date" && typeof t == "string" ? ce(e)?.text ?? de(t) : typeof t == "number" ? Fe(e, t, r.preview, o.value) : t;
574
+ }, pe = (e) => {
625
575
  if (!e) return "";
626
576
  if (e.formula) return `=${e.formula}`;
627
577
  let t = e.value;
@@ -630,8 +580,8 @@ var K = {
630
580
  maximumFractionDigits: 15,
631
581
  ...e.format === "percent" ? { style: "percent" } : {}
632
582
  }).format(t) : fe(e);
633
- }, pe = (e) => e ? `${e.width}px solid ${e.color}` : void 0, me = (e, t, n) => {
634
- let r = W(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
583
+ }, G = (e) => e ? `${e.width}px solid ${e.color}` : void 0, me = (e, t, n) => {
584
+ let r = U(e), i = e?.value, a = typeof i == "number" || e?.format === "date" || !!e?.missing, o = {
635
585
  textAlign: r?.align ?? (a ? "right" : typeof i == "boolean" || e?.format === "error" ? "center" : "left"),
636
586
  verticalAlign: r?.valign === "top" ? "top" : r?.valign === "middle" ? "middle" : "bottom",
637
587
  whiteSpace: r?.wrap ? "pre-wrap" : "nowrap"
@@ -639,13 +589,13 @@ var K = {
639
589
  r?.bold && (o.fontWeight = 700), r?.italic && (o.fontStyle = "italic");
640
590
  let s = [r?.underline ? "underline" : "", r?.strike ? "line-through" : ""].filter(Boolean).join(" ");
641
591
  s && (o.textDecoration = s), r?.size && (o.fontSize = `${r.size}pt`);
642
- let c = e ? ue(e)?.color : void 0;
592
+ let c = e ? ce(e)?.color : void 0;
643
593
  if ((c ?? r?.color) && (o.color = c ?? r?.color), r?.fill && (o.backgroundColor = r.fill), r?.indent) {
644
594
  let e = `${4 + r.indent * 9}px`;
645
595
  o.textAlign === "right" ? o.paddingRight = e : o.paddingLeft = e;
646
596
  }
647
597
  let l = je(t, n);
648
- return he(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Ce(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = pe(r?.borders?.top), o.borderRight = pe(r?.borders?.right), o.borderBottom = pe(r?.borders?.bottom), o.borderLeft = pe(r?.borders?.left), o.boxShadow = [...l, ...ge(e, t, n)].join(", ")), Object.assign(o, De(t, n)), o;
598
+ return he(t, n) ? (o.borderStyle = "hidden", o.boxShadow = [...l, Ce(e, t, n)].filter(Boolean).join(", ")) : (o.borderTop = G(r?.borders?.top), o.borderRight = G(r?.borders?.right), o.borderBottom = G(r?.borders?.bottom), o.borderLeft = G(r?.borders?.left), o.boxShadow = [...l, ..._e(e, t, n)].join(", ")), Object.assign(o, Oe(t, n)), o;
649
599
  }, he = (e, t) => {
650
600
  let n = f.value?.frozen;
651
601
  return !!n && (e <= n.rows || t <= n.cols);
@@ -654,10 +604,10 @@ var K = {
654
604
  right: (e) => `inset -${e.width}px 0 0 ${e.color}`,
655
605
  bottom: (e) => `inset 0 -${e.width}px 0 ${e.color}`,
656
606
  left: (e) => `inset ${e.width}px 0 0 ${e.color}`
657
- }, q = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), ge = (e, t, n) => {
658
- let r = W(e)?.borders;
659
- return [t === P.value[0]?.row && r?.top && K.top(r.top), n === D.value[0]?.col && r?.left && K.left(r.left)].filter((e) => !!e);
660
- }, _e = b(() => P.value.map((e) => e.row)), ve = b(() => D.value.map((e) => e.col)), ye = b(() => new Map(_e.value.map((e, t) => [e, t]))), be = b(() => new Map(ve.value.map((e, t) => [e, t]))), xe = (e, t, n, r) => {
607
+ }, ge = (...e) => e.reduce((e, t) => t && (!e || t.width > e.width) ? t : e, void 0), _e = (e, t, n) => {
608
+ let r = U(e)?.borders;
609
+ return [t === A.value[0]?.row && r?.top && K.top(r.top), n === b.value[0]?.col && r?.left && K.left(r.left)].filter((e) => !!e);
610
+ }, q = S(() => A.value.map((e) => e.row)), ve = S(() => b.value.map((e) => e.col)), ye = S(() => new Map(q.value.map((e, t) => [e, t]))), be = S(() => new Map(ve.value.map((e, t) => [e, t]))), xe = (e, t, n, r) => {
661
611
  let i = [], a = t.get(n) ?? e.length;
662
612
  for (; a < e.length && e[a] < n + r; a++) i.push(e[a]);
663
613
  return {
@@ -665,7 +615,7 @@ var K = {
665
615
  next: e[a]
666
616
  };
667
617
  }, Se = (e, t, n, r) => {
668
- let { spanned: i, next: a } = xe(_e.value, ye.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = xe(ve.value, be.value, n, e?.span?.cols ?? 1);
618
+ let { spanned: i, next: a } = xe(q.value, ye.value, t, e?.span?.rows ?? 1), { spanned: o, next: s } = xe(ve.value, be.value, n, e?.span?.cols ?? 1);
669
619
  return (r === "right" ? s === void 0 ? [] : i.map((e) => ({
670
620
  row: e,
671
621
  col: s
@@ -673,23 +623,23 @@ var K = {
673
623
  row: a,
674
624
  col: e
675
625
  }))).map((e) => {
676
- let t = V.value.get(`${e.row},${e.col}`) ?? e;
677
- return U(t.row, t.col);
626
+ let t = ae.value.get(`${e.row},${e.col}`) ?? e;
627
+ return V(t.row, t.col);
678
628
  });
679
629
  }, Ce = (e, t, n) => {
680
- let r = W(e)?.borders, i = q(r?.right, ...Se(e, t, n, "right").map((e) => W(e)?.borders?.left)), a = q(r?.bottom, ...Se(e, t, n, "bottom").map((e) => W(e)?.borders?.top)), o = f.value?.gridlines;
630
+ let r = U(e)?.borders, i = ge(r?.right, ...Se(e, t, n, "right").map((e) => U(e)?.borders?.left)), a = ge(r?.bottom, ...Se(e, t, n, "bottom").map((e) => U(e)?.borders?.top)), o = f.value?.gridlines;
681
631
  return [
682
632
  i ? K.right(i) : o && "inset calc(var(--border) * -1) 0 0 var(--pk-spreadsheet-gridline)",
683
633
  a ? K.bottom(a) : o && "inset 0 calc(var(--border) * -1) 0 var(--pk-spreadsheet-gridline)",
684
- ...ge(e, t, n)
634
+ ..._e(e, t, n)
685
635
  ].filter(Boolean).join(", ");
686
- }, we = (e) => lt + P.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Te = (e) => ut + D.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), Ee = b(() => {
636
+ }, we = (e) => it + A.value.filter((t) => t.row < e).reduce((e, t) => e + t.height, 0), Te = (e) => at + b.value.filter((t) => t.col < e).reduce((e, t) => e + t.width, 0), De = S(() => {
687
637
  let e = f.value?.frozen;
688
638
  return {
689
639
  top: we((e?.rows ?? 0) + 1),
690
640
  left: Te((e?.cols ?? 0) + 1)
691
641
  };
692
- }), De = (e, t) => {
642
+ }), Oe = (e, t) => {
693
643
  let n = f.value?.frozen;
694
644
  if (!n) return {};
695
645
  let r = {};
@@ -710,7 +660,7 @@ var K = {
710
660
  col: 1
711
661
  };
712
662
  });
713
- let X = b(() => ({
663
+ let X = S(() => ({
714
664
  r1: Math.min(J.value.row, Y.value.row),
715
665
  r2: Math.max(J.value.row, Y.value.row),
716
666
  c1: Math.min(J.value.col, Y.value.col),
@@ -718,14 +668,14 @@ var K = {
718
668
  })), Z = (e, t) => e >= X.value.r1 && e <= X.value.r2 && t >= X.value.c1 && t <= X.value.c2, ke = (e, t) => Y.value.row === e && Y.value.col === t, Ae = (e) => e >= X.value.r1 && e <= X.value.r2 ? `${X.value.c1}:${X.value.c2}:${Y.value.row === e ? Y.value.col : 0}:${e === X.value.r1 ? "t" : ""}${e === X.value.r2 ? "b" : ""}` : "", je = (e, t) => {
719
669
  let { r1: n, r2: r, c1: i, c2: a } = X.value;
720
670
  if (n === r && i === a || !Z(e, t)) return [];
721
- let o = U(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
671
+ let o = V(e, t)?.span, s = e + (o?.rows ?? 1) - 1, c = t + (o?.cols ?? 1) - 1, l = "var(--spacing-2)", u = "var(--pk-spreadsheet-green)";
722
672
  return [
723
673
  e === n && `inset 0 ${l} 0 ${u}`,
724
674
  s >= r && `inset 0 calc(${l} * -1) 0 ${u}`,
725
675
  t === i && `inset ${l} 0 0 ${u}`,
726
676
  c >= a && `inset calc(${l} * -1) 0 0 ${u}`
727
677
  ].filter((e) => !!e);
728
- }, Q = I(!1), Me = (e, t, n) => {
678
+ }, Q = I(!1), Ne = (e, t, n) => {
729
679
  l.value?.focus({ preventScroll: !0 }), Y.value = {
730
680
  row: e,
731
681
  col: t
@@ -733,12 +683,12 @@ var K = {
733
683
  row: e,
734
684
  col: t
735
685
  }), Q.value = !0;
736
- }, Ne = (e, t) => {
686
+ }, ct = (e, t) => {
737
687
  Q.value && (Y.value = {
738
688
  row: e,
739
689
  col: t
740
690
  });
741
- }, Pe, Fe = () => {
691
+ }, lt, ut = () => {
742
692
  let e = [...l.value?.querySelectorAll(".pk-spreadsheet-preview__cell--range, [data-focus]") ?? []].map((e) => e.getBoundingClientRect());
743
693
  if (e.length) return {
744
694
  start: {
@@ -747,18 +697,18 @@ var K = {
747
697
  },
748
698
  bottom: Math.max(...e.map((e) => e.bottom))
749
699
  };
750
- }, Ie = () => f.value ? {
751
- ...Oe(f.value, X.value),
752
- measure: Fe
700
+ }, dt = () => f.value ? {
701
+ ...Ee(f.value, X.value),
702
+ measure: ut
753
703
  } : void 0;
754
704
  H([X, Q], () => {
755
- clearTimeout(Pe), Q.value || (Pe = setTimeout(() => {
705
+ clearTimeout(lt), Q.value || (lt = setTimeout(() => {
756
706
  let e = X.value, t = e.r2 > e.r1 || e.c2 > e.c1;
757
- i("select", t ? Ie() : void 0);
707
+ i("select", t ? dt() : void 0);
758
708
  }, 150));
759
709
  });
760
- let Re = () => {
761
- clearTimeout(Pe), i("select", Ie());
710
+ let ft = () => {
711
+ clearTimeout(lt), i("select", dt());
762
712
  }, $, pt;
763
713
  H(f, () => {
764
714
  pt = void 0;
@@ -772,10 +722,10 @@ var K = {
772
722
  }, ht = () => {
773
723
  clearTimeout($?.timer), $?.active && (Q.value = !1), $ = void 0;
774
724
  };
775
- te(() => {
776
- ht(), clearTimeout(Pe);
725
+ ne(() => {
726
+ ht(), clearTimeout(lt);
777
727
  });
778
- let gt = () => void ee(Re), _t = (e) => {
728
+ let gt = () => void te(ft), _t = (e) => {
779
729
  ht();
780
730
  let t = e.touches[0], n = e.touches.length === 1 ? mt(e.target) : void 0;
781
731
  t && n && ($ = {
@@ -791,13 +741,13 @@ var K = {
791
741
  row: $.row,
792
742
  col: $.col
793
743
  }, Q.value = !0);
794
- }, dt)
744
+ }, ot)
795
745
  });
796
746
  }, vt = (e) => {
797
747
  let t = e.touches[0];
798
748
  if (!$ || !t) return;
799
749
  if (!$.active) {
800
- (!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) > ft) && ht();
750
+ (!e.cancelable || Math.hypot(t.clientX - $.x, t.clientY - $.y) > st) && ht();
801
751
  return;
802
752
  }
803
753
  e.preventDefault();
@@ -831,7 +781,7 @@ var K = {
831
781
  }[e.key];
832
782
  if (!t) return;
833
783
  e.preventDefault();
834
- let n = P.value.map((e) => e.row), r = D.value.map((e) => e.col), i = (e) => V.value.get(`${e.row},${e.col}`) ?? e, a = i(Y.value), o = n.indexOf(Y.value.row), s = r.indexOf(Y.value.col), c = a;
784
+ let n = A.value.map((e) => e.row), r = b.value.map((e) => e.col), i = (e) => ae.value.get(`${e.row},${e.col}`) ?? e, a = i(Y.value), o = n.indexOf(Y.value.row), s = r.indexOf(Y.value.col), c = a;
835
785
  for (;;) {
836
786
  let e = Math.min(n.length - 1, Math.max(0, o + t[0])), l = Math.min(r.length - 1, Math.max(0, s + t[1]));
837
787
  if (e === o && l === s || (o = e, s = l, c = i({
@@ -839,37 +789,37 @@ var K = {
839
789
  col: r[s]
840
790
  }), c.row !== a.row || c.col !== a.col)) break;
841
791
  }
842
- Y.value = c, e.shiftKey || (J.value = c), ee(() => l.value?.querySelector("[data-focus]")?.scrollIntoView({
792
+ Y.value = c, e.shiftKey || (J.value = c), te(() => l.value?.querySelector("[data-focus]")?.scrollIntoView({
843
793
  block: "nearest",
844
794
  inline: "nearest"
845
795
  }));
846
- }, xt = b(() => U(Y.value.row, Y.value.col)), St = b(() => {
796
+ }, xt = S(() => V(Y.value.row, Y.value.col)), St = S(() => {
847
797
  let { r1: e, r2: t, c1: n, c2: i } = X.value;
848
798
  if (e === t && n === i) return;
849
799
  let a = [];
850
- for (let r = e; r <= t; r++) for (let e = n; e <= i; e++) a.push(U(r, e));
851
- return Ve(a, r.preview, o.value);
800
+ for (let r = e; r <= t; r++) for (let e = n; e <= i; e++) a.push(V(r, e));
801
+ return Ie(a, r.preview, o.value);
852
802
  }), Ct = (e) => {
853
803
  c.value = Math.min(2, Math.max(.5, Math.round((c.value + e) * 10) / 10));
854
804
  };
855
805
  return (n, r) => {
856
806
  let i = t;
857
- return F(), C("div", He, [
858
- w("div", Ue, [
859
- w("span", {
807
+ return F(), T("div", Le, [
808
+ E("div", Re, [
809
+ E("span", {
860
810
  class: "pk-spreadsheet-preview__ref",
861
811
  "aria-label": z(a)("chatFilePreview.cell")
862
- }, R(v(Y.value.col)) + R(Y.value.row), 9, We),
863
- r[6] ||= w("span", {
812
+ }, R(v(Y.value.col)) + R(Y.value.row), 9, ze),
813
+ r[6] ||= E("span", {
864
814
  class: "pk-spreadsheet-preview__fx",
865
815
  "aria-hidden": "true"
866
816
  }, "fx", -1),
867
- w("output", {
817
+ E("output", {
868
818
  class: "pk-spreadsheet-preview__formula",
869
819
  "aria-label": z(a)("chatFilePreview.formulaBar")
870
- }, R(G(xt.value)), 9, Ge)
820
+ }, R(pe(xt.value)), 9, Be)
871
821
  ]),
872
- w("div", {
822
+ E("div", {
873
823
  ref_key: "scrollEl",
874
824
  ref: l,
875
825
  class: "pk-spreadsheet-preview__scroll",
@@ -884,109 +834,109 @@ var K = {
884
834
  onTouchend: yt,
885
835
  onTouchcancel: ht
886
836
  }, [
887
- f.value ? (F(), C("table", {
837
+ f.value ? (F(), T("table", {
888
838
  key: 0,
889
- class: M(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": f.value.gridlines }]),
890
- style: N({
839
+ class: N(["pk-spreadsheet-preview__grid", { "pk-spreadsheet-preview__grid--lines": f.value.gridlines }]),
840
+ style: P({
891
841
  zoom: c.value,
892
- width: `${O.value}px`,
893
- "--pk-spreadsheet-stuck-top": `${Ee.value.top}px`,
894
- "--pk-spreadsheet-stuck-left": `${Ee.value.left}px`
842
+ width: `${C.value}px`,
843
+ "--pk-spreadsheet-stuck-top": `${De.value.top}px`,
844
+ "--pk-spreadsheet-stuck-left": `${De.value.left}px`
895
845
  })
896
846
  }, [
897
- w("colgroup", null, [w("col", { style: N({ width: `${ut}px` }) }, null, 4), (F(!0), C(y, null, L(D.value, (e) => (F(), C("col", {
847
+ E("colgroup", null, [E("col", { style: P({ width: `${at}px` }) }, null, 4), (F(!0), T(x, null, L(b.value, (e) => (F(), T("col", {
898
848
  key: e.col,
899
- style: N({ width: `${e.width}px` })
849
+ style: P({ width: `${e.width}px` })
900
850
  }, null, 4))), 128))]),
901
- w("thead", null, [w("tr", { style: N({ height: `${lt}px` }) }, [r[7] ||= w("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (F(!0), C(y, null, L(D.value, (e) => (F(), C("th", {
851
+ E("thead", null, [E("tr", { style: P({ height: `${it}px` }) }, [r[7] ||= E("th", { class: "pk-spreadsheet-preview__corner" }, null, -1), (F(!0), T(x, null, L(b.value, (e) => (F(), T("th", {
902
852
  key: e.col,
903
853
  scope: "col",
904
- class: M(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= X.value.c1 && e.col <= X.value.c2 }]),
905
- style: N(f.value.frozen && e.col <= f.value.frozen.cols ? {
854
+ class: N(["pk-spreadsheet-preview__head", { "pk-spreadsheet-preview__head--current": e.col >= X.value.c1 && e.col <= X.value.c2 }]),
855
+ style: P(f.value.frozen && e.col <= f.value.frozen.cols ? {
906
856
  left: `${Te(e.col)}px`,
907
857
  zIndex: 2
908
858
  } : void 0)
909
859
  }, R(v(e.col)), 7))), 128))], 4)]),
910
- w("tbody", null, [(F(!0), C(y, null, L(P.value, (e, t, n, r) => {
860
+ E("tbody", null, [(F(!0), T(x, null, L(A.value, (e, t, n, r) => {
911
861
  let i = [
912
862
  e,
913
863
  f.value,
914
- k.value,
864
+ ee.value,
915
865
  z(o),
916
866
  Ae(e.row),
917
- h.value.get(e.row)
867
+ m.value.get(e.row)
918
868
  ];
919
- if (r && r.el && r.key === e.row && A(r, i)) return r;
920
- let s = (F(), C("tr", {
869
+ if (r && r.el && r.key === e.row && j(r, i)) return r;
870
+ let s = (F(), T("tr", {
921
871
  key: e.row,
922
- style: N({ height: `${e.height}px` })
923
- }, [w("th", {
872
+ style: P({ height: `${e.height}px` })
873
+ }, [E("th", {
924
874
  scope: "row",
925
- class: M(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= X.value.r1 && e.row <= X.value.r2 }]),
926
- style: N(f.value.frozen && e.row <= f.value.frozen.rows ? {
927
- ...De(e.row, 0),
875
+ class: N(["pk-spreadsheet-preview__row", { "pk-spreadsheet-preview__row--current": e.row >= X.value.r1 && e.row <= X.value.r2 }]),
876
+ style: P(f.value.frozen && e.row <= f.value.frozen.rows ? {
877
+ ...Oe(e.row, 0),
928
878
  left: 0,
929
879
  zIndex: 4
930
880
  } : void 0)
931
- }, R(e.row), 7), (F(!0), C(y, null, L(D.value, (t) => (F(), C(y, { key: t.col }, [V.value.has(`${e.row},${t.col}`) ? S("", !0) : (F(), C("td", {
881
+ }, R(e.row), 7), (F(!0), T(x, null, L(b.value, (t) => (F(), T(x, { key: t.col }, [ae.value.has(`${e.row},${t.col}`) ? w("", !0) : (F(), T("td", {
932
882
  key: 0,
933
- rowspan: oe(e.row, t.col)?.rows,
934
- colspan: oe(e.row, t.col)?.cols,
935
- class: M(["pk-spreadsheet-preview__cell", {
883
+ rowspan: se(e.row, t.col)?.rows,
884
+ colspan: se(e.row, t.col)?.cols,
885
+ class: N(["pk-spreadsheet-preview__cell", {
936
886
  "pk-spreadsheet-preview__cell--range": Z(e.row, t.col) && !ke(e.row, t.col),
937
- "pk-spreadsheet-preview__cell--missing": U(e.row, t.col)?.missing,
938
- "pk-spreadsheet-preview__cell--marked": g(e.row, t.col)
887
+ "pk-spreadsheet-preview__cell--missing": V(e.row, t.col)?.missing,
888
+ "pk-spreadsheet-preview__cell--marked": h(e.row, t.col)
939
889
  }]),
940
- style: N(me(U(e.row, t.col), e.row, t.col)),
890
+ style: P(me(V(e.row, t.col), e.row, t.col)),
941
891
  "data-focus": ke(e.row, t.col) ? "" : void 0,
942
892
  "data-cell": `${e.row}:${t.col}`,
943
- title: U(e.row, t.col)?.missing ? z(a)("chatFilePreview.missingValue") : void 0,
944
- onMousedown: se((n) => Me(e.row, t.col, n), ["prevent"]),
945
- onMouseenter: (n) => Ne(e.row, t.col),
946
- onDblclick: Re
947
- }, R(fe(U(e.row, t.col))), 47, qe))], 64))), 128))], 4));
893
+ title: V(e.row, t.col)?.missing ? z(a)("chatFilePreview.missingValue") : void 0,
894
+ onMousedown: W((n) => Ne(e.row, t.col, n), ["prevent"]),
895
+ onMouseenter: (n) => ct(e.row, t.col),
896
+ onDblclick: ft
897
+ }, R(fe(V(e.row, t.col))), 47, He))], 64))), 128))], 4));
948
898
  return s.memo = i, s;
949
899
  }, r, 0), 128))])
950
- ], 6)) : S("", !0),
951
- re.value.length ? (F(), C("div", Je, [(F(!0), C(y, null, L(re.value, (e) => (F(), C("div", {
900
+ ], 6)) : w("", !0),
901
+ M.value.length ? (F(), T("div", Ue, [(F(!0), T(x, null, L(M.value, (e) => (F(), T("div", {
952
902
  key: e.key,
953
903
  class: "pk-spreadsheet-preview__chart",
954
- style: N(e.css)
955
- }, [E(Le, { preview: e.chart }, null, 8, ["preview"])], 4))), 128))])) : S("", !0),
956
- f.value && (f.value.moreRows || f.value.moreColumns) ? (F(), C("p", Ye, [f.value.moreRows ? (F(), C(y, { key: 0 }, [T(R(z(a)("chatFilePreview.moreRows", f.value.moreRows)), 1)], 64)) : S("", !0), f.value.moreColumns ? (F(), C(y, { key: 1 }, [T(R(z(a)("chatFilePreview.moreColumns", f.value.moreColumns)), 1)], 64)) : S("", !0)])) : S("", !0)
957
- ], 40, Ke),
958
- w("nav", {
904
+ style: P(e.css)
905
+ }, [O(Me, { preview: e.chart }, null, 8, ["preview"])], 4))), 128))])) : w("", !0),
906
+ f.value && (f.value.moreRows || f.value.moreColumns) ? (F(), T("p", We, [f.value.moreRows ? (F(), T(x, { key: 0 }, [D(R(z(a)("chatFilePreview.moreRows", f.value.moreRows)), 1)], 64)) : w("", !0), f.value.moreColumns ? (F(), T(x, { key: 1 }, [D(R(z(a)("chatFilePreview.moreColumns", f.value.moreColumns)), 1)], 64)) : w("", !0)])) : w("", !0)
907
+ ], 40, Ve),
908
+ E("nav", {
959
909
  class: "pk-spreadsheet-preview__sheets",
960
910
  "aria-label": z(a)("chatFilePreview.sheets")
961
- }, [(F(!0), C(y, null, L(e.preview.sheets, (e, t) => (F(), C("button", {
911
+ }, [(F(!0), T(x, null, L(e.preview.sheets, (e, t) => (F(), T("button", {
962
912
  key: e.name,
963
913
  type: "button",
964
914
  class: "pk-spreadsheet-preview__sheet",
965
915
  "aria-current": t === s.value ? "page" : void 0,
966
916
  onClick: (e) => s.value = t
967
- }, R(e.name), 9, Ze))), 128))], 8, Xe),
968
- w("div", Qe, [w("p", $e, [e.preview.staleFormulas ? (F(), C("span", {
917
+ }, R(e.name), 9, Ke))), 128))], 8, Ge),
918
+ E("div", qe, [E("p", Je, [e.preview.staleFormulas ? (F(), T("span", {
969
919
  key: 0,
970
920
  class: "pk-spreadsheet-preview__note",
971
921
  title: z(a)("chatFilePreview.staleFormulas")
972
- }, R(z(a)("chatFilePreview.staleFormulas")), 9, et)) : e.preview.computedFormulas ? (F(), C("span", {
922
+ }, R(z(a)("chatFilePreview.staleFormulas")), 9, Ye)) : e.preview.computedFormulas ? (F(), T("span", {
973
923
  key: 1,
974
924
  class: "pk-spreadsheet-preview__note",
975
925
  title: z(a)("chatFilePreview.computedFormulas")
976
- }, R(z(a)("chatFilePreview.computedFormulas")), 9, tt)) : S("", !0), St.value ? (F(), C("span", nt, [
977
- St.value.average ? (F(), C("span", rt, R(z(a)("chatFilePreview.average")) + " " + R(St.value.average), 1)) : S("", !0),
978
- w("span", null, R(z(a)("chatFilePreview.count")) + " " + R(St.value.count), 1),
979
- St.value.sum ? (F(), C("span", it, R(z(a)("chatFilePreview.sum")) + " " + R(St.value.sum), 1)) : S("", !0)
980
- ])) : S("", !0)]), w("div", at, [
981
- E(i, {
926
+ }, R(z(a)("chatFilePreview.computedFormulas")), 9, Xe)) : w("", !0), St.value ? (F(), T("span", Ze, [
927
+ St.value.average ? (F(), T("span", Qe, R(z(a)("chatFilePreview.average")) + " " + R(St.value.average), 1)) : w("", !0),
928
+ E("span", null, R(z(a)("chatFilePreview.count")) + " " + R(St.value.count), 1),
929
+ St.value.sum ? (F(), T("span", $e, R(z(a)("chatFilePreview.sum")) + " " + R(St.value.sum), 1)) : w("", !0)
930
+ ])) : w("", !0)]), E("div", et, [
931
+ O(i, {
982
932
  modifiers: "action-quiet",
983
933
  icon: "ri:subtract-line",
984
934
  "aria-label": z(a)("chatFilePreview.zoomOut"),
985
935
  disabled: c.value <= .5,
986
936
  onClick: r[4] ||= (e) => Ct(-.1)
987
937
  }, null, 8, ["aria-label", "disabled"]),
988
- w("span", ot, R(Math.round(c.value * 100)) + "% ", 1),
989
- E(i, {
938
+ E("span", tt, R(Math.round(c.value * 100)) + "% ", 1),
939
+ O(i, {
990
940
  modifiers: "action-quiet",
991
941
  icon: "ri:add-line",
992
942
  "aria-label": z(a)("chatFilePreview.zoomIn"),
@@ -997,11 +947,11 @@ var K = {
997
947
  ]);
998
948
  };
999
949
  }
1000
- }), pt = ["src"], mt = {
950
+ }), lt = ["src"], ut = {
1001
951
  key: 2,
1002
952
  class: "pk-word-preview__image",
1003
953
  "data-quote-skip": ""
1004
- }, ht = ["title"], gt = ["title"], _t = ["data-quote-skip"], vt = /* @__PURE__ */ O({
954
+ }, dt = ["title"], ft = ["title"], $ = ["data-quote-skip"], pt = /* @__PURE__ */ k({
1005
955
  __name: "PkWordPreviewRuns",
1006
956
  props: {
1007
957
  runs: {},
@@ -1010,16 +960,16 @@ var K = {
1010
960
  numbers: {}
1011
961
  },
1012
962
  setup(e) {
1013
- let t = e, { t: n } = ce({ useScope: "global" }), i = k(p, void 0), o = k(d, void 0), s = (e) => e.picture ? u(i?.value, e.picture.ref) : void 0, l = (e) => e.chart ? o?.value?.[e.chart.ref] : void 0, f = (e) => t.page ? c(e) : "inline", m = (e) => f(e) === "page" ? {
963
+ let t = e, { t: n } = le({ useScope: "global" }), r = A(h, void 0), i = A(p, void 0), o = (e) => e.picture ? f(r?.value, e.picture.ref) : void 0, c = (e) => e.chart ? i?.value?.[e.chart.ref] : void 0, l = (e) => t.page ? u(e) : "inline", d = (e) => l(e) === "page" ? {
1014
964
  ...e,
1015
965
  anchor: void 0
1016
- } : e, h = (e) => {
966
+ } : e, m = (e) => {
1017
967
  let n = {
1018
968
  width: `${e.width}pt`,
1019
969
  aspectRatio: `${e.width} / ${e.height}`
1020
970
  }, r = e.anchor, i = t.page;
1021
971
  if (!r || !i) return n;
1022
- let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = c(e);
972
+ let a = r.xFrom === "page" ? r.x - i.margins.left : r.x, o = u(e);
1023
973
  if (o === "around") {
1024
974
  let t = i.width - i.margins.left - i.margins.right, o = a + e.width / 2 < t / 2;
1025
975
  return {
@@ -1040,56 +990,56 @@ var K = {
1040
990
  top: `${r.y}pt`,
1041
991
  zIndex: r.wrap === "behind" ? -1 : 1
1042
992
  };
1043
- }, g = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, _ = b(() => {
1044
- let e = a(t.runs, t.mode ?? "markup"), n = (e) => {
1045
- let n = e.picture ?? (e.chart && m(e.chart));
1046
- return !!n && !!t.page && ["around", "block"].includes(c(n));
993
+ }, g = (e) => e.field && t.numbers ? String(t.numbers[e.field]) : e.text, _ = S(() => {
994
+ let e = s(t.runs, t.mode ?? "markup"), n = (e) => {
995
+ let n = e.picture ?? (e.chart && d(e.chart));
996
+ return !!n && !!t.page && ["around", "block"].includes(u(n));
1047
997
  };
1048
998
  return [...e.filter(n), ...e.filter((e) => !n(e))];
1049
- }), v = b(() => !t.mode || t.mode === "markup"), x = (e) => {
999
+ }), v = S(() => !t.mode || t.mode === "markup"), y = (e) => {
1050
1000
  let t = {};
1051
- e.font && (t.fontFamily = r(e.font)), t.fontSize = e.size ? `${e.size}pt` : "var(--pk-word-size)", e.color && (t.color = e.color), e.highlight && (t.backgroundColor = e.highlight), e.bold && (t.fontWeight = 700), e.italic && (t.fontStyle = "italic");
1001
+ e.font && (t.fontFamily = a(e.font)), t.fontSize = e.size ? `${e.size}pt` : "var(--pk-word-size)", e.color && (t.color = e.color), e.highlight && (t.backgroundColor = e.highlight), e.bold && (t.fontWeight = 700), e.italic && (t.fontStyle = "italic");
1052
1002
  let n = [e.underline ? "underline" : "", e.strike ? "line-through" : ""].filter(Boolean).join(" ");
1053
1003
  return n && (t.textDecoration = n), e.caps && (t.textTransform = "uppercase"), e.vertAlign && (t.verticalAlign = e.vertAlign, t.fontSize = `${(e.size ?? 11) * .65}pt`), t;
1054
- }, w = (e) => {
1055
- let t = x(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
1004
+ }, b = (e) => {
1005
+ let t = y(e), n = new Set(String(t.textDecoration ?? "").split(" ").filter(Boolean));
1056
1006
  return n.add(e.change === "deleted" ? "line-through" : "underline"), {
1057
1007
  ...t,
1058
1008
  textDecoration: [...n].join(" ")
1059
1009
  };
1060
- }, T = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
1061
- return (e, t) => (F(!0), C(y, null, L(_.value, (e, t) => (F(), C(y, { key: t }, [e.image ? (F(), C(y, { key: 0 }, [e.chart && l(e) ? (F(), C("span", {
1010
+ }, C = (e) => e.author ? n("chatFilePreview.revisionBy", { author: e.author }) : void 0;
1011
+ return (e, t) => (F(!0), T(x, null, L(_.value, (e, t) => (F(), T(x, { key: t }, [e.image ? (F(), T(x, { key: 0 }, [e.chart && c(e) ? (F(), T("span", {
1062
1012
  key: 0,
1063
- class: M(["pk-word-preview__chart", `pk-word-preview__chart--${f(m(e.chart))}`]),
1064
- style: N(h(m(e.chart)))
1065
- }, [E(Le, { preview: l(e) }, null, 8, ["preview"])], 6)) : e.picture && s(e) ? (F(), C(y, { key: 1 }, [f(e.picture) === "page" ? S("", !0) : (F(), C("img", {
1013
+ class: N(["pk-word-preview__chart", `pk-word-preview__chart--${l(d(e.chart))}`]),
1014
+ style: P(m(d(e.chart)))
1015
+ }, [O(Me, { preview: c(e) }, null, 8, ["preview"])], 6)) : e.picture && o(e) ? (F(), T(x, { key: 1 }, [l(e.picture) === "page" ? w("", !0) : (F(), T("img", {
1066
1016
  key: 0,
1067
- class: M(["pk-word-preview__picture", `pk-word-preview__picture--${f(e.picture)}`]),
1068
- style: N(h(e.picture)),
1069
- src: s(e),
1017
+ class: N(["pk-word-preview__picture", `pk-word-preview__picture--${l(e.picture)}`]),
1018
+ style: P(m(e.picture)),
1019
+ src: o(e),
1070
1020
  alt: ""
1071
- }, null, 14, pt))], 64)) : (F(), C("span", mt, R(z(n)("chatFilePreview.image")), 1))], 64)) : v.value && e.change === "deleted" ? (F(), C("del", {
1021
+ }, null, 14, lt))], 64)) : (F(), T("span", ut, R(z(n)("chatFilePreview.image")), 1))], 64)) : v.value && e.change === "deleted" ? (F(), T("del", {
1072
1022
  key: 1,
1073
1023
  class: "pk-word-preview__removed",
1074
1024
  "data-quote-skip": "",
1075
- style: N(w(e)),
1076
- title: T(e)
1077
- }, R(g(e)), 13, ht)) : v.value && e.change === "inserted" ? (F(), C("ins", {
1025
+ style: P(b(e)),
1026
+ title: C(e)
1027
+ }, R(g(e)), 13, dt)) : v.value && e.change === "inserted" ? (F(), T("ins", {
1078
1028
  key: 2,
1079
1029
  class: "pk-word-preview__added",
1080
- style: N(w(e)),
1081
- title: T(e)
1082
- }, R(g(e)), 13, gt)) : (F(), C("span", {
1030
+ style: P(b(e)),
1031
+ title: C(e)
1032
+ }, R(g(e)), 13, ft)) : (F(), T("span", {
1083
1033
  key: 3,
1084
- style: N(x(e)),
1034
+ style: P(y(e)),
1085
1035
  "data-quote-skip": e.label ? "" : void 0
1086
- }, R(g(e)), 13, _t))], 64))), 128));
1036
+ }, R(g(e)), 13, $))], 64))), 128));
1087
1037
  }
1088
- }), yt = { key: 0 }, bt = ["data-paragraph", "colspan"], xt = [
1038
+ }), mt = { key: 0 }, ht = ["data-paragraph", "colspan"], gt = [
1089
1039
  "data-paragraph",
1090
1040
  "role",
1091
1041
  "aria-level"
1092
- ], St = { key: 1 }, Ct = /* @__PURE__ */ O({
1042
+ ], _t = { key: 1 }, vt = /* @__PURE__ */ k({
1093
1043
  __name: "PkWordPreviewBlock",
1094
1044
  props: {
1095
1045
  block: {},
@@ -1100,7 +1050,7 @@ var K = {
1100
1050
  marked: {}
1101
1051
  },
1102
1052
  setup(e) {
1103
- let t = e, n = b(() => {
1053
+ let t = e, n = S(() => {
1104
1054
  if (t.block.kind === "table") return {};
1105
1055
  let e = t.block.style ?? {};
1106
1056
  return {
@@ -1114,36 +1064,36 @@ var K = {
1114
1064
  backgroundColor: e.shading,
1115
1065
  fontSize: e.size ? `${e.size}pt` : void 0
1116
1066
  };
1117
- }), r = b(() => {
1067
+ }), r = S(() => {
1118
1068
  if (t.block.kind === "table") return {};
1119
1069
  let e = -(t.block.style?.firstLine ?? 0);
1120
1070
  return e > 0 ? { minWidth: `calc(${e}pt * var(--pk-word-indent-scale, 1))` } : { paddingRight: "6pt" };
1121
- }), i = b(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), a = b(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), o = b(() => {
1071
+ }), i = S(() => t.mode === "markup" && t.block.kind !== "table" && t.block.runs.some((e) => e.change)), a = S(() => t.block.kind === "table" && t.row !== void 0 ? t.block.rows[t.row] : void 0), o = S(() => {
1122
1072
  if (t.block.kind !== "table") return [];
1123
1073
  let e = t.block.widths ?? [], n = e.reduce((e, t) => e + t, 0);
1124
1074
  return n ? e.map((e) => `${e / n * 100}%`) : [];
1125
- }), s = b(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), c = (e) => !!e?.some((e) => t.marked?.has(e)), l = b(() => t.mode === "markup" && !!a.value?.some((e) => e.runs.some((e) => e.change)));
1126
- return (t, u) => e.block.kind === "table" && a.value ? (F(), C("table", {
1075
+ }), s = S(() => t.block.kind !== "table" && !!t.block.id && !!t.marked?.has(t.block.id)), c = (e) => !!e?.some((e) => t.marked?.has(e)), l = S(() => t.mode === "markup" && !!a.value?.some((e) => e.runs.some((e) => e.change)));
1076
+ return (t, u) => e.block.kind === "table" && a.value ? (F(), T("table", {
1127
1077
  key: 0,
1128
- class: M(["pk-word-preview__table", {
1078
+ class: N(["pk-word-preview__table", {
1129
1079
  "pk-word-preview__table--lines": e.block.borders,
1130
1080
  "pk-word-preview__table--next": e.row !== 0,
1131
1081
  "pk-word-preview__changed": l.value
1132
1082
  }])
1133
- }, [o.value.length ? (F(), C("colgroup", yt, [(F(!0), C(y, null, L(o.value, (e, t) => (F(), C("col", {
1083
+ }, [o.value.length ? (F(), T("colgroup", mt, [(F(!0), T(x, null, L(o.value, (e, t) => (F(), T("col", {
1134
1084
  key: t,
1135
- style: N({ width: e })
1136
- }, null, 4))), 128))])) : S("", !0), w("tbody", null, [w("tr", null, [(F(!0), C(y, null, L(a.value, (t, n) => (F(), C("td", {
1085
+ style: P({ width: e })
1086
+ }, null, 4))), 128))])) : w("", !0), E("tbody", null, [E("tr", null, [(F(!0), T(x, null, L(a.value, (t, n) => (F(), T("td", {
1137
1087
  key: n,
1138
1088
  "data-paragraph": t.ids?.join(" "),
1139
- class: M({ "pk-word-preview__marked": c(t.ids) }),
1089
+ class: N({ "pk-word-preview__marked": c(t.ids) }),
1140
1090
  colspan: t.span,
1141
- style: N({
1091
+ style: P({
1142
1092
  backgroundColor: t.fill,
1143
1093
  textAlign: t.align,
1144
1094
  fontSize: t.size ? `${t.size}pt` : void 0
1145
1095
  })
1146
- }, [E(vt, {
1096
+ }, [O(pt, {
1147
1097
  runs: t.runs,
1148
1098
  mode: e.mode,
1149
1099
  numbers: e.numbers
@@ -1151,24 +1101,24 @@ var K = {
1151
1101
  "runs",
1152
1102
  "mode",
1153
1103
  "numbers"
1154
- ])], 14, bt))), 128))])])], 2)) : e.block.kind === "table" ? S("", !0) : (F(), C("div", {
1104
+ ])], 14, ht))), 128))])])], 2)) : e.block.kind === "table" ? w("", !0) : (F(), T("div", {
1155
1105
  key: 1,
1156
- class: M(["pk-word-preview__block", {
1106
+ class: N(["pk-word-preview__block", {
1157
1107
  "pk-word-preview__changed": i.value,
1158
1108
  "pk-word-preview__marked": s.value
1159
1109
  }]),
1160
1110
  "data-paragraph": e.block.id,
1161
1111
  role: e.block.kind === "heading" ? "heading" : void 0,
1162
1112
  "aria-level": e.block.kind === "heading" ? Math.max(1, e.block.level) : void 0,
1163
- style: N(n.value)
1113
+ style: P(n.value)
1164
1114
  }, [
1165
- e.block.label ? (F(), C("span", {
1115
+ e.block.label ? (F(), T("span", {
1166
1116
  key: 0,
1167
1117
  class: "pk-word-preview__label",
1168
1118
  "data-quote-skip": "",
1169
- style: N(r.value)
1170
- }, R(e.block.label), 5)) : S("", !0),
1171
- E(vt, {
1119
+ style: P(r.value)
1120
+ }, R(e.block.label), 5)) : w("", !0),
1121
+ O(pt, {
1172
1122
  runs: e.block.runs,
1173
1123
  mode: e.mode,
1174
1124
  page: e.page,
@@ -1179,10 +1129,10 @@ var K = {
1179
1129
  "page",
1180
1130
  "numbers"
1181
1131
  ]),
1182
- !e.block.label && !e.block.runs.length ? (F(), C("br", St)) : S("", !0)
1183
- ], 14, xt));
1132
+ !e.block.label && !e.block.runs.length ? (F(), T("br", _t)) : w("", !0)
1133
+ ], 14, gt));
1184
1134
  }
1185
- }), wt = { class: "pk-word-preview__part" }, Tt = ["src"], Et = /* @__PURE__ */ O({
1135
+ }), yt = { class: "pk-word-preview__part" }, bt = ["src"], xt = /* @__PURE__ */ k({
1186
1136
  __name: "PkWordPreviewPart",
1187
1137
  props: {
1188
1138
  blocks: {},
@@ -1192,13 +1142,13 @@ var K = {
1192
1142
  numbers: {}
1193
1143
  },
1194
1144
  setup(e) {
1195
- let t = e, n = k(p, void 0), r = b(() => s(t.blocks, t.mode)), a = b(() => l(t.blocks, t.mode).flatMap((e) => {
1196
- let r = u(n?.value, e.ref);
1145
+ let t = e, n = A(h, void 0), r = S(() => l(t.blocks, t.mode)), i = S(() => d(t.blocks, t.mode).flatMap((e) => {
1146
+ let r = f(n?.value, e.ref);
1197
1147
  return r ? [{
1198
1148
  src: r,
1199
- css: i(e, t.section.page)
1149
+ css: o(e, t.section.page)
1200
1150
  }] : [];
1201
- })), o = b(() => {
1151
+ })), a = S(() => {
1202
1152
  let { margins: e } = t.section.page;
1203
1153
  return {
1204
1154
  left: `${e.left}pt`,
@@ -1206,10 +1156,10 @@ var K = {
1206
1156
  ...t.where === "header" ? { top: `${t.section.headerDistance}pt` } : { bottom: `${t.section.footerDistance}pt` }
1207
1157
  };
1208
1158
  });
1209
- return (t, n) => (F(), C("div", wt, [w("div", {
1159
+ return (t, n) => (F(), T("div", yt, [E("div", {
1210
1160
  class: "pk-word-preview__part-flow",
1211
- style: N(o.value)
1212
- }, [(F(!0), C(y, null, L(r.value, (t) => (F(), x(Ct, {
1161
+ style: P(a.value)
1162
+ }, [(F(!0), T(x, null, L(r.value, (t) => (F(), C(vt, {
1213
1163
  key: t.key,
1214
1164
  block: e.blocks[t.block],
1215
1165
  row: t.row,
@@ -1222,47 +1172,47 @@ var K = {
1222
1172
  "mode",
1223
1173
  "page",
1224
1174
  "numbers"
1225
- ]))), 128))], 4), (F(!0), C(y, null, L(a.value, (e, t) => (F(), C("img", {
1175
+ ]))), 128))], 4), (F(!0), T(x, null, L(i.value, (e, t) => (F(), T("img", {
1226
1176
  key: t,
1227
1177
  class: "pk-word-preview__float",
1228
- style: N(e.css),
1178
+ style: P(e.css),
1229
1179
  src: e.src,
1230
1180
  alt: ""
1231
- }, null, 12, Tt))), 128))]));
1181
+ }, null, 12, bt))), 128))]));
1232
1182
  }
1233
- }), Dt = ["aria-label"], Ot = {
1183
+ }), St = ["aria-label"], Ct = {
1234
1184
  class: "pk-word-preview__tabs",
1235
1185
  role: "tablist"
1236
- }, kt = ["aria-selected"], At = ["aria-selected"], jt = {
1186
+ }, wt = ["aria-selected"], Tt = ["aria-selected"], Et = {
1237
1187
  key: 0,
1238
1188
  class: "pk-word-preview__list"
1239
- }, Mt = ["aria-current", "onClick"], Nt = { class: "pk-word-preview__entry-text" }, Pt = {
1189
+ }, Dt = ["aria-current", "onClick"], Ot = { class: "pk-word-preview__entry-text" }, kt = {
1240
1190
  key: 0,
1241
1191
  class: "u-dot"
1242
- }, Ft = {
1192
+ }, At = {
1243
1193
  key: 0,
1244
1194
  class: "pk-word-preview__none"
1245
- }, It = {
1195
+ }, jt = {
1246
1196
  key: 1,
1247
1197
  class: "pk-word-preview__list"
1248
- }, Lt = ["onClick"], Rt = {
1198
+ }, Mt = ["onClick"], Nt = {
1249
1199
  key: 0,
1250
1200
  class: "pk-word-preview__removed"
1251
- }, zt = {
1201
+ }, Pt = {
1252
1202
  key: 1,
1253
1203
  class: "pk-word-preview__added"
1254
- }, Bt = { class: "pk-word-preview__main" }, Vt = ["aria-label"], Ht = ["src"], Ut = {
1204
+ }, Ft = { class: "pk-word-preview__main" }, It = ["aria-label"], Lt = ["src"], Rt = {
1255
1205
  key: 2,
1256
1206
  class: "pk-word-preview__truncated"
1257
- }, Wt = { class: "pk-word-preview__status" }, Gt = {
1207
+ }, zt = { class: "pk-word-preview__status" }, Bt = {
1258
1208
  key: 0,
1259
1209
  class: "pk-word-preview__count"
1260
- }, Kt = { class: "pk-word-preview__count" }, qt = {
1210
+ }, Vt = { class: "pk-word-preview__count" }, Ht = {
1261
1211
  key: 1,
1262
1212
  class: "pk-word-preview__legend"
1263
- }, Jt = ["title"], Yt = { class: "pk-word-preview__removed" }, Xt = { class: "pk-word-preview__added" }, Zt = { class: "pk-word-preview__percent" }, Qt = ["data-part"], $t = 96 / 72, en = .5, tn = /* @__PURE__ */ O({
1213
+ }, Ut = ["title"], Wt = { class: "pk-word-preview__removed" }, Gt = { class: "pk-word-preview__added" }, Kt = { class: "pk-word-preview__percent" }, qt = ["data-part"], Jt = 96 / 72, Yt = .5, Xt = /* @__PURE__ */ k({
1264
1214
  __name: "PkWordPreview",
1265
- props: /*@__PURE__*/ j({
1215
+ props: /*@__PURE__*/ M({
1266
1216
  preview: {},
1267
1217
  mode: {},
1268
1218
  marked: {}
@@ -1275,28 +1225,28 @@ var K = {
1275
1225
  zoom: { default: 1 },
1276
1226
  zoomModifiers: {}
1277
1227
  }),
1278
- emits: /*@__PURE__*/ j(["select"], ["update:fit", "update:zoom"]),
1279
- setup(e, { emit: n }) {
1280
- let o = e, c = n, { t: h } = ce({ useScope: "global" });
1281
- re(p, b(() => o.preview.images)), re(d, b(() => o.preview.charts));
1282
- let g = (e) => a(e, o.mode), _ = b(() => s(o.preview.blocks, o.mode)), v = ae("rootEl"), T = ae("scrollEl"), D = ae("measureEl"), { width: O } = le(v), { width: k } = le(T), A = b(() => O.value >= 1e3), j = b(() => o.preview.sections?.length ? o.preview.sections : [{
1283
- page: o.preview.page,
1228
+ emits: /*@__PURE__*/ M(["select"], ["update:fit", "update:zoom"]),
1229
+ setup(e, { emit: r }) {
1230
+ let i = e, c = r, { t: u } = le({ useScope: "global" });
1231
+ ie(h, S(() => i.preview.images)), ie(p, S(() => i.preview.charts));
1232
+ let _ = (e) => s(e, i.mode), v = S(() => l(i.preview.blocks, i.mode)), y = oe("rootEl"), b = oe("scrollEl"), D = oe("measureEl"), { width: ee } = ue(y), { width: k } = ue(b), A = S(() => ee.value >= 1e3), j = S(() => i.preview.sections?.length ? i.preview.sections : [{
1233
+ page: i.preview.page,
1284
1234
  headerDistance: 0,
1285
1235
  footerDistance: 0,
1286
1236
  headers: {},
1287
1237
  footers: {}
1288
- }]), P = b(() => j.value[0].page), ie = b(() => (k.value - 48) / (P.value.width * $t)), V = b(() => O.value === 0 || k.value === 0 || ie.value >= en), U = b(() => ({
1289
- fontFamily: r(o.preview.defaults.font),
1290
- fontSize: `${o.preview.defaults.size}pt`,
1291
- color: o.preview.defaults.color ?? "#000000",
1292
- "--pk-word-line": f(o.preview.defaults.font),
1293
- "--pk-word-size": `${o.preview.defaults.size}pt`
1294
- })), oe = b(() => P.value.width - P.value.margins.left - P.value.margins.right), W = b(() => ({
1295
- ...U.value,
1296
- width: `${oe.value}pt`
1297
- })), se = ae("flowEl"), { width: ue } = le(se), de = b(() => {
1238
+ }]), M = S(() => j.value[0].page), ae = S(() => (k.value - 48) / (M.value.width * Jt)), V = S(() => ee.value === 0 || k.value === 0 || ae.value >= Yt), se = S(() => ({
1239
+ fontFamily: a(i.preview.defaults.font),
1240
+ fontSize: `${i.preview.defaults.size}pt`,
1241
+ color: i.preview.defaults.color ?? "#000000",
1242
+ "--pk-word-line": m(i.preview.defaults.font),
1243
+ "--pk-word-size": `${i.preview.defaults.size}pt`
1244
+ })), U = S(() => M.value.width - M.value.margins.left - M.value.margins.right), ce = S(() => ({
1245
+ ...se.value,
1246
+ width: `${U.value}pt`
1247
+ })), W = oe("flowEl"), { width: de } = ue(W), fe = S(() => {
1298
1248
  let e = /* @__PURE__ */ new Map(), t = 0;
1299
- for (let n of o.preview.blocks) {
1249
+ for (let n of i.preview.blocks) {
1300
1250
  if (n.kind === "table") continue;
1301
1251
  let r = n.runs.reduce((e, t) => e + t.text.trim().length, 0);
1302
1252
  if (r) {
@@ -1307,62 +1257,62 @@ var K = {
1307
1257
  let n = 0;
1308
1258
  for (let [r, i] of [...e].sort((e, t) => e[0] - t[0])) if (n += i, n > t / 10) return r;
1309
1259
  return 0;
1310
- }), fe = b(() => ({
1311
- ...U.value,
1312
- "--pk-word-indent-shared": `${de.value}pt`,
1313
- "--pk-word-indent-scale": ue.value ? Math.min(1, ue.value / (oe.value * $t)) : 1
1314
- })), G = I([]), pe = I({}), me = async () => {
1315
- await ee();
1260
+ }), pe = S(() => ({
1261
+ ...se.value,
1262
+ "--pk-word-indent-shared": `${fe.value}pt`,
1263
+ "--pk-word-indent-scale": de.value ? Math.min(1, de.value / (U.value * Jt)) : 1
1264
+ })), G = I([]), me = I({}), he = async () => {
1265
+ await te();
1316
1266
  let e = D.value?.querySelectorAll("[data-item]");
1317
1267
  G.value = [...e ?? []].map((e) => e.getBoundingClientRect().height);
1318
1268
  let t = D.value?.querySelectorAll("[data-part]");
1319
- pe.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
1269
+ me.value = Object.fromEntries([...t ?? []].map((e) => [e.dataset.part ?? "", e.getBoundingClientRect().height]));
1320
1270
  };
1321
1271
  H([
1322
- _,
1272
+ v,
1323
1273
  V,
1324
- () => o.preview.parts
1325
- ], me, { flush: "post" }), ne(() => {
1326
- me(), document.fonts?.ready.then(me);
1274
+ () => i.preview.parts
1275
+ ], he, { flush: "post" }), re(() => {
1276
+ he(), document.fonts?.ready.then(he);
1327
1277
  });
1328
- let K = b(() => {
1329
- if (!V.value || G.value.length !== _.value.length) return [{
1330
- items: _.value.map((e, t) => t),
1278
+ let K = S(() => {
1279
+ if (!V.value || G.value.length !== v.value.length) return [{
1280
+ items: v.value.map((e, t) => t),
1331
1281
  section: 0,
1332
1282
  number: 1,
1333
- top: P.value.margins.top,
1334
- bottom: P.value.margins.bottom
1283
+ top: M.value.margins.top,
1284
+ bottom: M.value.margins.bottom
1335
1285
  }];
1336
- let e = [], t = 0, n = !0, r = 0, i, a = () => {
1286
+ let e = [], t = 0, n = !0, r = 0, a, o = () => {
1337
1287
  let r = j.value[t];
1338
- return n && r.pageStart !== void 0 ? r.pageStart : (i ?? e[e.length - 1]?.number ?? 0) + 1;
1288
+ return n && r.pageStart !== void 0 ? r.pageStart : (a ?? e[e.length - 1]?.number ?? 0) + 1;
1339
1289
  }, s = (e) => {
1340
- let r = j.value[t], i = (t) => n && r.titlePage ? t.first : o.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, a = i(r.headers), s = i(r.footers), c = (e) => e ? (pe.value[e] ?? 0) / $t : 0;
1290
+ let r = j.value[t], a = (t) => n && r.titlePage ? t.first : i.preview.evenAndOddHeaders && e % 2 == 0 ? t.even : t.default, o = a(r.headers), s = a(r.footers), c = (e) => e ? (me.value[e] ?? 0) / Jt : 0;
1341
1291
  return {
1342
- header: a,
1292
+ header: o,
1343
1293
  footer: s,
1344
- top: Math.max(r.page.margins.top, a ? r.headerDistance + c(a) : 0),
1294
+ top: Math.max(r.page.margins.top, o ? r.headerDistance + c(o) : 0),
1345
1295
  bottom: Math.max(r.page.margins.bottom, s ? r.footerDistance + c(s) : 0)
1346
1296
  };
1347
1297
  }, c = () => {
1348
- let o = a();
1349
- i = void 0, e.push({
1298
+ let i = o();
1299
+ a = void 0, e.push({
1350
1300
  items: [],
1351
1301
  section: t,
1352
- number: o,
1353
- ...s(o)
1302
+ number: i,
1303
+ ...s(i)
1354
1304
  }), n = !1, r = 0;
1355
1305
  };
1356
- return _.value.forEach((o, l) => {
1357
- o.section !== void 0 && o.section !== t && j.value[o.section] && (t = o.section, n = o.breakBefore || !e.length, n || (i = j.value[t].pageStart));
1358
- let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * $t : 0, p = G.value[l];
1359
- for (let e = l; _.value[e]?.keepNext && e + 1 < _.value.length && !_.value[e + 1].breakBefore; e++) p += G.value[e + 1];
1360
- (!u || u.items.length && (o.breakBefore || r + G.value[l] > f || r + p > f && p <= (() => {
1361
- let e = s(a());
1362
- return (j.value[t].page.height - e.top - e.bottom) * $t;
1306
+ return v.value.forEach((i, l) => {
1307
+ i.section !== void 0 && i.section !== t && j.value[i.section] && (t = i.section, n = i.breakBefore || !e.length, n || (a = j.value[t].pageStart));
1308
+ let u = e[e.length - 1], d = u && j.value[u.section].page, f = d ? (d.height - u.top - u.bottom) * Jt : 0, p = G.value[l];
1309
+ for (let e = l; v.value[e]?.keepNext && e + 1 < v.value.length && !v.value[e + 1].breakBefore; e++) p += G.value[e + 1];
1310
+ (!u || u.items.length && (i.breakBefore || r + G.value[l] > f || r + p > f && p <= (() => {
1311
+ let e = s(o());
1312
+ return (j.value[t].page.height - e.top - e.bottom) * Jt;
1363
1313
  })())) && c(), e[e.length - 1].items.push(l), r += G.value[l];
1364
1314
  }), e.length || c(), e;
1365
- }), q = b(() => {
1315
+ }), ge = S(() => {
1366
1316
  let e = /* @__PURE__ */ new Map();
1367
1317
  for (let t of K.value) e.set(t.section, (e.get(t.section) ?? 0) + 1);
1368
1318
  return K.value.map((t) => ({
@@ -1370,160 +1320,160 @@ var K = {
1370
1320
  pages: K.value.length,
1371
1321
  sectionPages: e.get(t.section) ?? 1
1372
1322
  }));
1373
- }), ge = (e) => {
1323
+ }), _e = (e) => {
1374
1324
  let t = j.value[e.section].page;
1375
1325
  return {
1376
- ...U.value,
1326
+ ...se.value,
1377
1327
  width: `${t.width}pt`,
1378
1328
  minHeight: `${t.height}pt`,
1379
1329
  padding: `${e.top}pt ${t.margins.right}pt ${e.bottom}pt ${t.margins.left}pt`
1380
1330
  };
1381
- }, _e = (e) => {
1382
- let t = [...new Set(e.items.map((e) => _.value[e].block))];
1383
- return l(t.map((e) => o.preview.blocks[e]), o.mode).flatMap((t) => {
1384
- let n = u(o.preview.images, t.ref);
1331
+ }, q = (e) => {
1332
+ let t = [...new Set(e.items.map((e) => v.value[e].block))];
1333
+ return d(t.map((e) => i.preview.blocks[e]), i.mode).flatMap((t) => {
1334
+ let n = f(i.preview.images, t.ref);
1385
1335
  return n ? [{
1386
1336
  src: n,
1387
- css: i(t, j.value[e.section].page)
1337
+ css: o(t, j.value[e.section].page)
1388
1338
  }] : [];
1389
1339
  });
1390
- }, ve = B(e, "fit"), ye = B(e, "zoom"), be = b(() => ve.value ? Math.min(1.25, Math.max(.3, ie.value)) : ye.value), xe = (e) => {
1340
+ }, ve = B(e, "fit"), ye = B(e, "zoom"), be = S(() => ve.value ? Math.min(1.25, Math.max(.3, ae.value)) : ye.value), xe = (e) => {
1391
1341
  ye.value = Math.min(2, Math.max(.3, Math.round((be.value + e) * 10) / 10)), ve.value = !1;
1392
- }, Se = I(0), Ce = I(), we = () => {
1393
- let e = T.value?.getBoundingClientRect();
1342
+ }, Se = I(0), Ce = I(), Te = () => {
1343
+ let e = b.value?.getBoundingClientRect();
1394
1344
  if (!e) return;
1395
- let t = T.value?.querySelectorAll("[data-page]") ?? [], n = 0;
1345
+ let t = b.value?.querySelectorAll("[data-page]") ?? [], n = 0;
1396
1346
  for (let [r, i] of [...t].entries()) {
1397
1347
  if (i.getBoundingClientRect().top - e.top > e.height / 3) break;
1398
1348
  n = r;
1399
1349
  }
1400
1350
  Se.value = n;
1401
1351
  let r;
1402
- for (let t of X.value) {
1403
- let n = T.value?.querySelector(`[data-key="${t.key}"]`);
1352
+ for (let t of Y.value) {
1353
+ let n = b.value?.querySelector(`[data-key="${t.key}"]`);
1404
1354
  if (n) {
1405
1355
  if (n.getBoundingClientRect().top - e.top > 48) break;
1406
1356
  r = t.key;
1407
1357
  }
1408
1358
  }
1409
- Ce.value = r ?? X.value[0]?.key;
1410
- }, Te = 0, Ee = () => {
1411
- Te ||= requestAnimationFrame(() => {
1412
- Te = 0, we();
1359
+ Ce.value = r ?? Y.value[0]?.key;
1360
+ }, Ee = 0, De = () => {
1361
+ Ee ||= requestAnimationFrame(() => {
1362
+ Ee = 0, Te();
1413
1363
  });
1414
1364
  };
1415
- te(() => cancelAnimationFrame(Te)), H(K, () => ee(Ee));
1416
- let { selection: De } = he({
1417
- root: () => T.value?.getRootNode(),
1365
+ ne(() => cancelAnimationFrame(Ee)), H(K, () => te(De));
1366
+ let { selection: Oe } = n({
1367
+ root: () => b.value?.getRootNode(),
1418
1368
  touch: !0
1419
1369
  });
1420
- H(De, (e) => {
1421
- let t = T.value;
1422
- c("select", e && t ? Y(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
1370
+ H(Oe, (e) => {
1371
+ let t = b.value;
1372
+ c("select", e && t ? we(t, e.range, ".pk-word-preview__measure, .pk-word-preview__part") : void 0);
1423
1373
  });
1424
- let J = (e) => g(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), X = b(() => _.value.flatMap((e) => {
1425
- let t = o.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, J(t.runs)].filter(Boolean).join(" ") : "";
1374
+ let J = (e) => _(e).map((e) => e.text).join("").replace(/\s+/g, " ").trim(), Y = S(() => v.value.flatMap((e) => {
1375
+ let t = i.preview.blocks[e.block], n = t.kind === "heading" ? [t.label, J(t.runs)].filter(Boolean).join(" ") : "";
1426
1376
  return t.kind === "heading" && t.level <= 3 && n ? [{
1427
1377
  key: e.key,
1428
1378
  level: t.level,
1429
1379
  text: n
1430
1380
  }] : [];
1431
- })), Oe = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, Z = b(() => _.value.flatMap((e) => {
1432
- let t = o.preview.blocks[e.block], n = t.kind === "table" ? (t.rows[e.row ?? 0] ?? []).flatMap((e) => e.runs) : t.runs, r = n.filter((e) => e.change === "deleted").map((e) => e.text).join(" ").trim(), i = n.filter((e) => e.change === "inserted").map((e) => e.text).join(" ").trim();
1433
- return r || i ? [{
1381
+ })), X = (e) => e.length > 60 ? `${e.slice(0, 60)}…` : e, Z = S(() => v.value.flatMap((e) => {
1382
+ let t = i.preview.blocks[e.block], n = t.kind === "table" ? (t.rows[e.row ?? 0] ?? []).flatMap((e) => e.runs) : t.runs, r = n.filter((e) => e.change === "deleted").map((e) => e.text).join(" ").trim(), a = n.filter((e) => e.change === "inserted").map((e) => e.text).join(" ").trim();
1383
+ return r || a ? [{
1434
1384
  key: e.key,
1435
- removed: Oe(r),
1436
- added: Oe(i)
1385
+ removed: X(r),
1386
+ added: X(a)
1437
1387
  }] : [];
1438
1388
  })), ke;
1439
- H([() => o.marked, K], ([e]) => {
1440
- !e || e === ke || V.value && G.value.length !== _.value.length || m(T.value, ".pk-word-preview__marked") && (ke = e);
1389
+ H([() => i.marked, K], ([e]) => {
1390
+ !e || e === ke || V.value && G.value.length !== v.value.length || g(b.value, ".pk-word-preview__marked") && (ke = e);
1441
1391
  }, {
1442
1392
  flush: "post",
1443
1393
  immediate: !0
1444
1394
  });
1445
1395
  let Ae = I("outline"), je = I(!1), Q = (e) => {
1446
- T.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
1396
+ b.value?.querySelector(`[data-key="${e}"]`)?.scrollIntoView({
1447
1397
  block: "start",
1448
1398
  behavior: "smooth"
1449
1399
  }), A.value || (je.value = !1);
1450
- }, Me = b(() => o.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => J(e.runs)) : [J(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Ne = b(() => o.preview.revisionAuthors.join(", "));
1400
+ }, Me = S(() => i.preview.blocks.flatMap((e) => e.kind === "table" ? e.rows.flat().map((e) => J(e.runs)) : [J(e.runs)]).join(" ").split(/\s+/).filter(Boolean).length), Ne = S(() => i.preview.revisionAuthors.join(", "));
1451
1401
  return (n, r) => {
1452
1402
  let i = t;
1453
- return F(), C("div", {
1403
+ return F(), T("div", {
1454
1404
  ref_key: "rootEl",
1455
- ref: v,
1456
- class: M(["pk-word-preview", { "pk-word-preview--paged": V.value }])
1405
+ ref: y,
1406
+ class: N(["pk-word-preview", { "pk-word-preview--paged": V.value }])
1457
1407
  }, [
1458
- (A.value || je.value) && (X.value.length || Z.value.length) ? (F(), C("aside", {
1408
+ (A.value || je.value) && (Y.value.length || Z.value.length) ? (F(), T("aside", {
1459
1409
  key: 0,
1460
- class: M(["pk-word-preview__side", { "pk-word-preview__side--over": !A.value }]),
1461
- "aria-label": z(h)("chatFilePreview.outline")
1462
- }, [w("div", Ot, [w("button", {
1410
+ class: N(["pk-word-preview__side", { "pk-word-preview__side--over": !A.value }]),
1411
+ "aria-label": z(u)("chatFilePreview.outline")
1412
+ }, [E("div", Ct, [E("button", {
1463
1413
  type: "button",
1464
1414
  role: "tab",
1465
1415
  class: "pk-word-preview__tab",
1466
1416
  "aria-selected": Ae.value === "outline",
1467
1417
  onClick: r[0] ||= (e) => Ae.value = "outline"
1468
- }, R(z(h)("chatFilePreview.outline")), 9, kt), Z.value.length ? (F(), C("button", {
1418
+ }, R(z(u)("chatFilePreview.outline")), 9, wt), Z.value.length ? (F(), T("button", {
1469
1419
  key: 0,
1470
1420
  type: "button",
1471
1421
  role: "tab",
1472
1422
  class: "pk-word-preview__tab",
1473
1423
  "aria-selected": Ae.value === "changes",
1474
1424
  onClick: r[1] ||= (e) => Ae.value = "changes"
1475
- }, R(z(h)("chatFilePreview.changes", { count: Z.value.length })), 9, At)) : S("", !0)]), Ae.value === "outline" || !Z.value.length ? (F(), C("nav", jt, [(F(!0), C(y, null, L(X.value, (e) => (F(), C("button", {
1425
+ }, R(z(u)("chatFilePreview.changes", { count: Z.value.length })), 9, Tt)) : w("", !0)]), Ae.value === "outline" || !Z.value.length ? (F(), T("nav", Et, [(F(!0), T(x, null, L(Y.value, (e) => (F(), T("button", {
1476
1426
  key: e.key,
1477
1427
  type: "button",
1478
- class: M(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
1428
+ class: N(["pk-word-preview__entry", `pk-word-preview__entry--${Math.min(e.level, 3)}`]),
1479
1429
  "aria-current": Ce.value === e.key ? "location" : void 0,
1480
1430
  onClick: (t) => Q(e.key)
1481
- }, [w("span", Nt, R(e.text), 1), Z.value.some((t) => t.key === e.key) ? (F(), C("span", Pt)) : S("", !0)], 10, Mt))), 128)), X.value.length ? S("", !0) : (F(), C("p", Ft, R(z(h)("chatFilePreview.noHeadings")), 1))])) : (F(), C("nav", It, [(F(!0), C(y, null, L(Z.value, (e) => (F(), C("button", {
1431
+ }, [E("span", Ot, R(e.text), 1), Z.value.some((t) => t.key === e.key) ? (F(), T("span", kt)) : w("", !0)], 10, Dt))), 128)), Y.value.length ? w("", !0) : (F(), T("p", At, R(z(u)("chatFilePreview.noHeadings")), 1))])) : (F(), T("nav", jt, [(F(!0), T(x, null, L(Z.value, (e) => (F(), T("button", {
1482
1432
  key: e.key,
1483
1433
  type: "button",
1484
1434
  class: "pk-word-preview__entry pk-word-preview__entry--change",
1485
1435
  onClick: (t) => Q(e.key)
1486
- }, [e.removed ? (F(), C("del", Rt, R(e.removed), 1)) : S("", !0), e.added ? (F(), C("ins", zt, R(e.added), 1)) : S("", !0)], 8, Lt))), 128))]))], 10, Dt)) : S("", !0),
1487
- w("div", Bt, [w("div", {
1436
+ }, [e.removed ? (F(), T("del", Nt, R(e.removed), 1)) : w("", !0), e.added ? (F(), T("ins", Pt, R(e.added), 1)) : w("", !0)], 8, Mt))), 128))]))], 10, St)) : w("", !0),
1437
+ E("div", Ft, [E("div", {
1488
1438
  ref_key: "scrollEl",
1489
- ref: T,
1439
+ ref: b,
1490
1440
  class: "pk-word-preview__scroll",
1491
- onScroll: Ee
1492
- }, [V.value ? (F(), C("div", {
1441
+ onScroll: De
1442
+ }, [V.value ? (F(), T("div", {
1493
1443
  key: 0,
1494
1444
  class: "pk-word-preview__pages",
1495
- style: N({ zoom: be.value })
1496
- }, [(F(!0), C(y, null, L(K.value, (t, n) => (F(), C("article", {
1445
+ style: P({ zoom: be.value })
1446
+ }, [(F(!0), T(x, null, L(K.value, (t, n) => (F(), T("article", {
1497
1447
  key: n,
1498
1448
  "data-page": "",
1499
1449
  class: "pk-word-preview__page",
1500
- "aria-label": z(h)("chatFilePreview.pageOf", {
1450
+ "aria-label": z(u)("chatFilePreview.pageOf", {
1501
1451
  page: n + 1,
1502
1452
  count: K.value.length
1503
1453
  }),
1504
- style: N(ge(t))
1454
+ style: P(_e(t))
1505
1455
  }, [
1506
- t.header && e.preview.parts?.[t.header] ? (F(), x(Et, {
1456
+ t.header && e.preview.parts?.[t.header] ? (F(), C(xt, {
1507
1457
  key: 0,
1508
1458
  blocks: e.preview.parts[t.header],
1509
1459
  where: "header",
1510
1460
  section: j.value[t.section],
1511
1461
  mode: e.mode,
1512
- numbers: q.value[n]
1462
+ numbers: ge.value[n]
1513
1463
  }, null, 8, [
1514
1464
  "blocks",
1515
1465
  "section",
1516
1466
  "mode",
1517
1467
  "numbers"
1518
- ])) : S("", !0),
1519
- (F(!0), C(y, null, L(t.items, (r) => (F(), x(Ct, {
1520
- key: _.value[r].key,
1521
- "data-key": _.value[r].key,
1522
- block: e.preview.blocks[_.value[r].block],
1523
- row: _.value[r].row,
1468
+ ])) : w("", !0),
1469
+ (F(!0), T(x, null, L(t.items, (r) => (F(), C(vt, {
1470
+ key: v.value[r].key,
1471
+ "data-key": v.value[r].key,
1472
+ block: e.preview.blocks[v.value[r].block],
1473
+ row: v.value[r].row,
1524
1474
  mode: e.mode,
1525
1475
  page: j.value[t.section].page,
1526
- numbers: q.value[n],
1476
+ numbers: ge.value[n],
1527
1477
  marked: e.marked
1528
1478
  }, null, 8, [
1529
1479
  "data-key",
@@ -1534,33 +1484,33 @@ var K = {
1534
1484
  "numbers",
1535
1485
  "marked"
1536
1486
  ]))), 128)),
1537
- (F(!0), C(y, null, L(_e(t), (e, t) => (F(), C("img", {
1487
+ (F(!0), T(x, null, L(q(t), (e, t) => (F(), T("img", {
1538
1488
  key: `image-${t}`,
1539
1489
  class: "pk-word-preview__float",
1540
- style: N(e.css),
1490
+ style: P(e.css),
1541
1491
  src: e.src,
1542
1492
  alt: ""
1543
- }, null, 12, Ht))), 128)),
1544
- t.footer && e.preview.parts?.[t.footer] ? (F(), x(Et, {
1493
+ }, null, 12, Lt))), 128)),
1494
+ t.footer && e.preview.parts?.[t.footer] ? (F(), C(xt, {
1545
1495
  key: 1,
1546
1496
  blocks: e.preview.parts[t.footer],
1547
1497
  where: "footer",
1548
1498
  section: j.value[t.section],
1549
1499
  mode: e.mode,
1550
- numbers: q.value[n]
1500
+ numbers: ge.value[n]
1551
1501
  }, null, 8, [
1552
1502
  "blocks",
1553
1503
  "section",
1554
1504
  "mode",
1555
1505
  "numbers"
1556
- ])) : S("", !0)
1557
- ], 12, Vt))), 128))], 4)) : (F(), C("article", {
1506
+ ])) : w("", !0)
1507
+ ], 12, It))), 128))], 4)) : (F(), T("article", {
1558
1508
  key: 1,
1559
1509
  ref_key: "flowEl",
1560
- ref: se,
1510
+ ref: W,
1561
1511
  class: "pk-word-preview__page pk-word-preview__page--flow",
1562
- style: N(fe.value)
1563
- }, [(F(!0), C(y, null, L(_.value, (t) => (F(), x(Ct, {
1512
+ style: P(pe.value)
1513
+ }, [(F(!0), T(x, null, L(v.value, (t) => (F(), C(vt, {
1564
1514
  key: t.key,
1565
1515
  "data-key": t.key,
1566
1516
  block: e.preview.blocks[t.block],
@@ -1573,29 +1523,29 @@ var K = {
1573
1523
  "row",
1574
1524
  "mode",
1575
1525
  "marked"
1576
- ]))), 128))], 4)), e.preview.truncated ? (F(), C("p", Ut, R(z(h)("chatFilePreview.truncated")), 1)) : S("", !0)], 544), w("div", Wt, [
1577
- V.value ? (F(), C("span", Gt, R(z(h)("chatFilePreview.pageOf", {
1526
+ ]))), 128))], 4)), e.preview.truncated ? (F(), T("p", Rt, R(z(u)("chatFilePreview.truncated")), 1)) : w("", !0)], 544), E("div", zt, [
1527
+ V.value ? (F(), T("span", Bt, R(z(u)("chatFilePreview.pageOf", {
1578
1528
  page: Se.value + 1,
1579
1529
  count: K.value.length
1580
- })), 1)) : S("", !0),
1581
- w("span", Kt, R(z(h)("chatFilePreview.words", Me.value)), 1),
1582
- e.mode === "markup" && e.preview.revisionAuthors.length ? (F(), C("span", qt, [
1583
- w("span", {
1530
+ })), 1)) : w("", !0),
1531
+ E("span", Vt, R(z(u)("chatFilePreview.words", Me.value)), 1),
1532
+ e.mode === "markup" && e.preview.revisionAuthors.length ? (F(), T("span", Ht, [
1533
+ E("span", {
1584
1534
  class: "pk-word-preview__legend-text",
1585
- title: z(h)("chatFilePreview.revisionsOf", { authors: Ne.value })
1586
- }, R(z(h)("chatFilePreview.revisionsOf", { authors: Ne.value })), 9, Jt),
1587
- w("del", Yt, R(z(h)("chatFilePreview.removed")), 1),
1588
- w("ins", Xt, R(z(h)("chatFilePreview.added")), 1)
1589
- ])) : S("", !0),
1590
- r[6] ||= w("span", { class: "pk-word-preview__spacer" }, null, -1),
1591
- !A.value && (X.value.length || Z.value.length) ? (F(), x(i, {
1535
+ title: z(u)("chatFilePreview.revisionsOf", { authors: Ne.value })
1536
+ }, R(z(u)("chatFilePreview.revisionsOf", { authors: Ne.value })), 9, Ut),
1537
+ E("del", Wt, R(z(u)("chatFilePreview.removed")), 1),
1538
+ E("ins", Gt, R(z(u)("chatFilePreview.added")), 1)
1539
+ ])) : w("", !0),
1540
+ r[6] ||= E("span", { class: "pk-word-preview__spacer" }, null, -1),
1541
+ !A.value && (Y.value.length || Z.value.length) ? (F(), C(i, {
1592
1542
  key: 2,
1593
1543
  class: "pk-word-preview__outline-toggle",
1594
1544
  modifiers: "action-quiet",
1595
1545
  icon: "ri:list-unordered",
1596
- label: z(h)("chatFilePreview.outline"),
1597
- title: z(h)("chatFilePreview.outline"),
1598
- "aria-label": z(h)("chatFilePreview.outline"),
1546
+ label: z(u)("chatFilePreview.outline"),
1547
+ title: z(u)("chatFilePreview.outline"),
1548
+ "aria-label": z(u)("chatFilePreview.outline"),
1599
1549
  "aria-expanded": je.value,
1600
1550
  onClick: r[2] ||= (e) => je.value = !je.value
1601
1551
  }, null, 8, [
@@ -1603,15 +1553,15 @@ var K = {
1603
1553
  "title",
1604
1554
  "aria-label",
1605
1555
  "aria-expanded"
1606
- ])) : S("", !0),
1607
- V.value ? (F(), C(y, { key: 3 }, [
1608
- E(i, {
1556
+ ])) : w("", !0),
1557
+ V.value ? (F(), T(x, { key: 3 }, [
1558
+ O(i, {
1609
1559
  class: "pk-word-preview__fit",
1610
1560
  modifiers: "action-quiet",
1611
1561
  icon: "ri:expand-width-line",
1612
- label: z(h)("chatFilePreview.fitWidth"),
1613
- title: z(h)("chatFilePreview.fitWidth"),
1614
- "aria-label": z(h)("chatFilePreview.fitWidth"),
1562
+ label: z(u)("chatFilePreview.fitWidth"),
1563
+ title: z(u)("chatFilePreview.fitWidth"),
1564
+ "aria-label": z(u)("chatFilePreview.fitWidth"),
1615
1565
  disabled: ve.value,
1616
1566
  onClick: r[3] ||= (e) => ve.value = !0
1617
1567
  }, null, 8, [
@@ -1620,83 +1570,83 @@ var K = {
1620
1570
  "aria-label",
1621
1571
  "disabled"
1622
1572
  ]),
1623
- E(i, {
1573
+ O(i, {
1624
1574
  modifiers: "action-quiet",
1625
1575
  icon: "ri:subtract-line",
1626
- "aria-label": z(h)("chatFilePreview.zoomOut"),
1576
+ "aria-label": z(u)("chatFilePreview.zoomOut"),
1627
1577
  disabled: be.value <= .3,
1628
1578
  onClick: r[4] ||= (e) => xe(-.1)
1629
1579
  }, null, 8, ["aria-label", "disabled"]),
1630
- w("span", Zt, R(Math.round(be.value * 100)) + "% ", 1),
1631
- E(i, {
1580
+ E("span", Kt, R(Math.round(be.value * 100)) + "% ", 1),
1581
+ O(i, {
1632
1582
  modifiers: "action-quiet",
1633
1583
  icon: "ri:add-line",
1634
- "aria-label": z(h)("chatFilePreview.zoomIn"),
1584
+ "aria-label": z(u)("chatFilePreview.zoomIn"),
1635
1585
  disabled: be.value >= 2,
1636
1586
  onClick: r[5] ||= (e) => xe(.1)
1637
1587
  }, null, 8, ["aria-label", "disabled"])
1638
- ], 64)) : S("", !0)
1588
+ ], 64)) : w("", !0)
1639
1589
  ])]),
1640
- V.value ? (F(), C("div", {
1590
+ V.value ? (F(), T("div", {
1641
1591
  key: 1,
1642
1592
  ref_key: "measureEl",
1643
1593
  ref: D,
1644
1594
  class: "pk-word-preview__measure",
1645
1595
  "aria-hidden": "true",
1646
- style: N(W.value)
1647
- }, [(F(!0), C(y, null, L(_.value, (t) => (F(), C("div", {
1596
+ style: P(ce.value)
1597
+ }, [(F(!0), T(x, null, L(v.value, (t) => (F(), T("div", {
1648
1598
  key: t.key,
1649
1599
  "data-item": ""
1650
- }, [E(Ct, {
1600
+ }, [O(vt, {
1651
1601
  block: e.preview.blocks[t.block],
1652
1602
  row: t.row,
1653
1603
  mode: e.mode,
1654
- page: P.value
1604
+ page: M.value
1655
1605
  }, null, 8, [
1656
1606
  "block",
1657
1607
  "row",
1658
1608
  "mode",
1659
1609
  "page"
1660
- ])]))), 128)), (F(!0), C(y, null, L(e.preview.parts, (t, n) => (F(), C("div", {
1610
+ ])]))), 128)), (F(!0), T(x, null, L(e.preview.parts, (t, n) => (F(), T("div", {
1661
1611
  key: n,
1662
1612
  "data-part": n
1663
- }, [(F(!0), C(y, null, L(z(s)(t, e.mode), (n) => (F(), x(Ct, {
1613
+ }, [(F(!0), T(x, null, L(z(l)(t, e.mode), (n) => (F(), C(vt, {
1664
1614
  key: n.key,
1665
1615
  block: t[n.block],
1666
1616
  row: n.row,
1667
1617
  mode: e.mode,
1668
- page: P.value
1618
+ page: M.value
1669
1619
  }, null, 8, [
1670
1620
  "block",
1671
1621
  "row",
1672
1622
  "mode",
1673
1623
  "page"
1674
- ]))), 128))], 8, Qt))), 128))], 4)) : S("", !0)
1624
+ ]))), 128))], 8, qt))), 128))], 4)) : w("", !0)
1675
1625
  ], 2);
1676
1626
  };
1677
1627
  }
1678
- }), nn = ["aria-label"], rn = { class: "pk-file-preview__head" }, an = { class: "pk-file-preview__file" }, on = {
1628
+ }), Zt = ["aria-label"], Qt = { class: "pk-file-preview__head" }, $t = { class: "pk-file-preview__file" }, en = {
1679
1629
  class: "pk-file-preview__tile",
1680
1630
  "aria-hidden": "true"
1681
- }, sn = { class: "pk-file-preview__name" }, cn = { class: "pk-file-preview__title" }, ln = {
1631
+ }, tn = { class: "pk-file-preview__name" }, nn = { class: "pk-file-preview__title" }, rn = {
1682
1632
  class: "pk-file-preview__note",
1683
1633
  role: "status"
1684
- }, un = {
1634
+ }, an = {
1685
1635
  key: 0,
1686
1636
  class: "pk-file-preview__progress",
1687
1637
  "aria-hidden": "true"
1688
- }, dn = {
1638
+ }, on = {
1689
1639
  key: 1,
1690
1640
  class: "pk-file-preview__tools"
1691
- }, fn = ["aria-label"], pn = { class: "pk-file-preview__version" }, mn = { class: "pk-file-preview__mode-long" }, hn = { class: "pk-file-preview__mode-short" }, gn = { class: "pk-file-preview__actions" }, _n = { class: "pk-file-preview__body" }, vn = {
1641
+ }, sn = ["aria-label"], cn = { class: "pk-file-preview__version" }, ln = { class: "pk-file-preview__mode-long" }, un = { class: "pk-file-preview__mode-short" }, dn = { class: "pk-file-preview__actions" }, fn = { class: "pk-file-preview__body" }, pn = {
1692
1642
  key: 0,
1693
1643
  class: "pk-file-preview__skeleton vv-skeleton"
1694
- }, yn = {
1644
+ }, mn = {
1695
1645
  key: 1,
1696
1646
  class: "pk-file-preview__empty"
1697
- }, bn = /*@__PURE__*/ O({
1647
+ }, hn = /*@__PURE__*/ k({
1698
1648
  __name: "PkFilePreview",
1699
- props: /*@__PURE__*/ j({
1649
+ props: /*@__PURE__*/ M({
1700
1650
  kind: {},
1701
1651
  filename: {},
1702
1652
  version: {},
@@ -1725,7 +1675,7 @@ var K = {
1725
1675
  },
1726
1676
  fitModifiers: {}
1727
1677
  }),
1728
- emits: /*@__PURE__*/ j([
1678
+ emits: /*@__PURE__*/ M([
1729
1679
  "close",
1730
1680
  "version",
1731
1681
  "restore",
@@ -1738,120 +1688,120 @@ var K = {
1738
1688
  "update:zoom",
1739
1689
  "update:fit"
1740
1690
  ]),
1741
- setup(e, { emit: r }) {
1742
- let i = e, a = r, { t: o, locale: s } = ce({ useScope: "global" }), c = I(!1), l;
1743
- H(() => i.working, (e, t) => {
1744
- e ? (l = t === void 0 ? void 0 : i.version, c.value = !1) : l !== void 0 && (c.value = i.version === l, l = void 0);
1745
- }, { immediate: !0 }), H(() => [i.version, i.fileId], () => {
1746
- i.working || (c.value = !1);
1691
+ setup(e, { emit: n }) {
1692
+ let a = e, o = n, { t: s, locale: c } = le({ useScope: "global" }), l = I(!1), u;
1693
+ H(() => a.working, (e, t) => {
1694
+ e ? (u = t === void 0 ? void 0 : a.version, l.value = !1) : u !== void 0 && (l.value = a.version === u, u = void 0);
1695
+ }, { immediate: !0 }), H(() => [a.version, a.fileId], () => {
1696
+ a.working || (l.value = !1);
1747
1697
  });
1748
- let u = b(() => i.versions ?? []), d = b(() => i.version ? u.value.indexOf(i.version) : -1), f = b(() => d.value > 0 ? u.value[d.value - 1] : void 0), p = b(() => d.value >= 0 && d.value < u.value.length - 1 ? u.value[d.value + 1] : void 0), m = B(e, "mode"), h = B(e, "sheet"), g = B(e, "zoom"), _ = B(e, "fit"), D = b(() => [
1698
+ let d = S(() => a.versions ?? []), f = S(() => a.version ? d.value.indexOf(a.version) : -1), p = S(() => f.value > 0 ? d.value[f.value - 1] : void 0), m = S(() => f.value >= 0 && f.value < d.value.length - 1 ? d.value[f.value + 1] : void 0), h = B(e, "mode"), g = B(e, "sheet"), _ = B(e, "zoom"), v = B(e, "fit"), y = S(() => [
1749
1699
  {
1750
1700
  value: "markup",
1751
- label: o("chatFilePreview.modeMarkup")
1701
+ label: s("chatFilePreview.modeMarkup")
1752
1702
  },
1753
1703
  {
1754
1704
  value: "accepted",
1755
- label: o("chatFilePreview.modeAccepted")
1705
+ label: s("chatFilePreview.modeAccepted")
1756
1706
  },
1757
1707
  {
1758
1708
  value: "original",
1759
- label: o("chatFilePreview.modeOriginal")
1709
+ label: s("chatFilePreview.modeOriginal")
1760
1710
  }
1761
- ]), O = b(() => i.preview?.kind === "word" && i.preview.revisionAuthors.length > 0);
1762
- H(() => i.version, () => {
1763
- m.value = "markup";
1711
+ ]), ee = S(() => a.preview?.kind === "word" && a.preview.revisionAuthors.length > 0);
1712
+ H(() => a.version, () => {
1713
+ h.value = "markup";
1764
1714
  });
1765
- let k = ae("rootEl"), A = ie(), j = I(!1), N = () => {
1715
+ let k = oe("rootEl"), A = ae(), j = I(!1), M = () => {
1766
1716
  A.value = void 0, j.value = !1;
1767
1717
  };
1768
1718
  H(() => [
1769
- i.version,
1770
- i.preview,
1771
- m.value,
1772
- h.value
1773
- ], N);
1774
- let te = (e) => {
1719
+ a.version,
1720
+ a.preview,
1721
+ h.value,
1722
+ g.value
1723
+ ], M);
1724
+ let P = (e) => {
1775
1725
  j.value || (A.value = e);
1776
- }, ne = b(() => A.value?.format === "docx" && pe());
1726
+ }, ne = S(() => A.value?.format === "docx" && r());
1777
1727
  H(j, async (e, t) => {
1778
1728
  let n = A.value;
1779
- t && !e && n?.format === "docx" && (await ee(), n.restore());
1729
+ t && !e && n?.format === "docx" && (await te(), n.restore());
1780
1730
  });
1781
- let P = b(() => !i.version || i.version === u.value[u.value.length - 1]), re = () => {
1782
- let e = u.value[u.value.length - 1];
1783
- e && a("version", e);
1784
- }, V = b(() => {
1731
+ let re = S(() => !a.version || a.version === d.value[d.value.length - 1]), ie = () => {
1732
+ let e = d.value[d.value.length - 1];
1733
+ e && o("version", e);
1734
+ }, V = S(() => {
1785
1735
  let e = A.value;
1786
- return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > ge;
1787
- }), oe = b(() => A.value?.format === "docx" && m.value === "original"), W = b(() => V.value || oe.value), se = b(() => oe.value ? o("selectionActions.hintOriginal") : V.value ? o(A.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: A.value?.format === "docx" ? 200 : ge }) : void 0), le = (e) => e[s.value] ?? e[s.value.split("-")[0]] ?? Object.values(e)[0] ?? "", de = ["explain", "summarize"], fe = b(() => {
1788
- let e = A.value, t = i.selectionActions;
1736
+ return e?.format === "docx" ? e.paragraphCount > 200 : (e?.cells ?? 0) > G;
1737
+ }), U = S(() => A.value?.format === "docx" && h.value === "original"), ce = S(() => V.value || U.value), W = S(() => U.value ? s("selectionActions.hintOriginal") : V.value ? s(A.value?.format === "docx" ? "selectionActions.hintParagraphs" : "selectionActions.hintCells", { count: A.value?.format === "docx" ? 200 : G }) : void 0), ue = (e) => e[c.value] ?? e[c.value.split("-")[0]] ?? Object.values(e)[0] ?? "", fe = ["explain", "summarize"], pe = S(() => {
1738
+ let e = A.value, t = a.selectionActions;
1789
1739
  if (!e || !t) return [];
1790
1740
  let n = e.format;
1791
- return [...(n === "docx" && W.value ? de : t.builtIns).map((e) => ({
1741
+ return [...(n === "docx" && ce.value ? fe : t.builtIns).map((e) => ({
1792
1742
  id: e,
1793
- label: o(`selectionActions.builtIn.${e}`),
1794
- ...e === "translate" && { asks: o("selectionActions.translateAsks") },
1795
- prompt: (t) => o(`selectionActions.prompt.${n}.${e}`, { language: t ?? "" })
1796
- })), ...(W.value ? [] : t.actions).map((e) => ({
1743
+ label: s(`selectionActions.builtIn.${e}`),
1744
+ ...e === "translate" && { asks: s("selectionActions.translateAsks") },
1745
+ prompt: (t) => s(`selectionActions.prompt.${n}.${e}`, { language: t ?? "" })
1746
+ })), ...(ce.value ? [] : t.actions).map((e) => ({
1797
1747
  id: e.id,
1798
- label: le(e.label),
1748
+ label: ue(e.label),
1799
1749
  icon: e.icon,
1800
- prompt: () => le(e.prompt)
1750
+ prompt: () => ue(e.prompt)
1801
1751
  }))];
1802
- }), G = (e) => {
1803
- if (e.format === "docx") return o("selectionActions.labelParagraphs", {
1804
- file: i.filename,
1752
+ }), me = (e) => {
1753
+ if (e.format === "docx") return s("selectionActions.labelParagraphs", {
1754
+ file: a.filename,
1805
1755
  count: e.paragraphCount
1806
1756
  }, e.paragraphCount);
1807
1757
  let [t, n] = e.range.split(":");
1808
- return n ? o("selectionActions.labelCells", {
1809
- file: i.filename,
1758
+ return n ? s("selectionActions.labelCells", {
1759
+ file: a.filename,
1810
1760
  sheet: e.sheet,
1811
1761
  from: t,
1812
1762
  to: n
1813
- }) : o("selectionActions.labelCell", {
1814
- file: i.filename,
1763
+ }) : s("selectionActions.labelCell", {
1764
+ file: a.filename,
1815
1765
  sheet: e.sheet,
1816
1766
  cell: t
1817
1767
  });
1818
- }, me = (e) => {
1819
- if (!i.fileId || !i.storedFileName) return;
1768
+ }, he = (e) => {
1769
+ if (!a.fileId || !a.storedFileName) return;
1820
1770
  let t = {
1821
- fileId: i.fileId,
1822
- version: i.version ?? 1,
1823
- storedFileName: i.storedFileName,
1824
- label: G(e).slice(0, 200)
1771
+ fileId: a.fileId,
1772
+ version: a.version ?? 1,
1773
+ storedFileName: a.storedFileName,
1774
+ label: me(e).slice(0, 200)
1825
1775
  };
1826
1776
  if (e.format === "docx") {
1827
1777
  let { measure: n, ...r } = e;
1828
1778
  return {
1829
1779
  ...t,
1830
1780
  ...r,
1831
- ...oe.value && { original: !0 }
1781
+ ...U.value && { original: !0 }
1832
1782
  };
1833
1783
  }
1834
- let { measure: n, cells: r, ...a } = e;
1784
+ let { measure: n, cells: r, ...i } = e;
1835
1785
  return {
1836
1786
  ...t,
1837
- ...a
1787
+ ...i
1838
1788
  };
1839
- }, he = (e, t) => {
1840
- let n = A.value, r = n && me(n);
1841
- r && (a("selectionSend", e, r, {
1789
+ }, K = (e, t) => {
1790
+ let n = A.value, r = n && he(n);
1791
+ r && (o("selectionSend", e, r, {
1842
1792
  id: t,
1843
1793
  size: n.format === "docx" ? n.paragraphCount : n.cells
1844
- }), N(), document.getSelection()?.removeAllRanges());
1845
- }, K = (e, t) => {
1846
- let n = fe.value.find((t) => t.id === e);
1847
- n && he(n.prompt(t), e);
1848
- }, q = I(0);
1849
- ue(k, "scroll", () => q.value++, {
1794
+ }), M(), document.getSelection()?.removeAllRanges());
1795
+ }, ge = (e, t) => {
1796
+ let n = pe.value.find((t) => t.id === e);
1797
+ n && K(n.prompt(t), e);
1798
+ }, _e = I(0);
1799
+ de(k, "scroll", () => _e.value++, {
1850
1800
  capture: !0,
1851
1801
  passive: !0
1852
- }), ue(window, "resize", () => q.value++, { passive: !0 });
1853
- let _e = b(() => {
1854
- q.value;
1802
+ }), de(window, "resize", () => _e.value++, { passive: !0 });
1803
+ let q = S(() => {
1804
+ _e.value;
1855
1805
  let e = A.value?.measure(), t = k.value?.getBoundingClientRect();
1856
1806
  if (e && t) return {
1857
1807
  start: {
@@ -1867,9 +1817,9 @@ var K = {
1867
1817
  }
1868
1818
  };
1869
1819
  });
1870
- return (r, i) => {
1871
- let s = v, l = t;
1872
- return F(), C("section", {
1820
+ return (n, r) => {
1821
+ let a = b, c = t;
1822
+ return F(), T("section", {
1873
1823
  ref_key: "rootEl",
1874
1824
  ref: k,
1875
1825
  class: "pk-file-preview",
@@ -1877,153 +1827,153 @@ var K = {
1877
1827
  tabindex: "-1",
1878
1828
  autofocus: ""
1879
1829
  }, [
1880
- w("header", rn, [
1881
- w("div", an, [w("span", on, [E(s, {
1830
+ E("header", Qt, [
1831
+ E("div", $t, [E("span", en, [O(a, {
1882
1832
  name: e.kind === "word" ? "ri:file-word-2-line" : "ri:file-excel-2-line",
1883
- class: M(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
1884
- }, null, 8, ["name", "class"])]), w("div", sn, [w("strong", cn, R(e.filename), 1), w("span", ln, [e.working ? (F(), C(y, { key: 0 }, [i[14] ||= w("span", {
1833
+ class: N(e.kind === "word" ? "pk-file-preview__icon--word" : "pk-file-preview__icon--sheet")
1834
+ }, null, 8, ["name", "class"])]), E("div", tn, [E("strong", nn, R(e.filename), 1), E("span", rn, [e.working ? (F(), T(x, { key: 0 }, [r[14] ||= E("span", {
1885
1835
  class: "pk-file-preview__spinner",
1886
1836
  "aria-hidden": "true"
1887
- }, null, -1), T(" " + R(z(o)("chatFilePreview.working")), 1)], 64)) : c.value ? (F(), C(y, { key: 1 }, [T(R(z(o)("chatFilePreview.answeredInChat")) + " ", 1), E(l, {
1837
+ }, null, -1), D(" " + R(z(s)("chatFilePreview.working")), 1)], 64)) : l.value ? (F(), T(x, { key: 1 }, [D(R(z(s)("chatFilePreview.answeredInChat")) + " ", 1), O(c, {
1888
1838
  modifiers: "link",
1889
1839
  class: "pk-file-preview__show-chat",
1890
- label: z(o)("chatFilePreview.showChat"),
1891
- onClick: i[0] ||= (e) => a("showChat")
1892
- }, null, 8, ["label"])], 64)) : (F(), C(y, { key: 2 }, [T(R(z(o)("chatFilePreview.readOnly")), 1)], 64))])])]),
1893
- e.working ? (F(), C("div", un)) : S("", !0),
1894
- e.version && u.value.length > 1 || O.value ? (F(), C("div", dn, [e.version && u.value.length > 1 ? (F(), C("nav", {
1840
+ label: z(s)("chatFilePreview.showChat"),
1841
+ onClick: r[0] ||= (e) => o("showChat")
1842
+ }, null, 8, ["label"])], 64)) : (F(), T(x, { key: 2 }, [D(R(z(s)("chatFilePreview.readOnly")), 1)], 64))])])]),
1843
+ e.working ? (F(), T("div", an)) : w("", !0),
1844
+ e.version && d.value.length > 1 || ee.value ? (F(), T("div", on, [e.version && d.value.length > 1 ? (F(), T("nav", {
1895
1845
  key: 0,
1896
1846
  class: "pk-file-preview__versions",
1897
- "aria-label": z(o)("chatFilePreview.versions")
1847
+ "aria-label": z(s)("chatFilePreview.versions")
1898
1848
  }, [
1899
- E(l, {
1849
+ O(c, {
1900
1850
  modifiers: "action-quiet",
1901
1851
  icon: "ri:arrow-left-s-line",
1902
- "aria-label": z(o)("chatFilePreview.previousVersion"),
1903
- disabled: !f.value,
1904
- onClick: i[1] ||= (e) => f.value && a("version", f.value)
1852
+ "aria-label": z(s)("chatFilePreview.previousVersion"),
1853
+ disabled: !p.value,
1854
+ onClick: r[1] ||= (e) => p.value && o("version", p.value)
1905
1855
  }, null, 8, ["aria-label", "disabled"]),
1906
- w("span", pn, R(z(o)("chatFilePreview.versionOf", {
1856
+ E("span", cn, R(z(s)("chatFilePreview.versionOf", {
1907
1857
  version: e.version,
1908
- count: u.value.length
1858
+ count: d.value.length
1909
1859
  })), 1),
1910
- E(l, {
1860
+ O(c, {
1911
1861
  modifiers: "action-quiet",
1912
1862
  icon: "ri:arrow-right-s-line",
1913
- "aria-label": z(o)("chatFilePreview.nextVersion"),
1914
- disabled: !p.value,
1915
- onClick: i[2] ||= (e) => p.value && a("version", p.value)
1863
+ "aria-label": z(s)("chatFilePreview.nextVersion"),
1864
+ disabled: !m.value,
1865
+ onClick: r[2] ||= (e) => m.value && o("version", m.value)
1916
1866
  }, null, 8, ["aria-label", "disabled"])
1917
- ], 8, fn)) : S("", !0), O.value ? (F(), x(n, {
1867
+ ], 8, sn)) : w("", !0), ee.value ? (F(), C(i, {
1918
1868
  key: 1,
1919
- modelValue: m.value,
1920
- "onUpdate:modelValue": i[3] ||= (e) => m.value = e,
1869
+ modelValue: h.value,
1870
+ "onUpdate:modelValue": r[3] ||= (e) => h.value = e,
1921
1871
  name: "revisions",
1922
1872
  segmented: "",
1923
1873
  class: "pk-file-preview__modes u-segmented-fit mb-0",
1924
- "aria-label": z(o)("chatFilePreview.modes"),
1925
- options: D.value
1874
+ "aria-label": z(s)("chatFilePreview.modes"),
1875
+ options: y.value
1926
1876
  }, {
1927
- markup: U(() => [w("span", mn, R(z(o)("chatFilePreview.modeMarkup")), 1), w("span", hn, R(z(o)("chatFilePreview.modeMarkupShort")), 1)]),
1877
+ markup: se(() => [E("span", ln, R(z(s)("chatFilePreview.modeMarkup")), 1), E("span", un, R(z(s)("chatFilePreview.modeMarkupShort")), 1)]),
1928
1878
  _: 1
1929
1879
  }, 8, [
1930
1880
  "modelValue",
1931
1881
  "aria-label",
1932
1882
  "options"
1933
- ])) : S("", !0)])) : S("", !0),
1934
- w("div", gn, [
1935
- e.restorable ? (F(), x(l, {
1883
+ ])) : w("", !0)])) : w("", !0),
1884
+ E("div", dn, [
1885
+ e.restorable ? (F(), C(c, {
1936
1886
  key: 0,
1937
1887
  modifiers: "action-quiet",
1938
1888
  icon: "ri:arrow-go-back-line",
1939
- label: z(o)("chatFilePreview.restore"),
1940
- onClick: i[4] ||= (e) => a("restore")
1941
- }, null, 8, ["label"])) : S("", !0),
1942
- E(l, {
1889
+ label: z(s)("chatFilePreview.restore"),
1890
+ onClick: r[4] ||= (e) => o("restore")
1891
+ }, null, 8, ["label"])) : w("", !0),
1892
+ O(c, {
1943
1893
  href: e.downloadUrl,
1944
1894
  download: "",
1945
1895
  modifiers: "action-quiet",
1946
1896
  icon: "ri:download-line",
1947
- title: z(o)("chatFilePreview.download"),
1948
- "aria-label": z(o)("chatFilePreview.download")
1897
+ title: z(s)("chatFilePreview.download"),
1898
+ "aria-label": z(s)("chatFilePreview.download")
1949
1899
  }, null, 8, [
1950
1900
  "href",
1951
1901
  "title",
1952
1902
  "aria-label"
1953
1903
  ]),
1954
- e.resize === "expand" ? (F(), x(l, {
1904
+ e.resize === "expand" ? (F(), C(c, {
1955
1905
  key: 1,
1956
1906
  modifiers: "action-quiet",
1957
1907
  icon: "ri:fullscreen-line",
1958
- title: z(o)("chatFilePreview.expand"),
1959
- "aria-label": z(o)("chatFilePreview.expand"),
1960
- onClick: i[5] ||= (e) => a("resize")
1961
- }, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (F(), x(l, {
1908
+ title: z(s)("chatFilePreview.expand"),
1909
+ "aria-label": z(s)("chatFilePreview.expand"),
1910
+ onClick: r[5] ||= (e) => o("resize")
1911
+ }, null, 8, ["title", "aria-label"])) : e.resize === "shrink" ? (F(), C(c, {
1962
1912
  key: 2,
1963
1913
  modifiers: "action-quiet",
1964
1914
  icon: "ri:fullscreen-exit-line",
1965
- title: z(o)("chatFilePreview.shrink"),
1966
- "aria-label": z(o)("chatFilePreview.shrink"),
1967
- onClick: i[6] ||= (e) => a("resize")
1968
- }, null, 8, ["title", "aria-label"])) : S("", !0),
1969
- E(l, {
1915
+ title: z(s)("chatFilePreview.shrink"),
1916
+ "aria-label": z(s)("chatFilePreview.shrink"),
1917
+ onClick: r[6] ||= (e) => o("resize")
1918
+ }, null, 8, ["title", "aria-label"])) : w("", !0),
1919
+ O(c, {
1970
1920
  modifiers: "action-quiet",
1971
1921
  icon: "ri:close-line",
1972
- title: z(o)("chatFilePreview.close"),
1973
- "aria-label": z(o)("chatFilePreview.close"),
1974
- onClick: i[7] ||= (e) => a("close")
1922
+ title: z(s)("chatFilePreview.close"),
1923
+ "aria-label": z(s)("chatFilePreview.close"),
1924
+ onClick: r[7] ||= (e) => o("close")
1975
1925
  }, null, 8, ["title", "aria-label"])
1976
1926
  ])
1977
1927
  ]),
1978
- w("div", _n, [e.loading ? (F(), C("div", vn, [(F(), C(y, null, L(8, (e) => w("div", {
1928
+ E("div", fn, [e.loading ? (F(), T("div", pn, [(F(), T(x, null, L(8, (e) => E("div", {
1979
1929
  key: e,
1980
- class: M(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
1981
- }, null, 2)), 64))])) : e.error || !e.preview ? (F(), C("p", yn, R(z(o)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (F(), x(tn, {
1930
+ class: N(["vv-skeleton__item pk-file-preview__skeleton-line", e % 3 ? "w-full" : "w-128"])
1931
+ }, null, 2)), 64))])) : e.error || !e.preview ? (F(), T("p", mn, R(z(s)("chatFilePreview.unavailable")), 1)) : e.preview.kind === "word" ? (F(), C(Xt, {
1982
1932
  key: 2,
1983
- zoom: g.value,
1984
- "onUpdate:zoom": i[8] ||= (e) => g.value = e,
1985
- fit: _.value,
1986
- "onUpdate:fit": i[9] ||= (e) => _.value = e,
1933
+ zoom: _.value,
1934
+ "onUpdate:zoom": r[8] ||= (e) => _.value = e,
1935
+ fit: v.value,
1936
+ "onUpdate:fit": r[9] ||= (e) => v.value = e,
1987
1937
  preview: e.preview,
1988
- mode: O.value ? m.value : "markup",
1938
+ mode: ee.value ? h.value : "markup",
1989
1939
  marked: e.changes?.kind === "word" ? e.changes.paragraphs : void 0,
1990
- onSelect: te
1940
+ onSelect: P
1991
1941
  }, null, 8, [
1992
1942
  "zoom",
1993
1943
  "fit",
1994
1944
  "preview",
1995
1945
  "mode",
1996
1946
  "marked"
1997
- ])) : (F(), x($, {
1947
+ ])) : (F(), C(ct, {
1998
1948
  key: 3,
1999
- sheet: h.value,
2000
- "onUpdate:sheet": i[10] ||= (e) => h.value = e,
2001
- zoom: g.value,
2002
- "onUpdate:zoom": i[11] ||= (e) => g.value = e,
1949
+ sheet: g.value,
1950
+ "onUpdate:sheet": r[10] ||= (e) => g.value = e,
1951
+ zoom: _.value,
1952
+ "onUpdate:zoom": r[11] ||= (e) => _.value = e,
2003
1953
  preview: e.preview,
2004
1954
  marked: e.changes?.kind === "spreadsheet" ? e.changes.cells : void 0,
2005
- onSelect: te
1955
+ onSelect: P
2006
1956
  }, null, 8, [
2007
1957
  "sheet",
2008
1958
  "zoom",
2009
1959
  "preview",
2010
1960
  "marked"
2011
1961
  ]))]),
2012
- e.selectionActions && A.value && _e.value ? (F(), x(Ne, {
1962
+ e.selectionActions && A.value && q.value ? (F(), C(ke, {
2013
1963
  key: 0,
2014
1964
  asking: j.value,
2015
- "onUpdate:asking": i[12] ||= (e) => j.value = e,
1965
+ "onUpdate:asking": r[12] ||= (e) => j.value = e,
2016
1966
  strategy: "absolute",
2017
- anchor: _e.value,
2018
- actions: fe.value,
2019
- hint: se.value,
1967
+ anchor: q.value,
1968
+ actions: pe.value,
1969
+ hint: W.value,
2020
1970
  touch: ne.value,
2021
- note: P.value ? void 0 : z(o)("selectionActions.notLatest", { version: e.version }),
2022
- "note-action": z(o)("selectionActions.openLatest"),
2023
- onAction: K,
2024
- onAsk: i[13] ||= (e) => he(e, "ask"),
2025
- onNote: re,
2026
- onClose: N
1971
+ note: re.value ? void 0 : z(s)("selectionActions.notLatest", { version: e.version }),
1972
+ "note-action": z(s)("selectionActions.openLatest"),
1973
+ onAction: ge,
1974
+ onAsk: r[13] ||= (e) => K(e, "ask"),
1975
+ onNote: ie,
1976
+ onClose: M
2027
1977
  }, null, 8, [
2028
1978
  "asking",
2029
1979
  "anchor",
@@ -2032,11 +1982,11 @@ var K = {
2032
1982
  "touch",
2033
1983
  "note",
2034
1984
  "note-action"
2035
- ])) : S("", !0)
2036
- ], 8, nn);
1985
+ ])) : w("", !0)
1986
+ ], 8, Zt);
2037
1987
  };
2038
1988
  }
2039
- }), xn = /* @__PURE__ */ e({ default: () => Sn }), Sn = bn;
2040
- export { q as i, xn as n, K as r, Sn as t };
1989
+ }), gn = /* @__PURE__ */ e({ default: () => _n }), _n = hn;
1990
+ export { pe as i, gn as n, fe as r, _n as t };
2041
1991
 
2042
- //# sourceMappingURL=PkFilePreview-qizsvSVW.js.map
1992
+ //# sourceMappingURL=PkFilePreview-Cb-1YRPN.js.map