@8wave/ai-elements 0.124.0-beta.9 → 0.124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/_chunks/{PkFilePreview-D_piCsAW.js → PkFilePreview-BwHe4-m1.js} +368 -346
  2. package/dist/_chunks/PkFilePreview-BwHe4-m1.js.map +1 -0
  3. package/dist/_chunks/{PkFilePreviewDialog-Bq0ipzrJ.js → PkFilePreviewDialog-LWxNgkzk.js} +2 -2
  4. package/dist/_chunks/{PkFilePreviewDialog-Bq0ipzrJ.js.map → PkFilePreviewDialog-LWxNgkzk.js.map} +1 -1
  5. package/dist/_chunks/{PkStreamingMarkdown-CHwrLP75.js → PkStreamingMarkdown-BvgO6aHe.js} +2 -2
  6. package/dist/_chunks/{PkStreamingMarkdown-CHwrLP75.js.map → PkStreamingMarkdown-BvgO6aHe.js.map} +1 -1
  7. package/dist/_chunks/{PkToolChatFile-DO4zjMJr.js → PkToolChatFile-OuaeZTxw.js} +62 -54
  8. package/dist/_chunks/PkToolChatFile-OuaeZTxw.js.map +1 -0
  9. package/dist/_chunks/{PkToolShowArtifact-B2-3-k2F.js → PkToolShowArtifact-BqgW3E6D.js} +2 -2
  10. package/dist/_chunks/{PkToolShowArtifact-B2-3-k2F.js.map → PkToolShowArtifact-BqgW3E6D.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowContactForm-DbOZHB_G.js → PkToolShowContactForm-DDDXopZp.js} +2 -2
  12. package/dist/_chunks/{PkToolShowContactForm-DbOZHB_G.js.map → PkToolShowContactForm-DDDXopZp.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowForm-o2LuWDNq.js → PkToolShowForm-D2LZ8Kkl.js} +3 -3
  14. package/dist/_chunks/{PkToolShowForm-o2LuWDNq.js.map → PkToolShowForm-D2LZ8Kkl.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowSources-CUNneZCp.js → PkToolShowSources-DA4SOt-H.js} +2 -2
  16. package/dist/_chunks/{PkToolShowSources-CUNneZCp.js.map → PkToolShowSources-DA4SOt-H.js.map} +1 -1
  17. package/dist/_chunks/excelNumberFormat-CIbRUEwQ.js +543 -0
  18. package/dist/_chunks/excelNumberFormat-CIbRUEwQ.js.map +1 -0
  19. package/dist/_chunks/{utils-BHvRrCzW.js → utils-euH8esYP.js} +7 -6
  20. package/dist/_chunks/utils-euH8esYP.js.map +1 -0
  21. package/dist/ai-elements.es.js +8 -8
  22. package/dist-vue/PkChatbot.js +1 -1
  23. package/dist-vue/PkChatbotEmptyState.js +1 -1
  24. package/dist-vue/PkChatbotInput.js +1 -1
  25. package/dist-vue/PkChatbotMessages.js +1 -1
  26. package/dist-vue/PkChatbotStepPayload.js +1 -1
  27. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  28. package/dist-vue/PkChatbotSteps.js +1 -1
  29. package/dist-vue/PkChatbotViewChat.js +1 -1
  30. package/dist-vue/PkChatbotViewConversations.js +1 -1
  31. package/dist-vue/_chunks/{PkChatbot-DQssgXm3.js → PkChatbot-BRttF7Lo.js} +5 -5
  32. package/dist-vue/_chunks/{PkChatbot-DQssgXm3.js.map → PkChatbot-BRttF7Lo.js.map} +1 -1
  33. package/dist-vue/_chunks/{PkChatbotEmptyState-B6qxJAPT.js → PkChatbotEmptyState-CLOH5Z2d.js} +2 -2
  34. package/dist-vue/_chunks/{PkChatbotEmptyState-B6qxJAPT.js.map → PkChatbotEmptyState-CLOH5Z2d.js.map} +1 -1
  35. package/dist-vue/_chunks/{PkChatbotInput-Bk8OS1xU.js → PkChatbotInput-BK7f1jFE.js} +2 -2
  36. package/dist-vue/_chunks/{PkChatbotInput-Bk8OS1xU.js.map → PkChatbotInput-BK7f1jFE.js.map} +1 -1
  37. package/dist-vue/_chunks/{PkChatbotMessages-D4LJZxv7.js → PkChatbotMessages-Ck0ofhtK.js} +14 -14
  38. package/dist-vue/_chunks/{PkChatbotMessages-D4LJZxv7.js.map → PkChatbotMessages-Ck0ofhtK.js.map} +1 -1
  39. package/dist-vue/_chunks/{PkChatbotStepPayload-_0WRbSR6.js → PkChatbotStepPayload-D682n3VR.js} +2 -2
  40. package/dist-vue/_chunks/{PkChatbotStepPayload-_0WRbSR6.js.map → PkChatbotStepPayload-D682n3VR.js.map} +1 -1
  41. package/dist-vue/_chunks/{PkChatbotStepToolDetail-DiaervF2.js → PkChatbotStepToolDetail-D5c8rqj9.js} +3 -3
  42. package/dist-vue/_chunks/{PkChatbotStepToolDetail-DiaervF2.js.map → PkChatbotStepToolDetail-D5c8rqj9.js.map} +1 -1
  43. package/dist-vue/_chunks/{PkChatbotSteps-BqL-ClgI.js → PkChatbotSteps-CtKRHqaG.js} +5 -5
  44. package/dist-vue/_chunks/{PkChatbotSteps-BqL-ClgI.js.map → PkChatbotSteps-CtKRHqaG.js.map} +1 -1
  45. package/dist-vue/_chunks/{PkChatbotViewChat-BfVLCU_j.js → PkChatbotViewChat-D8depeWQ.js} +6 -6
  46. package/dist-vue/_chunks/{PkChatbotViewChat-BfVLCU_j.js.map → PkChatbotViewChat-D8depeWQ.js.map} +1 -1
  47. package/dist-vue/_chunks/{PkChatbotViewConversations-C32O6SsT.js → PkChatbotViewConversations-B-dmLi-8.js} +2 -2
  48. package/dist-vue/_chunks/{PkChatbotViewConversations-C32O6SsT.js.map → PkChatbotViewConversations-B-dmLi-8.js.map} +1 -1
  49. package/dist-vue/_chunks/PkFilePreview-B54Dp_Rs.js +1149 -0
  50. package/dist-vue/_chunks/PkFilePreview-B54Dp_Rs.js.map +1 -0
  51. package/dist-vue/_chunks/{PkFilePreviewDialog-BSvgiM9A.js → PkFilePreviewDialog-QDPoZh1v.js} +2 -2
  52. package/dist-vue/_chunks/{PkFilePreviewDialog-BSvgiM9A.js.map → PkFilePreviewDialog-QDPoZh1v.js.map} +1 -1
  53. package/dist-vue/_chunks/{PkStreamingMarkdown-Dk3iXhTm.js → PkStreamingMarkdown-qnKwvrCg.js} +2 -2
  54. package/dist-vue/_chunks/{PkStreamingMarkdown-Dk3iXhTm.js.map → PkStreamingMarkdown-qnKwvrCg.js.map} +1 -1
  55. package/dist-vue/_chunks/PkToolChatFile-i0rHgFxB.js +227 -0
  56. package/dist-vue/_chunks/PkToolChatFile-i0rHgFxB.js.map +1 -0
  57. package/dist-vue/_chunks/{PkToolShowArtifact-BtCGilTJ.js → PkToolShowArtifact-Dh4ogn6A.js} +2 -2
  58. package/dist-vue/_chunks/{PkToolShowArtifact-BtCGilTJ.js.map → PkToolShowArtifact-Dh4ogn6A.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkToolShowContactForm-BZNIeJpf.js → PkToolShowContactForm-BGTI1sio.js} +2 -2
  60. package/dist-vue/_chunks/{PkToolShowContactForm-BZNIeJpf.js.map → PkToolShowContactForm-BGTI1sio.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkToolShowDiagram-KD4MfVkP.js → PkToolShowDiagram-xef3wJb0.js} +2 -2
  62. package/dist-vue/_chunks/{PkToolShowDiagram-KD4MfVkP.js.map → PkToolShowDiagram-xef3wJb0.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkToolShowForm-Dtfpi58S.js → PkToolShowForm-Crg4Kl6v.js} +3 -3
  64. package/dist-vue/_chunks/{PkToolShowForm-Dtfpi58S.js.map → PkToolShowForm-Crg4Kl6v.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkToolShowImageGallery-DnS04nTs.js → PkToolShowImageGallery-D9hdGBHK.js} +2 -2
  66. package/dist-vue/_chunks/{PkToolShowImageGallery-DnS04nTs.js.map → PkToolShowImageGallery-D9hdGBHK.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkToolShowProductList-BlFKAtqQ.js → PkToolShowProductList-SC5aKDCw.js} +2 -2
  68. package/dist-vue/_chunks/{PkToolShowProductList-BlFKAtqQ.js.map → PkToolShowProductList-SC5aKDCw.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkToolShowSources-DM177ZlR.js → PkToolShowSources-Bf9_JwFL.js} +2 -2
  70. package/dist-vue/_chunks/{PkToolShowSources-DM177ZlR.js.map → PkToolShowSources-Bf9_JwFL.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkToolShowVideo-DQdVpaWT.js → PkToolShowVideo-C2ITZDNo.js} +2 -2
  72. package/dist-vue/_chunks/{PkToolShowVideo-DQdVpaWT.js.map → PkToolShowVideo-C2ITZDNo.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkToolShowWebPages-Cx2Ft_wN.js → PkToolShowWebPages-BrefGxKQ.js} +2 -2
  74. package/dist-vue/_chunks/{PkToolShowWebPages-Cx2Ft_wN.js.map → PkToolShowWebPages-BrefGxKQ.js.map} +1 -1
  75. package/dist-vue/_chunks/excelNumberFormat-COn5tHoH.js +543 -0
  76. package/dist-vue/_chunks/excelNumberFormat-COn5tHoH.js.map +1 -0
  77. package/dist-vue/_chunks/{utils-BuxgMuKv.js → utils-B0PnU1Rk.js} +7 -6
  78. package/dist-vue/_chunks/utils-B0PnU1Rk.js.map +1 -0
  79. package/dist-vue/composables.js +1 -1
  80. package/dist-vue/index.js +21 -21
  81. package/dist-vue/index.js.map +1 -1
  82. package/dist-vue/packages/components/src/chat/excelNumberFormat.d.ts +34 -0
  83. package/dist-vue/packages/components/src/chat/useChatFilePreview.d.ts +20 -0
  84. package/dist-vue/packages/components/src/chat/utils.d.ts +2 -0
  85. package/dist-vue/packages/models/src/schema/SpreadsheetPreview.d.ts +26 -0
  86. package/dist-vue/packages/models/src/schema/WordPreview.d.ts +11 -0
  87. package/package.json +1 -1
  88. package/dist/_chunks/PkFilePreview-D_piCsAW.js.map +0 -1
  89. package/dist/_chunks/PkToolChatFile-DO4zjMJr.js.map +0 -1
  90. package/dist/_chunks/utils-BHvRrCzW.js.map +0 -1
  91. package/dist-vue/_chunks/PkFilePreview-jeqvHDm7.js +0 -1127
  92. package/dist-vue/_chunks/PkFilePreview-jeqvHDm7.js.map +0 -1
  93. package/dist-vue/_chunks/PkToolChatFile-Bnj-YFLh.js +0 -219
  94. package/dist-vue/_chunks/PkToolChatFile-Bnj-YFLh.js.map +0 -1
  95. package/dist-vue/_chunks/utils-BuxgMuKv.js.map +0 -1
@@ -0,0 +1,543 @@
1
+ import { _ as e, b as t, g as n, o as r, p as i, r as a, s as o, u as s, x as c, y as l } from "./zod-Cty6wiWN.js";
2
+ // ../../packages/models/src/schema/WordPreview.ts
3
+ var u = e({
4
+ x: n(),
5
+ y: n(),
6
+ xFrom: a(["page", "margin"]),
7
+ yFrom: a([
8
+ "page",
9
+ "margin",
10
+ "paragraph"
11
+ ]),
12
+ wrap: a([
13
+ "behind",
14
+ "front",
15
+ "around",
16
+ "block"
17
+ ])
18
+ }), d = e({
19
+ ref: t(),
20
+ width: n(),
21
+ height: n(),
22
+ anchor: u.optional()
23
+ }), f = e({
24
+ text: t(),
25
+ change: a(["inserted", "deleted"]).optional(),
26
+ author: t().optional(),
27
+ bold: i(!0).optional(),
28
+ italic: i(!0).optional(),
29
+ underline: i(!0).optional(),
30
+ strike: i(!0).optional(),
31
+ caps: i(!0).optional(),
32
+ vertAlign: a(["super", "sub"]).optional(),
33
+ font: t().optional(),
34
+ size: n().optional(),
35
+ color: t().optional(),
36
+ highlight: t().optional(),
37
+ image: i(!0).optional(),
38
+ picture: d.optional(),
39
+ field: a([
40
+ "page",
41
+ "pages",
42
+ "sectionPages"
43
+ ]).optional()
44
+ }), p = e({
45
+ align: a([
46
+ "left",
47
+ "center",
48
+ "right",
49
+ "justify"
50
+ ]).optional(),
51
+ indentLeft: n().optional(),
52
+ indentRight: n().optional(),
53
+ firstLine: n().optional(),
54
+ spaceBefore: n().optional(),
55
+ spaceAfter: n().optional(),
56
+ lineHeight: n().optional(),
57
+ lineExact: n().optional(),
58
+ lineAtLeast: n().optional(),
59
+ pageBreakBefore: i(!0).optional(),
60
+ keepNext: i(!0).optional(),
61
+ shading: t().optional(),
62
+ size: n().optional()
63
+ }), m = e({
64
+ runs: r(f),
65
+ span: n().optional(),
66
+ fill: t().optional(),
67
+ align: a([
68
+ "left",
69
+ "center",
70
+ "right",
71
+ "justify"
72
+ ]).optional(),
73
+ size: n().optional(),
74
+ keepNext: i(!0).optional()
75
+ }), h = n().optional(), g = s("kind", [
76
+ e({
77
+ kind: i("heading"),
78
+ level: n(),
79
+ label: t().optional(),
80
+ runs: r(f),
81
+ style: p.optional(),
82
+ section: h
83
+ }),
84
+ e({
85
+ kind: i("paragraph"),
86
+ label: t().optional(),
87
+ runs: r(f),
88
+ style: p.optional(),
89
+ section: h
90
+ }),
91
+ e({
92
+ kind: i("table"),
93
+ rows: r(r(m)),
94
+ widths: r(n()).optional(),
95
+ borders: o(),
96
+ pageBreakBefore: i(!0).optional(),
97
+ section: h
98
+ })
99
+ ]), _ = e({
100
+ width: n(),
101
+ height: n(),
102
+ margins: e({
103
+ top: n(),
104
+ right: n(),
105
+ bottom: n(),
106
+ left: n()
107
+ })
108
+ }), v = e({
109
+ default: t().optional(),
110
+ first: t().optional(),
111
+ even: t().optional()
112
+ }), y = e({
113
+ page: _,
114
+ headerDistance: n(),
115
+ footerDistance: n(),
116
+ headers: v,
117
+ footers: v,
118
+ titlePage: i(!0).optional(),
119
+ pageStart: n().optional()
120
+ }), b = e({
121
+ kind: i("word"),
122
+ blocks: r(g),
123
+ truncated: o(),
124
+ revisionAuthors: r(t()),
125
+ page: _,
126
+ defaults: e({
127
+ font: t(),
128
+ size: n(),
129
+ color: t().optional()
130
+ }),
131
+ sections: r(y).optional(),
132
+ parts: l(t(), r(g)).optional(),
133
+ evenAndOddHeaders: i(!0).optional(),
134
+ images: l(t(), t()).optional()
135
+ }), x = e({
136
+ color: t(),
137
+ width: n()
138
+ }), S = e({
139
+ bold: i(!0).optional(),
140
+ italic: i(!0).optional(),
141
+ underline: i(!0).optional(),
142
+ strike: i(!0).optional(),
143
+ size: n().optional(),
144
+ color: t().optional(),
145
+ fill: t().optional(),
146
+ align: a([
147
+ "left",
148
+ "center",
149
+ "right"
150
+ ]).optional(),
151
+ valign: a(["top", "middle"]).optional(),
152
+ wrap: i(!0).optional(),
153
+ indent: n().optional(),
154
+ borders: e({
155
+ top: x.optional(),
156
+ right: x.optional(),
157
+ bottom: x.optional(),
158
+ left: x.optional()
159
+ }).optional()
160
+ }), C = e({
161
+ col: n(),
162
+ value: c([
163
+ t(),
164
+ n(),
165
+ o()
166
+ ]).optional(),
167
+ format: a([
168
+ "currency",
169
+ "percent",
170
+ "date",
171
+ "error"
172
+ ]).optional(),
173
+ decimals: n().optional(),
174
+ maxDecimals: n().optional(),
175
+ currency: t().optional(),
176
+ grouped: i(!0).optional(),
177
+ numFmt: n().optional(),
178
+ serial: n().optional(),
179
+ missing: i(!0).optional(),
180
+ formula: t().optional(),
181
+ style: n().optional(),
182
+ span: e({
183
+ rows: n(),
184
+ cols: n()
185
+ }).optional()
186
+ }), w = e({
187
+ row: n(),
188
+ height: n().optional(),
189
+ cells: r(C)
190
+ }), T = e({
191
+ col: n(),
192
+ width: n().optional(),
193
+ hidden: i(!0).optional()
194
+ }), E = e({
195
+ name: t(),
196
+ rows: r(w),
197
+ columns: r(T),
198
+ hiddenRows: r(n()).optional(),
199
+ lastRow: n(),
200
+ lastColumn: n(),
201
+ frozen: e({
202
+ rows: n(),
203
+ cols: n()
204
+ }).optional(),
205
+ gridlines: o(),
206
+ moreRows: n(),
207
+ moreColumns: n()
208
+ }), D = e({
209
+ kind: i("spreadsheet"),
210
+ sheets: r(E),
211
+ styles: r(S),
212
+ numberFormats: r(t()).optional(),
213
+ date1904: i(!0).optional(),
214
+ staleFormulas: o(),
215
+ computedFormulas: o()
216
+ });
217
+ s("kind", [b, D]);
218
+ var O = (e) => /[dmyhs]|am\/pm|a\/p/i.test(e.replace(/"[^"]*"|\\.|\[(?![hms]+\])[^\]]*\]/gi, "")), k = {
219
+ black: "#000000",
220
+ blue: "#0000ff",
221
+ cyan: "#00ffff",
222
+ green: "#00ff00",
223
+ magenta: "#ff00ff",
224
+ red: "#ff0000",
225
+ white: "#ffffff",
226
+ yellow: "#ffff00"
227
+ }, A = (e) => {
228
+ let t = [], n = "";
229
+ for (let r = 0; r < e.length; r++) {
230
+ let i = e[r], a = i === "\"" ? e.indexOf("\"", r + 1) : i === "[" ? e.indexOf("]", r) : -2;
231
+ if (a !== -2) {
232
+ let t = a === -1 ? e.length : a;
233
+ n += e.slice(r, t + 1), r = t;
234
+ } else i === "\\" || i === "_" || i === "*" ? (n += e.slice(r, r + 2), r++) : i === ";" ? (t.push(n), n = "") : n += i;
235
+ }
236
+ return [...t, n];
237
+ }, j = (e) => {
238
+ let t = [], n = { tokens: t }, r = (e) => {
239
+ let n = t[t.length - 1];
240
+ n?.kind === "text" ? n.text += e : e && t.push({
241
+ kind: "text",
242
+ text: e
243
+ });
244
+ };
245
+ for (let i = 0; i < e.length; i++) {
246
+ let a = e[i];
247
+ if (a === "\"") {
248
+ let t = e.indexOf("\"", i + 1), n = t === -1 ? e.length : t;
249
+ r(e.slice(i + 1, n)), i = n;
250
+ } else if (a === "\\") r(e[i + 1] ?? ""), i++;
251
+ else if (a === "_") r(" "), i++;
252
+ else if (a === "*") r(e[i + 1] ?? ""), i++;
253
+ else if (a === "[") {
254
+ let t = e.indexOf("]", i), a = e.slice(i + 1, t === -1 ? void 0 : t);
255
+ i = t === -1 ? e.length : t;
256
+ let o = /^(<=|>=|<>|<|>|=)\s*(-?[\d.]+)$/.exec(a), s = /^\$([^-]*)(?:-[0-9a-f]+)?$/i.exec(a);
257
+ o ? n.condition = {
258
+ op: o[1],
259
+ than: Number(o[2])
260
+ } : k[a.toLowerCase()] ? n.color = k[a.toLowerCase()] : s && r(s[1]);
261
+ } else a === "0" || a === "#" || a === "?" ? t.push({
262
+ kind: "digit",
263
+ char: a
264
+ }) : a === "." ? t.push({ kind: "point" }) : a === "," ? t.push({ kind: "comma" }) : a === "%" ? (t.push({ kind: "percent" }), r("%")) : /[eE][+-]/.test(e.slice(i, i + 2)) ? (t.push({
265
+ kind: "exponent",
266
+ plus: e[i + 1] === "+"
267
+ }), i++) : /^general/i.test(e.slice(i, i + 7)) ? (t.push({ kind: "general" }), i += 6) : a === "@" ? t.push({ kind: "general" }) : r(a);
268
+ }
269
+ return n;
270
+ }, M = (e, { op: t, than: n }) => t === "<" ? e < n : t === "<=" ? e <= n : t === ">" ? e > n : t === ">=" ? e >= n : t === "=" ? e === n : e !== n, N = (e, t) => {
271
+ let [n, r, i] = e;
272
+ return n.condition || r?.condition ? n.condition && M(t, n.condition) ? {
273
+ section: n,
274
+ minus: !1
275
+ } : r?.condition && M(t, r.condition) ? {
276
+ section: r,
277
+ minus: !1
278
+ } : {
279
+ section: i ?? (r && !r.condition ? r : n),
280
+ minus: t < 0
281
+ } : t < 0 && r ? {
282
+ section: r,
283
+ minus: !1
284
+ } : t === 0 && i ? {
285
+ section: i,
286
+ minus: !1
287
+ } : {
288
+ section: n,
289
+ minus: t < 0
290
+ };
291
+ }, P = (e = 2e3) => {
292
+ let t = /* @__PURE__ */ new Map();
293
+ return (n, r) => {
294
+ let i = t.get(n);
295
+ return i === void 0 && (i = r(), t.size >= e && t.clear(), t.set(n, i)), i;
296
+ };
297
+ }, F = P(), I = (e, t) => F(`${e}|${JSON.stringify(t)}`, () => new Intl.NumberFormat(e, t)), L = (e, t) => e.format(Number.isFinite(t) ? t.toPrecision(15) : t), R = (e, t) => e.formatToParts(Number.isFinite(t) ? t.toPrecision(15) : t), ee = P(), te = (e) => ee(e, () => {
298
+ let t = I(e, {}).formatToParts(12345.6);
299
+ return {
300
+ decimal: t.find((e) => e.type === "decimal")?.value ?? ".",
301
+ group: t.find((e) => e.type === "group")?.value ?? ","
302
+ };
303
+ }), z = (e) => e.map((e) => e.kind === "text" ? e.text : "").join(""), B = 20, V = (e, t, n) => {
304
+ let r = [...e === "0" ? "" : e], i = t.filter((e) => e.kind === "digit").length, a = [];
305
+ for (let e = t.length - 1; e >= 0; e--) {
306
+ let n = t[e];
307
+ if (n.kind === "text") a.unshift(n.text);
308
+ else if (n.kind === "digit") {
309
+ i--;
310
+ let e = i === 0 ? r.splice(0).join("") : r.pop();
311
+ a.unshift(e || (n.char === "0" ? "0" : n.char === "?" ? " " : ""));
312
+ }
313
+ }
314
+ let o = a.join("");
315
+ return n ? o.replace(/\d+/, (e) => e.replace(/\B(?=(\d{3})+$)/g, n)) : o;
316
+ }, H = (e, t) => {
317
+ let n = [...e];
318
+ return t.map((e) => e.kind === "text" ? e.text : e.kind === "digit" ? n.shift() ?? (e.char === "0" ? "0" : e.char === "?" ? " " : "") : "").join("");
319
+ }, U = (e, t) => {
320
+ let [n, r, i, a] = [
321
+ 0,
322
+ 1,
323
+ 1,
324
+ 0
325
+ ], o = e;
326
+ for (let e = 0; e < 64; e++) {
327
+ let e = Math.floor(o), s = e * i + n, c = e * a + r;
328
+ if (c > t) break;
329
+ [n, r, i, a] = [
330
+ i,
331
+ a,
332
+ s,
333
+ c
334
+ ];
335
+ let l = o - e;
336
+ if (l < 1e-12) break;
337
+ o = 1 / l;
338
+ }
339
+ return a === 0 ? {
340
+ p: 0,
341
+ q: 1
342
+ } : {
343
+ p: i,
344
+ q: a
345
+ };
346
+ }, W = P(), G = (e) => W(e, () => A(e).slice(0, 3).map(j)), K = (e, t, n) => {
347
+ let { section: r, minus: i } = N(G(e), t), { tokens: a } = r, o = r.color ? { color: r.color } : {}, s = (e, t) => ({
348
+ text: (i && t ? "-" : "") + e,
349
+ ...o
350
+ }), c = Math.abs(t);
351
+ if (!a.length) return {
352
+ text: "",
353
+ ...o
354
+ };
355
+ if (a.some((e) => e.kind === "general")) {
356
+ let e = L(I(n, {
357
+ maximumFractionDigits: 10,
358
+ useGrouping: !1
359
+ }), c);
360
+ return s(a.map((t) => t.kind === "general" ? e : t.kind === "text" ? t.text : "").join(""), c !== 0);
361
+ }
362
+ let l = a.findIndex((e) => e.kind === "digit");
363
+ if (l === -1) return s(z(a), c !== 0);
364
+ let { decimal: u, group: d } = te(n), f = a.reduce((e, t, n) => t.kind === "digit" ? n : e, -1), p = z(a.slice(0, l)), m = c * 100 ** a.filter((e) => e.kind === "percent").length, h = a.findIndex((e) => e.kind === "exponent");
365
+ if (h !== -1) {
366
+ let e = a.slice(l, h), t = e.findIndex((e) => e.kind === "point"), n = (t === -1 ? e : e.slice(0, t)).filter((e) => e.kind === "digit").length, r = t === -1 ? [] : e.slice(t).filter((e) => e.kind === "digit"), i = a[h].plus, o = a.slice(h).filter((e) => e.kind === "digit").length, d = R(I("en-US", {
367
+ notation: n >= 3 ? "engineering" : "scientific",
368
+ minimumFractionDigits: Math.min(r.filter((e) => e.kind === "digit" && e.char === "0").length, B),
369
+ maximumFractionDigits: Math.min(r.length, B),
370
+ useGrouping: !1
371
+ }), m), g = d.findIndex((e) => e.type === "exponentSeparator"), _ = d.slice(0, g).map((e) => e.type === "decimal" ? u : e.value).join(""), v = Number(d.slice(g + 1).map((e) => e.type === "exponentMinusSign" ? "-" : e.value).join(""));
372
+ return s(`${p}${_}E${v < 0 ? "-" : i ? "+" : ""}${String(Math.abs(v)).padStart(o, "0")}${z(a.slice(f + 1))}`, c !== 0);
373
+ }
374
+ let g = a.findIndex((e, t) => e.kind === "text" && e.text.includes("/") && t > l && t <= f + 1);
375
+ if (g !== -1) {
376
+ let e = a.findIndex((e, t) => e.kind === "text" && t > l && t < g), t = a.slice(e === -1 ? l : e + 1, g), n = a.slice(g + 1, f + 1), r = /\/\s*(\d+)/.exec(a[g].text), i = e === -1 ? 0 : Math.floor(c), o = c - i, u = r ? {
377
+ p: Math.round(o * Number(r[1])),
378
+ q: Number(r[1])
379
+ } : U(o, 10 ** Math.min(n.filter((e) => e.kind === "digit").length, 6) - 1), { q: d } = u, { p: m } = u, h = i;
380
+ m === d && e !== -1 && (h++, m = 0);
381
+ let _ = e === -1 ? "" : V(String(h), a.slice(l, e), void 0);
382
+ return s(p + (m ? `${_}${e === -1 ? "" : z([a[e]])}${V(String(m), t, void 0)}${r ? z([a[g]]) : `/${H(String(d), n)}`}` : _ || "0") + z(a.slice(Math.max(f, g) + 1)), h !== 0 || m !== 0);
383
+ }
384
+ let _ = a.findIndex((e, t) => e.kind === "point" && t > l && t <= f), v = _ === -1 ? f : _ - 1, y = 0;
385
+ for (; a[f + 1 + y]?.kind === "comma";) y++;
386
+ let b = a.slice(l, v + 1), x = b.some((e, t) => e.kind === "comma" && b.slice(0, t).some((e) => e.kind === "digit") && b.slice(t + 1).some((e) => e.kind === "digit")), S = _ === -1 ? [] : a.slice(_ + 1, f + 1), C = S.filter((e) => e.kind === "digit"), [w, T = ""] = L(I("en-US", {
387
+ minimumFractionDigits: Math.min(C.filter((e) => e.kind === "digit" && e.char === "0").length, B),
388
+ maximumFractionDigits: Math.min(C.length, B),
389
+ useGrouping: !1
390
+ }), m / 1e3 ** y).split(".");
391
+ return s(p + (V(w, b.filter((e) => e.kind !== "comma"), x ? d : void 0) + (_ === -1 ? "" : u + H(T, S))) + z(a.slice(f + 1 + y)), Number(w) !== 0 || Number(T) !== 0);
392
+ }, q = {
393
+ 409: "en-US",
394
+ 809: "en-GB",
395
+ 410: "it-IT",
396
+ "40c": "fr-FR",
397
+ 407: "de-DE",
398
+ c0a: "es-ES",
399
+ 416: "pt-BR"
400
+ }, J = /* @__PURE__ */ new Set(["mm-dd-yy", "m/d/yy h:mm"]), Y = (e) => {
401
+ let t = [], n, r = (e) => {
402
+ let n = t[t.length - 1];
403
+ n?.kind === "text" ? n.text += e : e && t.push({
404
+ kind: "text",
405
+ text: e
406
+ });
407
+ };
408
+ for (let i = 0; i < e.length; i++) {
409
+ let a = e.slice(i), o = e[i], s = (/^([a-z])\1*/i.exec(a)?.[0] ?? o).length, c = o.toLowerCase();
410
+ if (o === "\"") {
411
+ let t = e.indexOf("\"", i + 1), n = t === -1 ? e.length : t;
412
+ r(e.slice(i + 1, n)), i = n;
413
+ } else if (o === "\\") r(e[i + 1] ?? ""), i++;
414
+ else if (o === "_" || o === "*") r(o === "_" ? " " : e[i + 1] ?? ""), i++;
415
+ else if (o === "[") {
416
+ let r = e.indexOf("]", i), a = e.slice(i + 1, r === -1 ? void 0 : r);
417
+ i = r === -1 ? e.length : r;
418
+ let o = /^(h+|m+|s+)$/i.exec(a), s = /^\$[^-]*-([0-9a-f]+)$/i.exec(a);
419
+ if (o) {
420
+ let n = o[1][0].toLowerCase(), r = o[1].length, a = n === "s" ? /^\.(0+)/.exec(e.slice(i + 1))?.[1].length ?? 0 : 0;
421
+ i += a ? a + 1 : 0, t.push(n === "h" ? {
422
+ kind: "hour",
423
+ size: r,
424
+ elapsed: !0
425
+ } : n === "m" ? {
426
+ kind: "minute",
427
+ size: r,
428
+ elapsed: !0
429
+ } : {
430
+ kind: "second",
431
+ size: r,
432
+ elapsed: !0,
433
+ decimals: a
434
+ });
435
+ } else s && (n = q[s[1].toLowerCase().slice(-3)] ?? n);
436
+ } else if (/^(am\/pm|a\/p)/i.test(a)) {
437
+ let e = /^a\/p/i.test(a);
438
+ t.push({
439
+ kind: "ampm",
440
+ short: e
441
+ }), i += e ? 2 : 4;
442
+ } else if (c === "y") t.push({
443
+ kind: "year",
444
+ size: s
445
+ }), i += s - 1;
446
+ else if (c === "d") t.push({
447
+ kind: "day",
448
+ size: s
449
+ }), i += s - 1;
450
+ else if (c === "h") t.push({
451
+ kind: "hour",
452
+ size: s,
453
+ elapsed: !1
454
+ }), i += s - 1;
455
+ else if (c === "s") {
456
+ let e = /^s+\.(0+)/i.exec(a)?.[1].length ?? 0;
457
+ t.push({
458
+ kind: "second",
459
+ size: s,
460
+ elapsed: !1,
461
+ decimals: e
462
+ }), i += s - 1 + (e ? e + 1 : 0);
463
+ } else c === "m" ? (t.push({
464
+ kind: "month",
465
+ size: s
466
+ }), i += s - 1) : r(o);
467
+ }
468
+ return t.forEach((e, n) => {
469
+ if (e.kind !== "month" || e.size > 2) return;
470
+ let r = t.slice(0, n).reverse().find((e) => e.kind !== "text"), i = t.slice(n + 1).find((e) => e.kind !== "text");
471
+ (r?.kind === "hour" || i?.kind === "second") && (t[n] = {
472
+ kind: "minute",
473
+ size: e.size,
474
+ elapsed: !1
475
+ });
476
+ }), {
477
+ parts: t,
478
+ locale: n
479
+ };
480
+ }, X = P(), Z = (e, t) => {
481
+ if (!t && e < 61) {
482
+ let t = e === 60 ? 29 : e > 31 ? e - 31 : e;
483
+ return {
484
+ y: 1900,
485
+ m: e === 60 || e > 31 ? 2 : 1,
486
+ d: t,
487
+ weekday: (e + 6) % 7
488
+ };
489
+ }
490
+ let n = new Date((t ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30)) + e * 864e5);
491
+ return {
492
+ y: n.getUTCFullYear(),
493
+ m: n.getUTCMonth() + 1,
494
+ d: n.getUTCDate(),
495
+ weekday: n.getUTCDay()
496
+ };
497
+ }, ne = P(), Q = (e, t, n) => ne(`${e}|${JSON.stringify(t)}`, () => new Intl.DateTimeFormat(e, {
498
+ ...t,
499
+ timeZone: "UTC"
500
+ })).format(n), re = 2958466, $ = (e, t, n, r = !1) => {
501
+ if (!Number.isFinite(t) || t < 0 || t >= re) return;
502
+ let i = A(e).slice(0, 3), a = G(e), o = N(a, t).section, s = i[a.indexOf(o)] ?? i[0], c = o.color ? { color: o.color } : {}, { parts: l, locale: u } = X(s, () => Y(s)), d = u ?? n, f = l.some((e) => e.kind === "ampm"), p = Math.max(0, ...l.map((e) => e.kind === "second" ? e.decimals : 0)), m = 86400 * 10 ** p, h = Math.round(t * m), g = Math.floor(h / m), _ = h - g * m, v = Math.floor(_ / 10 ** p), y = Z(g, r), b = Math.floor(v / 3600), x = Math.floor(v % 3600 / 60);
503
+ if (J.has(s.replace(/\[[^\]]*\]/g, "").trim())) {
504
+ let e = new Date(Date.UTC(y.y, y.m - 1, Math.max(y.d, 1)));
505
+ return {
506
+ text: Q(n, /^en(-US)?$/i.test(n) ? {
507
+ year: "numeric",
508
+ month: "numeric",
509
+ day: "numeric"
510
+ } : {
511
+ year: "numeric",
512
+ month: "2-digit",
513
+ day: "2-digit"
514
+ }, e) + (/h/i.test(s) ? ` ${String(b).padStart(2, "0")}:${String(x).padStart(2, "0")}` : ""),
515
+ ...c
516
+ };
517
+ }
518
+ let S = new Date(Date.UTC(2e3, y.m - 1, Math.max(y.d, 1))), C = new Date(Date.UTC(2023, 0, 1 + y.weekday)), w = (e, t) => String(e).padStart(Math.min(t, 2), "0");
519
+ return {
520
+ text: l.map((e) => {
521
+ switch (e.kind) {
522
+ case "text": return e.text;
523
+ case "year": return e.size <= 2 ? String(y.y % 100).padStart(2, "0") : String(y.y);
524
+ case "month": return e.size <= 2 ? w(y.m, e.size) : e.size === 3 ? Q(d, { month: "short" }, S).replace(/\.$/, "") : e.size === 4 ? Q(d, { month: "long" }, S) : Q(d, { month: "long" }, S)[0];
525
+ case "day": return e.size <= 2 ? w(y.d, e.size) : Q(d, { weekday: e.size === 3 ? "short" : "long" }, C).replace(/\.$/, "");
526
+ case "hour": return e.elapsed ? w(g * 24 + b, e.size) : w(f ? b % 12 || 12 : b, e.size);
527
+ case "minute": return w(e.elapsed ? (g * 24 + b) * 60 + x : x, e.size);
528
+ case "second": {
529
+ let t = e.elapsed ? Math.floor(h / 10 ** p) : v % 60, n = e.decimals ? `.${String(_ % 10 ** p).padStart(p, "0").slice(0, e.decimals)}` : "";
530
+ return w(t, e.size) + n;
531
+ }
532
+ case "ampm": return e.short ? b < 12 ? "A" : "P" : b < 12 ? "AM" : "PM";
533
+ }
534
+ }).join(""),
535
+ ...c
536
+ };
537
+ }, ie = (e, t, n) => {
538
+ let r = /^(?:(\d{4}-\d{2}-\d{2}))?[ T]?(?:(\d{1,2}):(\d{2})(?::(\d{2}))?)?$/.exec(e.trim()), i = /^-?\d+(\.\d+)?$/.test(e) ? Number(e) : r && (r[1] || r[2]) ? (r[1] ? Date.parse(`${r[1]}T00:00:00Z`) / 864e5 + 25569 : 0) + (Number(r[2] ?? 0) * 3600 + Number(r[3] ?? 0) * 60 + Number(r[4] ?? 0)) / 86400 : void 0;
539
+ return i === void 0 || Number.isNaN(i) ? void 0 : $(t, i, n)?.text;
540
+ };
541
+ export { O as i, $ as n, K as r, ie as t };
542
+
543
+ //# sourceMappingURL=excelNumberFormat-CIbRUEwQ.js.map